• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JMS for Synchronous Messaging

 
Rishi Krishnan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can we use JMS for Synchronous messaging? Although I read that some JMS providers implement Request/Reply paradigm of messaging, this is just optional and JMS spec doesn't mandate this.

I am not sure why would someone choose JMS for Synchronous Messaging.

Is my understanding correct?

Thanks
Rishi
 
Santiago Urrizola
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we use JMS for Synchronous messaging?

Yes you can implement ir
I am not sure why would someone choose JMS for Synchronous Messaging.

I use it to comunicate with legacy sysmte,i make "calls" by a queue to an old cobol system running in an AS400 mainframe, and receive replies in another queue inditefied by the generated correl_id in the first message.
 
Rishi Krishnan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Santiago,

Thanks for your reply.


I use it to comunicate with legacy sysmte,i make "calls" by a queue to an old cobol system running in an AS400 mainframe, and receive replies in another queue inditefied by the generated correl_id in the first message.


Isn't this two seperate Async calls instead of 1 Sync Messaging?
 
Rishi Krishnan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refer to the following URL:

http://java.sun.com/products/jms/faq.html

Answer for the question below explains that JMS does not do Synchronous message delivery:

Why doesn't the JMS API provide end-to-end synchronous message delivery and notification of delivery?

Ofcourse, I agree that message consumption can be synchronous by implementing recieve() method (block until a message arrives)

Rishi
 
Mike Van
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rishi Krishnan:

Isn't this two seperate Async calls instead of 1 Sync Messaging?


Rishi,

You're correct that these are two asynch calls. However, this implementation, assuming that the queues aren't being written to by anything else, results in a process that appear synchronous. Its a cludge designed to mimic asynchronous behaviour. However, this still doesn't answer your original question: can you use JMS in a synchronous manner. For that, I provide the following quotation from "BEA Weblogic Server 8.1, page 275": [Regarding both the publish-subscribe and point-to-point messaging models of JMS] "Although various models of messaginv exist, all messaging services share a common attribute of asynchronicity. Messages are sent by message producers to message consumers and do not require that the message producer block processsing until the message is received."

IBM, a company we should all agree knows a thing or two about JMS describes synchronisity in JMS as "do it yourself": http://www-128.ibm.com/developerworks/webservices/library/ws-jcajms.html .

Will future versions of JMS support synchronisity? Heck-ildy-tootle-fish, I have no idea. However, if you can assume the JBoss group improve thier code along with the JSR group, then 1.2 - 1.4 changes deal largely with the networks on which the JMS works, not the synchronisity.
 
Santiago Urrizola
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JMS is async. by nature. I say you can implement some tecniches to simulate sincr. communication, like you say with recive method.
 
Rishi Krishnan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,

Your IBM document link is very good:

Here is an excerpt:

Messaging is not the primary choice for request/response-type interactions. Implementing request/response with messaging middleware prevents the transactional coordination between caller and called because of the isolation implied by messaging. Also, response timeouts have to be managed by the caller's programming logic rather than a provided connector implementation.

Thanks a lot for both of you.

Rishi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic