ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Waiting a message on a queue

Post new topic  Reply to topic
 Waiting a message on a queue « View previous topic :: View next topic » 
Author Message
dario.zanelli
PostPosted: Wed Aug 30, 2006 2:20 am    Post subject: Waiting a message on a queue Reply with quote

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
View user's profile Send private message Send e-mail
wschutz
PostPosted: Wed Aug 30, 2006 2:21 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
dario.zanelli
PostPosted: Thu Aug 31, 2006 7:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Waiting a message on a queue
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.