| Author |
JMS Receive message
|
|
|
| HI ppl,
I have a scenarios where a session bean sends a message to a MQ queue, another application picks this message and reply to another queue. I have a Java receiver(not mdb) who is listening to this reply queue(created in different transaction but us
ing same connection as used by initial session bean sender).
The problem is this receiver never receives any message.
I am 100% sure that it is listening to right queue and a message comes to this reply queue.
I am using JMSCorelationId as filter to receive the message.
Do you see any obvious problems in this case.
Any hints .....
thanks in adavance.
| |
| David Currie 2005-05-17, 7:49 am |
| Usually the problem in this situation is that you have not done a
Connection.start(). You can send without doing a start but cannot receive.
Regards,
David
| |
|
| thanks for looking into my post.
I have done connection.start(). Looks like Something else is missing.
| |
| Joseph Marques 2005-05-17, 6:01 pm |
| Why don't you try removing the filter and see if you can successfully
get the messages. By the way, how are you controlling the creation of
correlation ids?
-joe
am_gandhi@hotmail.com wrote:
> thanks for looking into my post.
> I have done connection.start(). Looks like Something else is missing.
| |
|
| I tried removing the filter and it worked. But I need to have correlationID. As when I send the message I get the correlationid and when 3rd party app sends the reply they set the correlationid to be the same.
TextMessage requestTextMsg = session.createTextMessage();
requestTextMsg.setText(request);
requestTextMsg.setJMSReplyTo(replyQ);
producer.send(requestTextMsg);
String messageId = requestTextMsg.getJMSMessageID();
So when I receive I do
String filter = "JMSCorrelationID = '" + messageId + "'";
consumer = session.createConsumer(replyQ, filter);
any ideas
| |
| Joseph Marques 2005-05-18, 6:05 pm |
| Below is an end-to-end example of using JMSCorrelationID.
http://publib.boulder.ibm.com/infoc.../tmj_devap.html
-joe
am_gandhi@hotmail.com wrote:
> I tried removing the filter and it worked. But I need to have correlationID. As when I send the message I get the correlationid and when 3rd party app sends the reply they set the correlationid to be the same.
> TextMessage requestTextMsg = session.createTextMessage();
> requestTextMsg.setText(request);
> requestTextMsg.setJMSReplyTo(replyQ);
> producer.send(requestTextMsg);
> String messageId = requestTextMsg.getJMSMessageID();
>
>
> So when I receive I do
> String filter = "JMSCorrelationID = '" + messageId + "'";
>
> consumer = session.createConsumer(replyQ, filter);
>
> any ideas
|
|
|
|