MQPUT错误中止

时间:2017-06-29 18:47:02

标签: c ibm-mq

再次出现MQPUT问题

以下是我的功能

#include <stdio.h>    
#include <stdlib.h>    
#include <string.h>     
#include <cmqc.h>            /* includes for MQI          */    
#include <cmqxc.h>    


int main(int argc, char **argv)    
{    
    MQLONG   messlen;     /* message length received       */    

    char     QMgrName[MQ_Q_MGR_NAME_LENGTH+1];    
    char     QName[MQ_Q_NAME_LENGTH+1];    
    char     channelName[MQ_CHANNEL_NAME_LENGTH+1];    
    char     hostname[1024];    
    char     port[4];    
    MQLONG   buflen;    
    /* MQBYTE   TmpBuf[65536] = "This is a simple test message."; */    
    MQBYTE   TmpBuf[1024] = "This is a simple test message.";    
    int msgsToGet;    
    int msgsGot;    
    int dteretinit;    
    int dteretdeinit;    
    int dteretopen;    
    int dteretclose;    
    int qd;    
    int dteretput;    
    dteretinit = dteMqInit(QMgrName,hostname,channelName);    
    printf("Return code from dteMqInit = %d\n",dteretinit);    
    if (dteretinit == 0)    
    {    
        printf("Connection ro MQ failed, check the error log\n");    
        exit(99);    
    }    
    qd = -1;    
    dteretopen = dteMqOpen(QName, &qd);    
    printf ("Return code from dteMqOpen = %d\n",dteretopen);    
    if (dteretopen ==0)    
    {    
        printf("MQOPEN could not open MQ, check errpr log\n");    
        exit(99);    
    }    

    buflen = strlen(TmpBuf);    
    TmpBuf[buflen + 1] = '\0';
    dteretput = dteMqSend(qd,*TmpBuf,buflen);    
    printf("return mqput %d\n",dteretput);    
    if (dteretput == 0)    
    {    
        printf("Could not put the message to MQ, check error log\n");    
        exit(99);    
    }    

    dteretclose = dteMqClose(qd);    
    printf("Return code from dteMqClose = %d\n",dteretclose);    
    if (dteretclose == 0)    
    {    
        printf("Could not close MQ, check error log\n");    
        exit(99);    
    }    
    dteretdeinit = dteMqDeinit();    
    printf("Return code from dteMqDeinit = %d\n",dteretdeinit);    
    if (dteretdeinit == 0)    
    {    
        printf("Could not disconnect from MQ, check error log\n");    
        exit(99);    
    }    
}    

下面是一个带有函数调用的程序:

Using values:    
QMgrName   : QM.SU00005    
QName      : AP.TR.FROM.ADS    
ChannelName: AVNCHCTM.CLIENT    
hostname   : enbmqu02.uk.db.com    
port       : 1415    
CC = 0, RS = 0    
Return code from dteMqInit = 1    
SAM    
SAM2    
SAM3    
MQopen = 0 and 0    
In the loop1    
QDESC1 = -990964260    
QDESC = -990964260    
Return code from dteMqOpen = 1    
oleg    
oleg1    
oleg2    
oleg3    
oleg4    
QD is = 0    
oleg5    
Aborted   

程序开始运行,连接到MQ,打开MQ,然后去发送消息,打印所有包括“oleg5”,并中止

这是输出:

if(sQueues[qd].IsSyncpointControled)    
{    
    pmo.Options |= MQPMO_SYNCPOINT;    
    printf("Synchronized\n");    
}    

你可以看到qd = 0并且在if语句中的MQPUT之前的这个地方它没有来。可能是我必须发表其他声明并分配选项?

var inputID = document.querySelector("#div-1 input").id;

这恰好发生在MQPUT呼叫上 请你帮助我好吗?

0 个答案:

没有答案