help, encounter mq error 2103(MQRC_ANOTHER_Q_MGR_CONNECTED) - Websphere

This is a discussion on help, encounter mq error 2103(MQRC_ANOTHER_Q_MGR_CONNECTED) - Websphere ; when I try to connect to two Queue manager in one process, but when connect to second queue manager, I get error 2103(MQRC_ANOTHER_Q_MGR_CONNECTED). my question is: 1. Does application can connect to two queue manager simultaneous 2. if yes, can ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: help, encounter mq error 2103(MQRC_ANOTHER_Q_MGR_CONNECTED)

  1. help, encounter mq error 2103(MQRC_ANOTHER_Q_MGR_CONNECTED)

    when I try to connect to two Queue manager in one process, but when connect to second queue manager, I get error 2103(MQRC_ANOTHER_Q_MGR_CONNECTED).
    my question is:
    1. Does application can connect to two queue manager simultaneous
    2. if yes, can someone give me sample code, thanks.

    here is my code
    int main()
    {
    ImqQueueManager qmgr1;
    ImqQueueManager qmgr2;
    ImqQueue queue1;
    ImqQueue queue2;

    qmgr1.setName("AcctQM");
    if (! qmgr1.connect() )
    {
    printf("connect to Qmgr AcctQM error with reason code:%ld\n",qmgr1.reasonCode());
    exit(1);
    }
    qmgr2.setName("ITQM");
    if (! qmgr2.connect() )
    {
    printf("connect to Qmgr ITQM error with reason code:%ld\n",qmgr2.reasonCode());
    exit(1);
    }
    }

  2. Re: help, encounter mq error 2103(MQRC_ANOTHER_Q_MGR_CONNECTED)

    zengjia@cn.ibm.com wrote:
    > when I try to connect to two Queue manager in one process, but when connect to second queue manager, I get error 2103(MQRC_ANOTHER_Q_MGR_CONNECTED).
    > my question is:
    > 1. Does application can connect to two queue manager simultaneous


    You need to read the chapter "Connecting to and disconnecting from a queue
    manager" in the WebSphere MQ Application Programming Guide. As with the other
    MQ manuals, it is available here:

    http://www-306.ibm.com/software/inte...n/wmq/library/

    The answer to your question is usually yes, but you must connect to each queue
    manager from a separate thread.

    Hope this helps,

    Phil
    --
    WebSphere MQ Distributed Development/Performance

+ Reply to Thread