8

I have Spring Boot application which listen IBM MQ Queue via @JmsListener annotation as below from component class. The MQ properties (hostname, channel, port, etc) are set from yaml file.

 @JmsListener(destination = "<QueueName>")
 public void receiveMessage(BytesMessage msg) { 
     //snippet to read msg
 }

The MQ dependencies are added in gradle build as below,

compile("com.ibm.mq:mq-jms-spring-boot-starter:0.0.2") {  
        exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
    }

This works fine and listening the message as long as I run the application on local with Tomcat container. But if I package this as EAR and deploy to Wesbphere8.5 server, it throws below exception and listener is not reading the message from queue. I confirmed that all the run-time dependencies are packaged in EAR. Tried with different versions of MQ dependencies but no luck.

2018-07-10 15:21:16,531 ERROR DefaultMessageListenerContainer - Could not refresh JMS Connection for destination 'QueueName' - retrying using FixedBackOff{interval=5000, currentAttempts=34, maxAttempts=unlimited}. Cause: JMSFMQ6312: An exception occurred in the Java(tm) MQI.; nested exception is com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]

Need help to fix this issue.

Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
vgp
  • 81
  • 1
  • 2

1 Answers1

1

I faced a similar issue like this. This happens because of missing configurations on IBM MQ Connection with your JMS Application. In My case, I got an authorization related exception but I set the correct user credentials for the IBM mq. when I checked the IBM mq site, the userName is different and that is not which I configured in my spring application.

#IBM MQ JMS Configuration
ibm.mq.queueManager={QUEUE_MANAGER}
ibm.mq.channel={CHANNEL_NAME}
ibm.mq.connName={HOST_NAME(HOST_PORT)}
ibm.mq.user={USER_NAME}
ibm.mq.password={PASSWORD}

Then I added the below property to Use compatibility mode when authenticating with a queue manager. Here we override the authentication mode. This should not normally be needed with current maintenance levels of MQ V8 or V9, but some earlier levels sometimes got get it wrong and then this flag can be set to "false"

ibm.mq.user-authentication-m-q-c-s-p=false

Please Refer this page for more details

Sivaram Rasathurai
  • 5,533
  • 3
  • 22
  • 45