Search code examples
spring-bootibm-mqjmstemplate

Using Spring boot JMS to send and receive messages over IBM MQ


Following instructions provided in https://developer.ibm.com/tutorials/mq-jms-application-development-with-spring-boot/, I developed a sample Spring boot web application in order to be able to send and receive messages over IBM MQ using JMS template.

In case of a MQ server not on local host, I updated the application.properties file with:

ibm.mq.conn-name=<my-server-host-name>(<my-server-port>)

Unfortunately this is not the appropriate property as the application is searching for a queue manager on localhost. I did not find in the documentation anything about the property to use for that. And yes, I gave a try to ibm.mq.host and ibm.mq.port.


Solution

  • For IBM config you need to provide the following properties:

    Yml extension:

      ibm:
        mq:
          queueManager: {queueManagerName}
          channel: {channelName}
          connName: localhost(1415)
          user: {UserName}
    

    property extension:

    ibm.mq.queueManager={queueManagerName}
    ibm.mq.channel={channelName}
    ibm.mq.connName=localhost(1415)
    ibm.mq.user={userName}
    

    connName you can find in the Listener directory: In my case IP address is equal: localhost Port is equal: 1415

    channelName you can find in Channels directory.