• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Help

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to develop an application where the client sends a request to the server and the sever responds to the client in a asynchronous way and I have implement an asynchronous channel which listens for the data that comes back from the server and then assemble that based on the id which will be passed to server during the request. Can anyone please let me know of any examples for acheiving this.

Thanks,
KK
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have any constraints on the channel? My experience only goes as far as messaging and sockets.

Messaging via JMS has asynchronous modes built in. I don't know if your skills or project make JMS a possibility.

With sockets you might have the client open a server socket and send the ip & port along with the request. The server would respond by connecting to the client's server socket and sending the reply.

Messaging products generate a "correlation id" when you send a request and include the id on the response. That helps you match the response to the original request. You could do the same thing with a conversation over sockets or RMI or whatever you wind up with.

Something like this happens ... I'm showing sockets but JMS would be very similar ...

Lemme know if that helps or confuses.
[ November 27, 2004: Message edited by: Stan James ]
 
K KK
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much for the reply. We are not using JMS for this and I am not familiar with JMS. Can JMS be used without EJB's etc. My application is a kind of middleware which has to connect to a device and then send a request to the device and then wait asynchronously for the reponse , so that the client is not blocked. Your explanation helped me to ujnderstand the concept but it would be very helpful if you have some pointers to some articles or examples which can help me understnad this better. All the help is very much appriciated.

thanks,
KK
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a little thing I did on messaging patterns for some folks at work. There is some async stuff down a ways. There is also a reference to Enterprise Integration Patterns where thay have much more on messaging. If you don't want to get into JMS you won't really be doing messaging, but many of the concepts would apply do doing your own async work.

I don't think I know any other specific references on async callbacks. Event driven environments like Swing might be similar. I almost called my "subscriber" a "listener" in the diagram above. Swing listeners would give you some good background in handling events where the timing and sequence is out of your control.
 
K KK
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Stan. I will look into this and hopefully i will be able to build my appliacation with these pointers.
 
reply
    Bookmark Topic Watch Topic
  • New Topic