|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Waiting a message on a queue |
« View previous topic :: View next topic » |
Author |
Message
|
dario.zanelli |
Posted: Wed Aug 30, 2006 2:20 am Post subject: Waiting a message on a queue |
|
|
Newbie
Joined: 30 Aug 2006 Posts: 3
|
Hi!!
I've a problem: I want to create a listener on a queue that notify me when a message arrive, using Java but not JMS.
Setting waitInterval to infinite doesn't resolve my problem: when I do a get on the queue I've the reason code 2033, no message on the queue.
How can I do it?
I hope you understand my problem, and I thank you in advance. |
|
Back to top |
|
 |
wschutz |
Posted: Wed Aug 30, 2006 2:21 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
If the wait-interval is infinite (-1), then you can't get a 2033.... show us the relevant code.... _________________ -wayne |
|
Back to top |
|
 |
dario.zanelli |
Posted: Thu Aug 31, 2006 7:44 am Post subject: |
|
|
Newbie
Joined: 30 Aug 2006 Posts: 3
|
wschutz wrote: |
If the wait-interval is infinite (-1), then you can't get a 2033.... show us the relevant code.... |
Hi!
Here there is the code:
try {
MQMessage rcvMessage = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.waitInterval = MQC.MQWI_UNLIMITED;
queue.get(rcvMessage, gmo);
}
.....
If the queue is empty the exception is:
MQJE001: Completion code 2, Causa 2033
com.ibm.mq.MQException: MQJE001: Completion code 2, Causa 2033
at com.ibm.mq.MQQueue.get(MQQueue.java:1033)
at routing.RoutingThread2.run(RoutingThread2.java:61)
Can I listen on a queue (for example with a thread) until a new message is putted on without this exception?
I thank you once again,
Dario
Sorry, you need to ALSO set:
gmo.Options = MQC.MQGMO_WAIT;
Can you post this info to the forum so others can learn what the problem was? Thanks
_________________
-wayne |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|