This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

JMS messages can send synchronus messages?  RSS feed

 
Ranch Hand
Posts: 1310
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to know whether JMS can send only asynchronous messages or it can send synchronous?
 
Ranch Hand
Posts: 542
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do not think it can send synchronous message
 
sam liya
Ranch Hand
Posts: 1310
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how it sends the synchronous messages?
 
Saloon Keeper
Posts: 2406
296
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

sam liya wrote:I need to know whether JMS can send only asynchronous messages or it can send synchronous?


The JMS API doesn't directly support request/response messaging, but you could build this in your application on top of what JMS provides, by having the two endpoints act as both producers and consumers.  Endpoint-1 (client) would send a request message to endpoint-2 (server), and then endpoint-1 would block waiting for a response message from endpoint-2.  After processing the request, endpoint-2 would then send a response message to endpoint-1.

In the request message sent by endpoint-1, an identifier value could be set carried in the JMSCorrelationID header.  Endpoint-2 would extract the identifier from the received message and set the JMSCorrelationID in its response message to the same value.  Endpoint-1 would use the identifier value to build a message selector so only messages which match the selector expression would be delivered to it.  You may want to use to use a pair of message queues - one for request messages and another for response messages.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!