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 API Support » Double Instance Queue Reader Failing - 2034

Post new topic  Reply to topic
 Double Instance Queue Reader Failing - 2034 « View previous topic :: View next topic » 
Author Message
HonestBroker
PostPosted: Thu Apr 17, 2014 7:09 am    Post subject: Double Instance Queue Reader Failing - 2034 Reply with quote

Newbie

Joined: 30 Mar 2011
Posts: 8

I have a queue-reader application written in C which runs two instances and has been processing many thousands of messages per day for many years without issue.
The input queue is a local queue on a local instance of the queue manager (V7.0.1.3).
Recently the unix environment (Solaris 10) has been reorganised and moved to VM. The queue manager and queues now are on one vm and the queue reader and processing applications are on another.
The queue reader has been recompiled to use client libraries to connect to the input queue.
I have noticed that now, on occasion, the two instances crash, with one logging a 2034 error – No Message Under Cursor.

The interaction with the queue in the code is summarised below along with the various options selected.
Essentially each instance of the queue reader opens a handle to the input queue, then loops while browsing with a wait interval of 15 sec.s. When a message is browsed, it is locked and a destructive Get performed, with Syncpoint. It is at this point that the 2034 is received.

The move to client MQ libraries rather than server MQ libraries is the change here.
Would this behaviour be expected or explained by such a change?
Is there a remedy?

Code:
aMQVarsInfo.MQ_OpenOptionQue =MQOO_INPUT_SHARED + MQOO_BROWSE + MQOO_FAIL_IF_QUIESCING;
MQOPEN()

Loop
   paMQVarsInfo->MQ_gmo.Options = MQGMO_WAIT + MQGMO_CONVERT + MQGMO_BROWSE_FIRST + MQGMO_LOCK + MQGMO_ACCEPT_TRUNCATED_MSG;
   paMQVarsInfo->MQ_gmo.WaitInterval = WAITINTERVAL;
   MQGET()

   IF paMQVarsInfo->MQ_Messlen > 0
      paMQVarsInfo->MQ_gmo.Options = MQGMO_CONVERT + MQGMO_MSG_UNDER_CURSOR + MQGMO_SYNCPOINT;
      MQGET()
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Apr 17, 2014 7:25 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Is the browse really necessary?
Why not immediately do an MQGET under syncpoint?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
HonestBroker
PostPosted: Thu Apr 17, 2014 7:30 am    Post subject: Reply with quote

Newbie

Joined: 30 Mar 2011
Posts: 8

I actually recompiled a version to do that this morning and (probably the way I did it but) it didn't observe the wait and it didn't actually Get the message off the queue. Maybe the cursor is off?
What GMO options would you suggest to do a destructive Get, in a loop?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Apr 17, 2014 7:35 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

HonestBroker wrote:
I actually recompiled a version to do that this morning and (probably the way I did it but) it didn't observe the wait and it didn't actually Get the message off the queue. Maybe the cursor is off?
What GMO options would you suggest to do a destructive Get, in a loop?


Make sure you clear the key fields each start of loop (msgid, correlid, etc...)
(or set them to mqmid_none, mqcid_none etc...)

As options: open for input, shared, syncpoint, wait, wait interval (something appropriate)...

Hope this helps
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
tczielke
PostPosted: Thu Apr 17, 2014 7:41 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

Something else to consider for the robustness of your client application. Did you include Automatic Client Reconnection when you converted your C app from a Server to a Client application? (I included the link from the 7.1 infocenter, because the 7.0 infocenter appears to be currently unreachable).

http://pic.dhe.ibm.com/infocenter/wmqv7/v7r1/topic/com.ibm.mq.doc/fa70190_.htm?resultof=%22%61%75%74%6f%2d%72%65%63%6f%6e%6e%65%63%74%69%6f%6e%22%20
Back to top
View user's profile Send private message
HonestBroker
PostPosted: Thu Apr 17, 2014 8:37 am    Post subject: Reply with quote

Newbie

Joined: 30 Mar 2011
Posts: 8

Quote:
Make sure you clear the key fields each start of loop (msgid, correlid, etc...)
(or set them to mqmid_none, mqcid_none etc...)

As options: open for input, shared, syncpoint, wait, wait interval (something appropriate)...

I had already been taking care or the msgid and correlid etc.

Thank you kindly for taking the time and interest to respond so quickly and positively to this post. I now have an approach to consider and test.

Quote:
Something else to consider for the robustness of your client application. Did you include Automatic Client Reconnection when you converted your C app from a Server to a Client application?

I'll be sure to consider this aspect also. Thank you too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Double Instance Queue Reader Failing - 2034
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.