Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 19th, 2010, 07:44 AM
Registered User
 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Jms Request/Reply question

Hi All,

I am doing a JMS request/reply pattern as specified in Professional JMS.

I get the whole thing of setting up temporary queues for the initial requestor to read a response from the responder.

What I want to know, is whether it is possible to use a single queue for the request and response without the 2 subscribers on the queue hijacking each other's messages.

For example:
- client A sends message to Q.requestReply queue with text ("the request")
- B reads message off Q.requestReply queue
- B captures MessageId
- B sets the replyMessage CorrelationId = MessageId
- B sends replyMessage to Q.requestReply queue with text ("the response")
- A reads the reply message and prints "the response"

Is this possible without B picking up the message that it replied to A?
I am trying this through java, and if A is down, B keep on reading the message that it posted to the Q as a response to A.

Hope this makes sense
Regards
Ruan
 
Old November 19th, 2010, 11:40 AM
Registered User
 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Got it working

I used a message selector in combination with the correaltion id to filter out messages on the producer and the consumer if anyone is interested.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about Request.InputStream chobo2 C# 2008 aka C# 3.0 0 January 15th, 2009 11:00 PM
reply to a question:datatype of unbound object q2q2 BOOK: Access 2003 VBA Programmer's Reference 0 November 8th, 2006 04:58 PM
Request question thunder Classic ASP Basics 1 February 26th, 2006 10:29 AM
Please Help Me IN JMS shailsneh J2EE 0 March 23rd, 2005 09:40 AM
Request.ServerVariables HTTP_REFERRER question savoym Classic ASP Basics 6 May 25th, 2004 02:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.