PDA

View Full Version : Asynchronous Remoting with Spring and ActiveMQ



jpwinans
Aug 19th, 2005, 12:36 PM
Hello all,

Okay, I'm pretty comfortable with syncronous remoting using several methods. However, I'm not as familiar with asynchronous remoting.
Here's a simply case study: I have 10 rich clients that each display a green sign as the user works. When some condition is met, say it's 10 minutes before the full moon, the server sends a message to switch the sign from green to red.
Would this be something I could use ActiveMQ, or Lingo for? And if so, does anyone have a simple hello world example showing how to set up the server and client's ApplicationContext.xml as well as the Java code?

Thanks,
James

jstrachan
Aug 22nd, 2005, 12:23 PM
Lingo does this for you...

http://lingo.codehaus.org/

There is an example using async one-way messaging here...
http://lingo.codehaus.org/Async+Example?refresh=1

The only thing you need to do is enable asynchronous one way requests for your service (which must be void return and have no checked exception)..

http://lingo.codehaus.org/Why+are+async+one+ways+disabled+by+default

viniciuscarvalho
Sep 21st, 2005, 10:29 AM
Well I've done this a lot of times in a SWT application we used red-green lights that monitored the status of an order. As the server changed the order it notified the client.
We didn't use Spring at the time :(

But what you could do is create a Consumer (either receiver/subscriber) and consume messages on a destination (queue/topic) and your listener would take care of the problem ;)