Connecting IBM MQ queue using F5 virtual ip and C++

前端 未结 1 1606
慢半拍i
慢半拍i 2021-01-21 16:56

I am trying to connect to some IBM MQ queues using C++. These queues have been defined under different manager queues in different servers. The idea is to connect to a VIP that

1条回答
  •  梦毁少年i
    2021-01-21 17:38

    Based on the code you provide you can use NULL, or blanks, or even a * instead of a queue manager name.

    For example:

    MQCONN("", &connectionHandle, &completionCode, &reasonCode);
    
    MQCONN(" ", &connectionHandle, &completionCode, &reasonCode);
    
    MQCONN("*", &connectionHandle, &completionCode, &reasonCode);
    

    Any of the above will connect to the queue manager listening on the host and port you specify in the MQSERVER environment variable.


    MQCONN is documented in the IBM MQ Knowledge Center page MQCONN - Connect queue manager. Quoting a few things related to the queue manager name from this page:

    If the name consists entirely of blanks, the name of the default queue manager is used.

    In the case of MQSERVER the default queue manager is the one listening on host and port connected to.

    The page also has the following in the context of a CCDT but it works the same for MQSERVER:

    If an all-blank name is specified, each client-connection channel with an all-blank queue-manager name is tried until one is successful; in this case there is no check against the actual name of the queue manager.

    Prefixing an asterisk to the connection name implies that the application does not depend on connecting to a particular queue manager in the group. Suitable applications are:

    • Applications that put messages but do not get messages.
    • Applications that put request messages and then get the reply messages from a temporary dynamic queue.

    Unsuitable applications are ones that need to get messages from a particular queue at a particular queue manager; such applications must not prefix the name with an asterisk.


    I would suggest that you instead use CCDT (Client Channel Definition Table) as it provides much more flexibility. MQSERVER can only provide the host, port, and channel name. A CCDT will allow you to configure many more options, for example TLS, security exits, max message length to name a few.

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