GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes Sample code for synchronous JMS send/reply over MQ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Sample code for synchronous JMS send/reply over MQ?" Watch "Sample code for synchronous JMS send/reply over MQ?" New topic
Author

Sample code for synchronous JMS send/reply over MQ?

Jimmy Ho
Ranch Hand

Joined: Jul 31, 2007
Posts: 61
Anyone have any sample code for synchronous messages using JMS over MQ? I can probably muddle through on my own by taking educated guesses, but I'm looking for best practices, and potential pitfalls.

Basically, server A sends a message to server B, and server B responds. Server A actually waits for the response from server B before continuing on. There's a queue, and then a reply-queue, though I'm not exactly sure if there's special set-up required for a reply-queue.

I'm using Rational Application Developer 6.0, running WAS 5.1 Test Environment, using the Embedded Messaging Client and Server. Everything's running on my laptop right now (both sender and receiver).

Any ideas? Hints? Tips?
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
Since the purpose of messaging is to handle asynchronous communication, its use in a synchronous setting like this is most likely not a good practice. Instead, any of a number of technologies designed for
synchronous processing (servlets, session beans, services,...) fits better into this scenario.
Jimmy Ho
Ranch Hand

Joined: Jul 31, 2007
Posts: 61
For a variety of reasons that I'm not going to get into, we are using MQ partially for synchronous messaging. MQ does have a feature that allows for synchronous messaging. I'm just trying to figure out how to use it.
 
 
subject: Sample code for synchronous JMS send/reply over MQ?