camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Hudelmaier (JIRA)" <>
Subject [jira] [Created] (CAMEL-5670) Nullpointer Exception when disconnected from broker
Date Mon, 01 Oct 2012 08:45:07 GMT
Stefan Hudelmaier created CAMEL-5670:

             Summary: Nullpointer Exception when disconnected from broker
                 Key: CAMEL-5670
             Project: Camel
          Issue Type: Bug
          Components: camel-mqtt
    Affects Versions: 2.10.1, 2.9.3
            Reporter: Stefan Hudelmaier
            Priority: Minor


from time to time, we get the following exception when producing messages via camel-mqtt:

Caused by: java.lang.NullPointerException
	at org.fusesource.mqtt.client.CallbackConnection.publish(
	at org.fusesource.mqtt.client.CallbackConnection.publish(
	at org.apache.camel.component.mqtt.MQTTEndpoint.publish(
	at org.apache.camel.component.mqtt.MQTTProducer.doProcess(
	at org.apache.camel.component.mqtt.MQTTProducer.process(
	at org.apache.camel.util.AsyncProcessorHelper.process(

>From looking at the source of both camel-mqtt and the fusesource mqtt client, it looks
like that this is caused by the mqtt-client being disconnected and trying to invoke the onFailure
method on the callback:

public void publish(UTF8Buffer topic, Buffer payload, QoS qos, boolean retain, Callback<Void>
cb) {
        if( disconnected ) {
        PUBLISH command = new PUBLISH().qos(qos).retain(retain);
        send(command, cb);

camel-mqtt passes in null for the callback though. Wouldn't it be better if a more fitting
exception were thrown, or if camel passed in a Callback in order to receive the onFailure
event when disconnected from the broker?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message