Mqje001: Completion Code '2', Reason '2495

I want to receive some messages from IBM MQ based on java. So I write a very simple code to test what I want. Here is the sample code below.

    Const.MQ_QMANAGER = "QM.CREDITWEB3T.PC";
    Const.MQ_QUEUE_RECEIVE = "MQ.AIRPORTS";

    MQSimpleConnectionManager myConnMan = new MQSimpleConnectionManager();
    myConnMan.setActive(MQSimpleConnectionManager.MODE_AUTO);

    MQQueueManager qMgr = new MQQueueManager(Const.MQ_QMANAGER,
                    myConnMan);

When I new the MQQueueManager. It’s throw an error message.

The error message is

MQJE001: Completion Code '2', Reason '2495'

May someone help me to figure out what’s wrong here? Thanks a lot.

1

2 Answers

(1) Your 1st posting is requesting that the connection to the queue manager be in "bindings mode". This means you MUST run the code on the same server where the queue manager is running.

(2) Your 2nd posting is requesting that the connection to the queue manager be in "client mode" (over the network ). This means you can run the code on a remote server and connect to the remote queue manager using the network.

After many times error and searched for the answer. Finally I found the solution. You needed to settle environmental parameter for MQ. I am sorry about that because I am so new about MQ. Here is the sample code below.

    // Host
    MQEnvironment.properties.put(MQConstants.HOST_NAME_PROPERTY,
            Const.MQ_HOST_NAME_PROPERTY);
    // Port
    MQEnvironment.properties.put(MQConstants.PORT_PROPERTY,
            Const.MQ_PORT_PROPERTY);
    // Channel
    MQEnvironment.properties.put(MQConstants.CHANNEL_PROPERTY,
            Const.MQ_CHANNEL_PROPERTY);
    MQEnvironment.properties.put(MQConstants.CCSID_PROPERTY, XXX);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest