Support Article

MDB listener causes exception

SA-30585

Summary



Sometimes when an upstream application sends the wrong format (not text message format) to MQ, then Pega throws the below exception to the log and to MQ. Due to this exception, the queue depth is increasing.


Error Messages



Message written to MQ:
Caught com.pega.pegarules.pub.PRException while processing request for service <service name>, message='Expecting a TextMessage, received a message of type: com.ibm.jms.JMSMessage',

Error in Log:
2016-10-06 12:40:36,638 [stenerThreadPool : 1] ( services.jms.JMSListener) ERROR - Caught exception in JMS service listener <listener name>

com.pega.pegarules.pub.PRException: Expecting a TextMessage, received a message of type: com.ibm.jms.JMSMessage
From: (unknown)
at com.pega.pegarules.integration.engine.internal.services.jms.JMSListener.readRequestData(JMSListener.java:1807)
at com.pega.pegarules.integration.engine.internal.services.jms.JMSListener.handleRequest(JMSListener.java:1237)
at com.pega.pegarules.integration.engine.internal.services.jms.JMSListener.runOnce(JMSListener.java:691)
at com.pega.pegarules.integration.engine.internal.services.jms.JMSListenerServant.invoke(JMSListenerServant.java:110)
at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl._invokeEngine_privact(EngineImpl.java:312)
at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:263)
at com.pega.pegarules.session.internal.engineinterface.etier.ejb.EngineBean.invokeEngine(EngineBean.java:221)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)


Steps to Reproduce



Not Applicable


Root Cause



Likely a 3rd party upstream application issue.

Resolution



Here’s the explanation for the reported behavior:

Pega JMS MDB can only accept JMS message types, that is why a message of the type 'com.ibm.jms.JMSMessage' will cause the exception. Since the 'Send Error Message' is configured for the MDB listener, these exception will be sent back to MQ per the JMSReplyTo header field of the incoming message. Since the message is not even JMS compliant, it is unlikely the JMSReplyTo header is specified. The Pega logic works as expected. Suggest configure MQ retry logic on the MQ server side to discard the 'invalid' message after certain times of retry.

Published November 18, 2016 - Updated December 9, 2016

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.