aspose file tools*
The moose likes Web Services and the fly likes Asynchronous message from server to client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Asynchronous message from server to client" Watch "Asynchronous message from server to client" New topic
Author

Asynchronous message from server to client

Ashwin Raghavan
Ranch Hand

Joined: Dec 26, 2012
Posts: 30
Hi

I have to create a web service for one of my clients. The requirement is such that the client will access my web services to do some processing and get the result back.

I am building the architecture. My requirement is to get and xml from the client. convert the xml children into xml list and process each child individually. by processing i mean i have to do some work with the information of the child nodes. After the processing for a particular child is complete i want to send a result back to the client asynchronously.

Now i have no idea how to send messages asynchronously from server to client. I have used JMS with MDB before. But it was when both the producer and the consumer were in the same JVM.
But in this case, the producer will be residing on the server and consumer would be the client from some entirely different JVM.
Can you please tell me if it is possible in web services.
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

Ashwin Raghavan wrote:Now i have no idea how to send messages asynchronously from server to client.

There are only 2 options available: polling and pushing. Either you connect to the server periodically and check if there is a new message exists, or keep Socket opened to make server push data to the client any time.
Ashwin Raghavan
Ranch Hand

Joined: Dec 26, 2012
Posts: 30
Thanks surlac

I believe by pushing you are saying that i use topics. subsrcibe a topic for the client, and then keep on passing messages to it. can you please guide me how i can create jms topics in tomcat and pass message to the client. or can you guide me to a link where they have an example.

you help is appreciated.

Thanks in advance.
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

Ashwin Raghavan wrote:I believe by pushing you are saying that i use topics.

Pushing is a concept. There can be various implementations. JMS topics based on one of them, which I believe can vary depending on a vendor.
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

Ashwin Raghavan wrote: can you please guide me how i can create jms topics in tomcat and pass message to the client

First of all, you will need jms broker to do that. Install one and let us know about the results.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Asynchronous message from server to client