This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I want to post a message to this replyTo queue from the receiver side program. How can i put a message to this replyto queue?
Please suggest me a way -
Brian Tinnel
Ranch Hand
Joined: Aug 25, 2003
Posts: 69
posted
0
Just off the top of my head:
Anand Sidharth
Ranch Hand
Joined: Dec 17, 2003
Posts: 44
posted
0
Thanks Brian But the problem is that the sender and receiver are different queue managers in different machines .... In the code you sent, the session object used is created using the connection formed from the QCF information of the receiver side ... But the replyToQueue is present in the sender queuemanager. How is it possible to send a message to the replyToQ using the receiver connection session? Or am i missing out something here
Brian Tinnel
Ranch Hand
Joined: Aug 25, 2003
Posts: 69
posted
0
You're right, I didn't notice the difference in connection factories.
Have you tried doing a lookup on the other server to obtain the QueueConnectionFactory? You should be able to do that and I would think it would still work.
If the receiver doesn't know what server to connect back to, then perhaps you could add headers to the message containing that information so that you could create the proper InitialContext and lookup the correct QueueConnectionFactory.
Anand Sidharth
Ranch Hand
Joined: Dec 17, 2003
Posts: 44
posted
0
Thanks Brian... Since there could be hundreds of senders (there is only one receiver) there is no way to lookup to the particular sender server.
I think the second option you gave on sending the context info along with the message is a good solution. I would let you know after the implementation.
Actually i was thinking that since the name is 'replyTo' Queue, the JMS provider should take care of finding where the replyTo Queue is located and sending back the reply message i.e., the message object should have provision to form the qcf for the replyTo Queue.
Brian Tinnel
Ranch Hand
Joined: Aug 25, 2003
Posts: 69
posted
0
The thing is, a Queue is not tied to a specific QueueConnectionFactory so there isn't any way for someone to look at a Queue and determine what QCF to use to write to it.