We are using IBM MQ allclient Library (9.1.0.x) with spring boot of version 2.4.x for connecting the IBM MQ. We are creating the MQConfig with these below values hostname, port, channel, user, queueManager, accessQueue.
And also we are using JMSOperations bean which is created with the CachingConnectionFactory of sessionCacheSize(500).
The issue what we are seeing is when the messages are published to the QUEUE the below error is occurring.
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9208: Error on receive from host 'somehost'. [1=-1,2=ffffffff,3='somehost',4=TCP]
Could you please suggest how can we resolve this issue.
Related
I'm using the following endpoint :
jms:queue:MY_JMS_QUEUE?transacted=true&recoveryInterval=10000&testConnectionOnStartup=true
Everything works well but whenever the MQ connection is lost (due to IBM MQ server restart), the connection refresh does not work.
In my logs i have that :
ERROR [c.c.j.DefaultJmsMessageListenerContainer] []] Could not refresh JMS Connection for destination 'MY_JMS_QUEUE' - retrying using FixedBackOff{interval=10000, currentAttempts=0, maxAttempts=unlimited}. Cause: JMSWMQ0018: Failed to connect to queue manager 'xxx' with connection mode 'Client' ......('MQRC_Q_MGR_NOT_AVAILABLE')
And nothing else, i was expecting to have the same error messages multiples times with currentAttempts=1 then 2... until the MQ is back.
I checked the documentation but i don't see anything else. My configuration:
Camel version : 3.11.3
Java: 11.0.8
Spring boot : 2.5.2
As your connection mode is "Client" you can give the MQ automatic JMS client reconnection feature a try. You would need to configure the "ClientReconnectOptions" in the connection factory definition.
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.
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
I am trying to consume messages from WebSphere SIB (default message provider). I did not find many articles related to this topic on the internet. I have tried configuration as described here but i get the below exception:
com.ibm.websphere.ms.Wnsinitalcontextfacotry is not of type javax.jms.ConnectionFactory
Has anybody integrated JMS with WebShphere Default message provider? If yes, can you please provide sample code?
I would like to know how to configure connection factory and topic.
CURRENT Status is Below:
I was able to configure JMS connection factory and topic but hit below exception
The security exception CAUGHT_EXCEPTION_WHILE_CONFIGURING_SSL_CLIENT_SOCKET: JSSL0130E: java.io.IOException: signals that an I/O exception of some sort has occurred.
Check this post. It provides steps and piece of plain Java code, how to access WebSphere Default messaging. You should be able to configure your Spring app based on that.
I have the below requirement to be met:
Say I have configured a JMS server, a JMS queue and a connection factory in WebLogic. Now, the message sender lies in the same WebLogic instance and able to send messages to the queue successfully. The listener part also works fine if they are in the same WebLogic instance.
Now, my requirement is, the message listener will be part of an entirely different web application deployed on WebSphere Application Server. So basically I am trying to listen to a WebLogic queue from a WebLogic server. I have tried to google the solution and found concepts like "Foreign JMS Server" and "Message Bridges" in WebLogic. What I have understood from those is that, it forwards the incoming message(in my case WebLogic queue) to a remote destination (WebSphere in my case). Then in the remote destination, I can deploy a listener configured as if it is listening to a local JMS queue. Is this understanding correct? In either case, what other options do I have? I don't have any requirement that the message needs to be directly available to my WebSphere queue as long as I am able to read the messages even from a remote message queue. so, if technically possible, the message forwarding is a bit overkill for my need. Any guidance or suggestion on this would be really helpful.
UPDATES:
I have tried the exact steps mentioned in both of those articles:
http://middlewaretimes.blogspot.in/2014/06/how-to-configure-weblogic-server-with.html
http://ibswings.blogspot.in/2008/02/integrating-mq-broker-6-with-bea.html
Since I want to use spring JMS, I have written the sender and receiver myself following this tutorial. However, now I am stuck at the following exception:
org.springframework.jms.InvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'jms/WLReceiverQueue'.; nested exception is com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'jms/WLReceiverQueue'.
JMS attempted to perform an MQOPEN, but WebSphere MQ reported an error.
Use the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:285)
at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:496)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:579)
at InvoiceQueueSender.sendMesage(InvoiceQueueSender.java:23)
at InvoiceSenderServlet.service(InvoiceSenderServlet.java:17)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3432)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
Caused by: com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'jms/WLReceiverQueue'.
JMS attempted to perform an MQOPEN, but WebSphere MQ reported an error.
Use the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:503)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1061)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1019)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer.access$800(WMQMessageProducer.java:68)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.initialise(WMQMessageProducer.java:765)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer.(WMQMessageProducer.java:995)
at com.ibm.msg.client.wmq.internal.WMQSession.createProducer(WMQSession.java:886)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.createProducer(JmsSessionImpl.java:1232)
at com.ibm.msg.client.jms.internal.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:136)
at com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:153)
at com.ibm.mq.jms.MQQueueSession.createProducer(MQQueueSession.java:254)
at org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:1142)
at org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:1123)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:600)
at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:583)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:493)
... 21 more
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)
We are working on Integrating websphere MQ with boomi,
The Configuration in Boomi for JMS connector is as follows:
For JMS Connection :
Authentication Present:
User : adminstrator
password : xxxxx
JMS Server : Websphere MQ
Connection type : Single QM connection
Queue Manager : BoomiQMGR
Channel Name : BoomiSC
For JMS operation:
Destination : queue:BoomiQ(where BoomiQ is the Queue Name, "queue:" as mentioned in the boomi Documentation)
But the Problem is,
with these configuration we encounter the below error in boomi:
*"Test execution of TestProcess completed with errors. Embedded message: Unable to retrieve JMS message; Caused by: JMSCC0005: The specified value 'queue:BoomiQ' is not allowed for 'XMSC_DESTINATION_NAME'."
From what we can tell in reading around this occurs due to WebSphere MQ destination naming restrictions, we are using WEBSPHERE version : WS_MQ_V8.0_TRIAL_FOR_WINDOWS_ML(downloaded from IBM Site)
Can someone help us out on this?
Please suggest if we are missing anything.
Thanks in Advance.
The problem looks to be the format of the Queue Name: queue:BoomiQ isn't valid for the WMQ JMS client.
If the Queue on the QueueManager was say MyQueue, then either ensure that MyQueue is passed to JMS or queue:///MyQueue.