|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Custom java application getting 2017 error after 255 browses |
« View previous topic :: View next topic » |
Author |
Message
|
edmondh |
Posted: Fri Mar 30, 2007 6:47 am Post subject: Custom java application getting 2017 error after 255 browses |
|
|
Novice
Joined: 17 Feb 2006 Posts: 14 Location: London
|
Hi
I have written a custom application that reads message from queues.
Before I go a get on message I first have a peep at message. So first I access queue with browse options,
MQC.MQOO_BROWSE
I browse message and close queue.
(I should probably leave queue open & reause connection)
Ok, so when a message exists in queue then I do a GET & my other processing.
However my application ALWAY errors out with a MQ 2017 (MQRC_HANDLE_NOT_AVAILABLE) reason code. It always happens after 255 browses.
Has anyone experienced this before?
Is there some property on my queue queueManager I need to set.
here is most of code for my 'browse' method
Code: |
MQQueueManager mgr = MQResourceManager.getInstance()
.getQueueManager(qMgrName);
MQQueue browseQ = mgr.accessQueue(qName,
MQC.MQOO_BROWSE,
null,
null,
null);
MQMessage browseMessage = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_BROWSE_FIRST | MQC.MQGMO_WAIT | MQC.MQGMO_LOGICAL_ORDER | MQC.MQGMO_ALL_MSGS_AVAILABLE;
int receiverBrowseWaitInterval = new Integer (PropertyManager.getInstance()
.getProperty("receiverBrowseWaitInterval")).intValue();
gmo.waitInterval = receiverBrowseWaitInterval;
log.log(Level.FINE, "Receiver browse wait interval is : "
+ receiverBrowseWaitInterval);
// retrive message
browseQ.get(browseMessage, gmo);
browseQ.close(); |
_________________ Thank you for your time
Ed |
|
Back to top |
|
 |
jsware |
Posted: Fri Mar 30, 2007 7:12 am Post subject: Re: Custom java application getting 2017 error after 255 bro |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
edmondh wrote: |
However my application ALWAY errors out with a MQ 2017 (MQRC_HANDLE_NOT_AVAILABLE) reason code. It always happens after 255 browses. |
Sounds like you're hitting the max handles setting for the queue manager. Are you closing the queue you are getting (rather than browsing) from?
I would suggest you apply the latest fix pack to MQ if you are at CSD08/9/10 or 11 as there were lots of java related memory leak problems.
Why are you using separate queue handles to browse and then get the message? You can use the same one. Check out the MQGMO_MSG_UNDER_CURSOR option. You might also want to check out http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzal.doc/browsmq.htm for details on browsing messages on a queue. _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
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
|
|
|
|