My C with MQ receive a message return code 2037

后端 未结 1 631
半阙折子戏
半阙折子戏 2021-01-29 15:49

I run the C program, which connect to MQ and try to get a message from it. I always get a message:
MQGET ended with reason code 2037
which means that MQ is not

相关标签:
1条回答
  • 2021-01-29 16:25

    MQRC 2037 is MQRC_NOT_OPEN_FOR_INPUT, you can find this information by running the mqrc command provided with the IBM MQ Client or server install, below is a sample output on a Linux server:

    $ mqrc 2037
    
          2037  0x000007f5  MQRC_NOT_OPEN_FOR_INPUT
    

    You do not show the MQOPEN call but if it is using the O_options, it would be explained by this, you currently have the following:

    O_options = MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING; 
    

    This should someing like the following:

    O_options = MQOO_INPUT_AS_Q_DEF + MQOO_FAIL_IF_QUIESCING; 
    

    I would suggested that you review the sample applications provided with the IBM MQ install. On Linux these would be located in /opt/mqm/samp. The sample amqsget0.c would be similar to your program except it is using a MQCONN not MQCONNX.

    0 讨论(0)
提交回复
热议问题