Skip to main content

Troubleshooting IBM WebSphere MQ Adapters

If you encounter problems when using the adapters for IBM WebSphere MQ, you should first determine whether the client is correctly installed and can communicate with the server. To perform such a test, you can use sample programs that are provided by IBM WebSphere MQ. The executables are in the bin directory of the IBM WebSphere MQ client.

The following steps describe how to use these sample programs on Windows. The details may be different on other operating systems; consult the IBM documentation and check the names of the files present in your client.

  1. Create an environment variable called MQSERVER. Its value should be of the form channel_name/transport/server, where channel_name is the name of the channel to use, transport is a string that indicates the transport to use, and server is the name of the server. For example: S_testsystem/TCP/testsystem

  2. At the command line, enter the following command:

    amqsputc queue_name queue_manager_name
    

    where queue_name is the name of the queue to use and queue_manager_name is the name of the queue manager. For example:

    amqsputc testqueue QM_testsystem
    

    If the amqsputc command is unrecognized, make sure that the PATH environment variable has been updated to include the bin directory of the IBM WebSphere MQ client.

    In case of other errors, consult the IBM documentation.

  3. You should see a couple of lines like the following:

    Sample AMQSPUT0 start
    target queue is testqueue
    
  4. Now you can send messages. Simply type each message and press Enter after each message. For example:

    sample message 1
    sample message 2
    
  5. When you are done sending messages, press Enter twice. You will then see a line like the following:

    Sample AMQSPUT0 end
    
  6. To complete this test, we will retrieve the messages you sent to the queue. Type the following command at the command line:

    amqsgetc queue_name queue_manager_name
    

    where queue_name is the name of the queue to use and queue_manager_name is the name of the queue manager. For example:

  7. You should then see a start line, followed by the messages that you sent previously, as follows:

    Sample AMQSGET0 start
    message <sample message 1>
    message <sample message 2>
    
  8. This sample program waits briefly to receive any other messages and then displays the following:

    no more messages
    Sample AMQSGET0 end
    
    

If the test fails, consult the IBM documentation. Possible causes of problems include the following:

  • Security issues

  • Queue is not defined correctly

  • Queue manager is not started

FeedbackOpens in a new tab