Before we can answer, I think we need a little more detail...Are you trying to have LCDS be the point of contact to initiate an asynchronous third party service that will then come back and tell LCDS to use data push to alert the client that made the request that it has been completed?
I think that is a little beyond the scope of LCDS's 'out of the box' capabilities...but not impossible at all
To answer your questions though:
1. No, LCDS out of the box will not know which client to push a message to automatically, but yes, you can send the response to a specific client through their client ID, and if you can track that ID by sending the ID off with your initial request to your third party service and have it return it back as well so your client can be pushed to.
2. This is a little more complex and I think we need more detail before we can even begin to answer this one...
Thanks for your prompt reply.
You are correct in understanding that LCDS will be a point of contact to initiate a Java Service which in turn initiates the operations to be performed at the backend as a result of an action perfomred at the client. Now there will be a scheduler at the server side which wll be constatntly monitoring the module that is doing the processing for the action perfomed. As and when this service gets the completion flag, this service will tell the LCDS to use data push to alert the client that had made the request.
Let me give you an overview of the various layers in our application.
There is a client(Flex UI) which allows user to initiate a request. This UI calls a method of the Utility.jar which is deployed in Flex. war which inturn calls the ejb and then the spring component. Finally this request is submitted to the Queues (Rabbit MQ) which finally submit the message to the module responsible for doing the actions for the request submitted by the client. This is an async process. When the client submits the request, we inform the client that the message has been submitted. But when the module responsible for perfoming the actions is through with its job, it needs to push the completion status to the appropriate client. For this we plan to have a scheduler monitoring the module and getting to know from it as to when the action has got completed and tell LCDS that now it can pass on the message to the appropriate client.
As told by you for using the clientId to push message to teh apprprite client, can you please let me know a link of the same. Or is it there in the Adobe LiveCycle docs.
Thanks again for your help and prompt reply.
1 person found this helpful
Okay, sounds like what I was expecting. I could ramble on about how to achieve this using a custom implementation of push messaging, but I think that would actually be overkill..the simple answer is if you have access to LCDS then you have access to RTMP which allows for non-polling message topics. Could you possibly setup a RTMP channel with subtopics enabled and each client that makes the request brings up a subtopic that the server will respond to when done? Then you could use an asynchronous consumer on the client side to wait for the response?
The only downside to this is that you have no idea of knowing if the client is still connected at that point...but I'm going to assume you can keep it in a message queue or database and instead of pushing the full data back automatically, just alert the client that they need to then make a request for the data once it is completed by posting a message on the topic...that way you know when they got the data and you can hold on to it until the next time the client hooks up and ping for any pending data
As also, suggested by you, we were thinking of using an RTMP channel only for this since its a two way socket that establishes a communication channel between the client and the server and then helps keep messages moving to and fro.
We have successfully implemented RTMP channel and achieved the following functionalities.
1) A client initiated change which gets propagated to the server and then to all the clients.
2) Server push to all the clients.
Now our last step is to implement data push to a particular client. As told by you, we will use the client id but we have some doubts and questions regarding this since we do not have the code examples or anything that could help us in implementing the same.
I would therefore request you to kindly lead us on the following fronts:
1) Is the client id the one that is part of the request- response thread, I saw a client id being printed in the logs when a request is made and the response comes.
2) What code needs to be written on the server side to extract this client id once a call is made so that it can keep this client id with itself to push a message later on.
3) What methods or API are available to be used to push this message to a particular client? Do we need to call the fill method of a particular client using the client id parameter and inform the client that its requested job has been done.
For (3) is the Messaging(Publish and Subscribe model) the right way to go??
It would be great if you could provide us some code snippets just to give us an idea from where we can take it up ourselves.
Looking forward to hear from you.
Message was edited by: testing34