We are running into a sporadic problem with duplicate messages when sending
MQ messages from a Windows NT server running MQSeries 5.2 to a mainframe
running MQSeries 5.2.  The duplicate messages with the exact same MSG-ID
might appear consecutively or might appear on the mainframe usually within
two minutes from each other.  There is no consistency to when and how the
duplicate messages show up.

I have include the code for MQPUT from the server and the MQGET from the
mainframe to see if anyone can see any options that we are using or not
using that might be causing the problem.

The MQPUT command used by the NT Server is below.

BOOL    MQPut::Transmit(char* transmitMsg)
{
        char    msgbuffer[200];
        if (SubcontrollerHasShutdown())
        {
                return TRUE;
        }
        brepeat = FALSE;
        msg.useEmptyBuffer(workingMsg, sizeof(workingMsg));
        msg.setFormat(MQFMT_STRING);                            // character
string format
        memset(workingMsg, '\0', sizeof(workingMsg));
        strncpy(workingMsg, transmitMsg, 298);
        LNKLog.Post(workingMsg);

        if ((int)strlen(workingMsg) > 0)
        {
                msg.setMessageLength(strlen(workingMsg));
        }
        else
        {
                return TRUE;
        }

PutMsgOpts.setOptions( MQPMO_NEW_MSG_ID | MQPMO_NEW_CORREL_ID |
        MQPMO_NO_SYNCPOINT );
        PutMsgOpts.setSyncPointParticipation(FALSE);
        if (!queue.put(msg, PutMsgOpts))
        {
                                                        // log failure
reason
                memset(msgbuffer, '\0', sizeof(msgbuffer));
                sprintf(msgbuffer, "ImqQueue::put ended with reason code
%d\n",
                (int)queue.reasonCode());
                LNKLog.Post(msgbuffer);
                linkStatus = 0;
                return FALSE;
        }
        return TRUE;

Below is the mainframe code for getting the messages.

         MOVE MQGMO-FAIL-IF-QUIESCING TO MQGMO-OPTIONS.
         ADD  MQGMO-NO-SYNCPOINT TO MQGMO-OPTIONS
         ADD  MQGMO-WAIT TO MQGMO-OPTIONS.
         ADD  MQGMO-CONVERT TO MQGMO-OPTIONS.
         MOVE 30000 TO MQGMO-WAITINTERVAL.
*
*    Loop from here to END-PERFORM until the MQGET call fails
*
     PERFORM WITH TEST BEFORE
             UNTIL COMPCODE NOT = MQCC-OK
*
*       Clear MQMD-MSGID and MQMD-CORRELID before the next
*       MQGET call to ensure that all messages are retrieved
*
        MOVE MQMI-NONE TO MQMD-MSGID
        MOVE MQCI-NONE TO MQMD-CORRELID
*
        CALL 'MQGET' USING HCONN
                           HOBJ
                           MQMD
                           MQGMO
                           BUFFER-LENGTH
                           SECD-DSS-TRANS
                           DATA-LENGTH
                           COMPCODE
                           REASON



     END-PERFORM.

I don't know if anyone has experience the duplicate messages before or not
but we are at wits end and trying to figure out what is causing the
duplicate messages.  As far as I can tell, we are not experiencing any type
communication or program problems that might cause the sending of duplicate
messages.

Any help on this is deeply appreciated.

Thanks in advance.


Mike Sorrells
Chief Technical/Database Branch
DSIO-UCA
dsn 586-0233
801-586-0233

Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Reply via email to