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 » API PMO generates extra message in failover

Post new topic  Reply to topic
 API PMO generates extra message in failover « View previous topic :: View next topic » 
Author Message
fgarcia
PostPosted: Mon Dec 08, 2025 5:20 pm    Post subject: API PMO generates extra message in failover Reply with quote

Newbie

Joined: 08 Dec 2025
Posts: 2

Our homegrown API that does a PMO with syncpoint and mqcmit in a Multi-instance NFS MQ V9.4 environment generates an extra message during failover exercise. Any help would greatly be appreciated.

/*********************************/
/* WRITE TO MQSeries DESTINATION */
/*******************************/

if (MQ_OVERRIDE == YES) /* override MQ? */

goto WTCHECKPT; /* yes */

sz = sizeof(struct tagMQMD); /* size of MD struct */

memcpy(&md, rdBuff, sz); /* overlay current md struct */

msglen = (inData.recSize - sz); /* record size */

wtBuffPtr = &rdBuff[sz]; /* pt to actual record */



MQPUT(Hcon, Hout, &md, &pmo, msglen, wtBuffPtr, &CompCode, &Reason);



if (CompCode != MQCC_OK)

{

if (Reason == MQRC_FORMAT_ERROR)

{

LogMsg_s(1, "MQPUT - CompCode=%d Reason=%d", CompCode, Reason);

return(-1);

}

LogMsg_s(5, "MQPUT FAILED - CompCode=%d Reason=%d", CompCode, Reason);

return(-1);

}



/***********************/

/* COMMIT MQ SYNCPOINT */

/***********************/

MQCMIT(Hcon, &CompCode, &Reason);

if (CompCode != MQCC_OK)

{

/* Do we need to do anything on MQCC_WARNING - 2124 MQRC_OUTCOME_PENDING ?? */

LogMsg_s(5, "MQCMIT FAILED - CompCode=%d Reason=%d", CompCode, Reason);

return(-1);

}



WTCHECKPT:

/********************************/

/* WRITE THE CHECK POINT RECORD */

/********************************/

cpRec.recNumber = inData.recNumber;

if ((sts = WriteCheckPoint()) != 0)

return(-1);

pHdr->rdCntDMQ = inData.recNumber; /* set write count */
Back to top
View user's profile Send private message
hughson
PostPosted: Tue Dec 09, 2025 1:37 am    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1976
Location: Bay of Plenty, New Zealand

How do you determine that you have an extra message? Do you have one more message than expected on a queue at the end of the exercise?

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
fgarcia
PostPosted: Tue Dec 09, 2025 4:58 am    Post subject: API that does a PMO - Reply Reply with quote

Newbie

Joined: 08 Dec 2025
Posts: 2

We perform the failover with a certain amount of messages 20992 and we end up with 20993. When the failover occurs at the MQCMIT failure the message that was last to be put to the queue is replicated.
Back to top
View user's profile Send private message
hughson
PostPosted: Tue Dec 09, 2025 11:18 am    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1976
Location: Bay of Plenty, New Zealand

So when you have the MQCMIT failure do you put another message and MQCMIT again? It is not clear from your code sample that this is happening.

Also, you have a comment suggesting you get reason code MQRC_OUTCOME_PENDING. Is this the failure you are talking about?

What other resources managers are part of the Unit of Work? Again, this is not shown in your code sample.

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Tue Dec 09, 2025 3:50 pm    Post subject: Re: API that does a PMO - Reply Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9488
Location: US: west coast, almost. Otherwise, enroute.

fgarcia wrote:
We perform the failover with a certain amount of messages 20992 and we end up with 20993. When the failover occurs at the MQCMIT failure the message that was last to be put to the queue is replicated.

Every message put to a queue will be included in queue depth, including messages put within units-of-work - but not yet committed.
You state that the MQCMIT fails. What ReasonCode?
How do you know that the last message put to the queue was replicated? Did you browse the queue and find two identical messages?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
hughson
PostPosted: Tue Dec 09, 2025 6:49 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1976
Location: Bay of Plenty, New Zealand

I will add that the likelihood is that the MQRC_OUTCOME_PENDING reason code means that the MQ part of the Global UoW has been committed and it is one of the other resource managers that has not committed, given that MQ is the TM here.

Please let us know what action your application takes upon receipt of this warning reason code. Does it put another MQ message, and thus you end up with a duplicate?

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » API PMO generates extra message in failover
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.