Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Java server Push DataMessage through RTMP LC DataService

Avatar

Level 2

Hello all,

I'm doing a POC to push Data from a (Java) server, though LCDS 3.1 's DataService using RTMP.

Configuration is OK. Adobe Air client DataMessage to server (+Assembler saving in DB) : OK 

I found lots of examples with AsyncMessage, but as This is an RTMP destination through a DataService service, I must send a DataMessage.

Appearently, there are some bugs (or I am missing things/good API doc!).

So please, could you help me?

Here is the code that does the push. The key method is doPush()

NOTE : the messagebroker is set once through Spring. It works for this POC.

I have a Servlet that saves a DTO to the DB and then tries to push it through the service. All seems OK, but I get a NullPointerException (NPE).

Here is the Tomcat 6 LOG (it sends to subscriberID '99' ):

==> what am I doing wrong?

I cannot trace the code (I do not have the source), but the exception thrown is just not helping at all.

Am I missing a header to set?

Thank you so much for your help,

Gregg

1 Accepted Solution

Avatar

Correct answer by
Employee

Since you're filtering your query according to a particular user, then your DataService's fill() parameters could contain a unique token for that user.  When the fill is refreshed on the server after the createItem() (as mentioned in Rohit Kumar's link) only that will be refreshed and pushed out to the client with that token.

The DataServiceTransaction api is the way to go, if you're using LC DataService.

Hope this helps

Pam

View solution in original post

5 Replies

Avatar

Employee

Hi Nuroso,

What version of LCDS are you using?

As such, you need not create DataMessage in order to do server side push. You can directly use DataServiceTransaction to push the updates. See the following section of the LCDS guide for an example: http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WS4ba8596dc6a25eff5473e3781271fa3...

Rohit

Avatar

Level 2

Hi, Kumar,

As stated at the beginning of the post, I'm using LCDS 3.1.

My "problem" is then that I want to post to only 1 subscriberId.

With your answer, all the users are notified, what I really don't need. I need to log each user's actions (such as read, download,...) and not all users have access to all records.

I'll check the API anyways to see if it could help.

Thank you for your time

EDIT : I marked your answer helpful as maybe I'll be able to use selector values... I'll check that on Monday (Western Europ here )

Many thanks

Avatar

Correct answer by
Employee

Since you're filtering your query according to a particular user, then your DataService's fill() parameters could contain a unique token for that user.  When the fill is refreshed on the server after the createItem() (as mentioned in Rohit Kumar's link) only that will be refreshed and pushed out to the client with that token.

The DataServiceTransaction api is the way to go, if you're using LC DataService.

Hope this helps

Pam

Avatar

Level 2

For the records, the NullPointerException problem was solved here :

http://forums.adobe.com/thread/791741?tstart=0

I would rather say "The DataServiceTransaction api is A MUST-HAVE, if you're using LC DataService." 

==> I now can send a Message, I can go on trying the above-mentionned solutions for pushing to 1 subscriber...

Have a good day

Avatar

Level 2

OK - it works now...

Thank you for guiding me.

for the records, here's the working code (can save days of research )

Good day to you all !