Troubleshooting messaging client problems

This topic contains additional for diagnosing problems when using messaging functions from within IBM® WebSphere® sMash applications.

Unable to identify protocol

When developing an application to use the messaging protocol with the Connection API you might experience an exception similar to the following:

	SEVERE [ CWPZC1124E: Unable to identify protocol for request. Request target: queue1 ]
zero.core.connection.ConnectionException: Unable to identify protocol for request. Request target:queue1
	at zero.core.connection.engine.TransportFactory.getTransport(...

This exception indicates that the messaging protocol has not been associated with the connection request to the destination, queue1. To resolve this problem, either use the setProtocolConfiguration() method of the Connection API or add a connection destination configuration to the zero.config file. For example:

/config/connection/destinations += {
   "queue1" : {
        "connection" : {
            "protocol" : "messaging",
            "config" : { 
                "connectionConfig" : "broker1"
                // other protocol configuration can be placed here
            }
        }
    }
}

Messaging exceptions received by the client application

If a messaging exception is thrown when client application is using the messaging protocol, the Connection API throws a ConnectionException to the application with a javax.jms.JMSException as its cause. The JMSException can be accessed by calling the getCause() method of the ConnectionException.

The text of the JMSException can be useful in diagnosing the problem but in some cases the linked exception contained within the javax.jms.JMSException is also required. The linked exception can be accessed by calling the getLinkedException() method of the JMSException.

Some common situations which can be diagnosed from the JMSException and any linked exception are described in the following sections.

Exceeding the maximum message size

If an application attempts to send a message which is larger than the maximum message size configured for the messaging broker, a MqttNegativeAckException is thrown with a reason code of 4.

Example exception:

javax.jms.JMSException: An exception thrown while sending the message by MqttProducer for clientId 
        E1211212817546-1-18916478 connected to MicroBroker tls://localhost:9091. 
    at com.ibm.msg.client.mqtt.internal.ProviderMessageProducerMqttImpl.send(...
    at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(...
    ...

Example linked exception:

com.ibm.mqttclient.v4.base.MqttNegativeAckException:  (Reason code=4)
    ....

Exceeding the maximum queue depth

The nature of the exception that is thrown when an application attempts to send a message to a queue which has already reached its maximum depth depends on whether the session is transacted or not. However, in each case the linked exception is a MqttNegativeAckException with a reason code of 400.

Example exception for a transacted session:

javax.jms.JMSException: Commit failed on session.
    at com.ibm.msg.client.mqtt.internal.ProviderSessionMqttImpl.commit(...
    at com.ibm.msg.client.jms.internal.JmsSessionImpl.commitTransaction(...
    ...

Example exception for a non-transacted session:

javax.jms.JMSException: An exception thrown while sending the message by MqttProducer for clientId 
        E1211209604787-1-18916478 connected to MicroBroker tls://localhost:9091. 
    at com.ibm.msg.client.mqtt.internal.ProviderMessageProducerMqttImpl.send(...
    at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(...
	...

Example linked exception:

com.ibm.mqttclient.v4.base.MqttNegativeAckException:  (Reason code=400)
    ...

Messaging request timeouts

If a client application does not receive a response to a messaging request within a specified amount of time, a MqttNegativeAckException is thrown with a reason code of 5.

Timeouts can occur under situations of heavy load or when working with very large messages. The timeout for an individual connection to the broker can be set using the deliveryTimeout broker connection property.

Using the messaging client and IBM WebSphere MQ Version 7.0

The zero.messaging.connection, zero.messaging.kicker and zero.messaging.receiver modules contain classes that are incompatible with the IBM WebSphere MQ classes for JMS, which are supplied with WebSphere MQ Version 7.0. To avoid compatiblity problems, a WebSphere sMash application that connects to both a messaging broker and a WebSphere MQ Version 7.0 queue manager must use the WebSphere MQ classes for JMS from the MQC6: WebSphere MQ V6.0 Clients SupportPac™.

Version 1.1.26825