You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Stefan Hudelmaier (JIRA)" <ji...@apache.org> on 2012/10/01 10:45:07 UTC
[jira] [Created] (CAMEL-5670) Nullpointer Exception when
disconnected from broker
Stefan Hudelmaier created CAMEL-5670:
----------------------------------------
Summary: Nullpointer Exception when disconnected from broker
Key: CAMEL-5670
URL: https://issues.apache.org/jira/browse/CAMEL-5670
Project: Camel
Issue Type: Bug
Components: camel-mqtt
Affects Versions: 2.10.1, 2.9.3
Reporter: Stefan Hudelmaier
Priority: Minor
Hi,
from time to time, we get the following exception when producing messages via camel-mqtt:
bq.
Caused by: java.lang.NullPointerException
at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:551)
at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:545)
at org.apache.camel.component.mqtt.MQTTEndpoint.publish(MQTTEndpoint.java:166)
at org.apache.camel.component.mqtt.MQTTProducer.doProcess(MQTTProducer.java:66)
at org.apache.camel.component.mqtt.MQTTProducer.process(MQTTProducer.java:38)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[...]
>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:
{code:title=CallbackConnection.java}
public void publish(UTF8Buffer topic, Buffer payload, QoS qos, boolean retain, Callback<Void> cb) {
queue.assertExecuting();
if( disconnected ) {
cb.onFailure(createDisconnectedError());
return;
}
PUBLISH command = new PUBLISH().qos(qos).retain(retain);
command.topicName(topic).payload(payload);
send(command, cb);
}
{code}
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: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-5670) camel-mqtt - Nullpointer Exception
when disconnected from broker
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-5670:
----------------------------------
Assignee: Claus Ibsen
> camel-mqtt - Nullpointer Exception when disconnected from broker
> ----------------------------------------------------------------
>
> Key: CAMEL-5670
> URL: https://issues.apache.org/jira/browse/CAMEL-5670
> Project: Camel
> Issue Type: Bug
> Components: camel-mqtt
> Affects Versions: 2.9.3, 2.10.1
> Reporter: Stefan Hudelmaier
> Assignee: Claus Ibsen
> Priority: Minor
>
> Hi,
> from time to time, we get the following exception when producing messages via camel-mqtt:
> bq.
> {code}
> Caused by: java.lang.NullPointerException
> at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:551)
> at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:545)
> at org.apache.camel.component.mqtt.MQTTEndpoint.publish(MQTTEndpoint.java:166)
> at org.apache.camel.component.mqtt.MQTTProducer.doProcess(MQTTProducer.java:66)
> at org.apache.camel.component.mqtt.MQTTProducer.process(MQTTProducer.java:38)
> at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> [...]
> {code}
> 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:
> {code:title=CallbackConnection.java}
> public void publish(UTF8Buffer topic, Buffer payload, QoS qos, boolean retain, Callback<Void> cb) {
> queue.assertExecuting();
> if( disconnected ) {
> cb.onFailure(createDisconnectedError());
> return;
> }
> PUBLISH command = new PUBLISH().qos(qos).retain(retain);
> command.topicName(topic).payload(payload);
> send(command, cb);
> }
> {code}
> 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: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5670) camel-mqtt - Nullpointer Exception
when disconnected from broker
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-5670:
-------------------------------
Description:
Hi,
from time to time, we get the following exception when producing messages via camel-mqtt:
bq.
{code}
Caused by: java.lang.NullPointerException
at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:551)
at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:545)
at org.apache.camel.component.mqtt.MQTTEndpoint.publish(MQTTEndpoint.java:166)
at org.apache.camel.component.mqtt.MQTTProducer.doProcess(MQTTProducer.java:66)
at org.apache.camel.component.mqtt.MQTTProducer.process(MQTTProducer.java:38)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[...]
{code}
>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:
{code:title=CallbackConnection.java}
public void publish(UTF8Buffer topic, Buffer payload, QoS qos, boolean retain, Callback<Void> cb) {
queue.assertExecuting();
if( disconnected ) {
cb.onFailure(createDisconnectedError());
return;
}
PUBLISH command = new PUBLISH().qos(qos).retain(retain);
command.topicName(topic).payload(payload);
send(command, cb);
}
{code}
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?
was:
Hi,
from time to time, we get the following exception when producing messages via camel-mqtt:
bq.
Caused by: java.lang.NullPointerException
at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:551)
at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:545)
at org.apache.camel.component.mqtt.MQTTEndpoint.publish(MQTTEndpoint.java:166)
at org.apache.camel.component.mqtt.MQTTProducer.doProcess(MQTTProducer.java:66)
at org.apache.camel.component.mqtt.MQTTProducer.process(MQTTProducer.java:38)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[...]
>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:
{code:title=CallbackConnection.java}
public void publish(UTF8Buffer topic, Buffer payload, QoS qos, boolean retain, Callback<Void> cb) {
queue.assertExecuting();
if( disconnected ) {
cb.onFailure(createDisconnectedError());
return;
}
PUBLISH command = new PUBLISH().qos(qos).retain(retain);
command.topicName(topic).payload(payload);
send(command, cb);
}
{code}
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?
Summary: camel-mqtt - Nullpointer Exception when disconnected from broker (was: Nullpointer Exception when disconnected from broker)
> camel-mqtt - Nullpointer Exception when disconnected from broker
> ----------------------------------------------------------------
>
> Key: CAMEL-5670
> URL: https://issues.apache.org/jira/browse/CAMEL-5670
> Project: Camel
> Issue Type: Bug
> Components: camel-mqtt
> Affects Versions: 2.9.3, 2.10.1
> Reporter: Stefan Hudelmaier
> Priority: Minor
>
> Hi,
> from time to time, we get the following exception when producing messages via camel-mqtt:
> bq.
> {code}
> Caused by: java.lang.NullPointerException
> at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:551)
> at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:545)
> at org.apache.camel.component.mqtt.MQTTEndpoint.publish(MQTTEndpoint.java:166)
> at org.apache.camel.component.mqtt.MQTTProducer.doProcess(MQTTProducer.java:66)
> at org.apache.camel.component.mqtt.MQTTProducer.process(MQTTProducer.java:38)
> at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> [...]
> {code}
> 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:
> {code:title=CallbackConnection.java}
> public void publish(UTF8Buffer topic, Buffer payload, QoS qos, boolean retain, Callback<Void> cb) {
> queue.assertExecuting();
> if( disconnected ) {
> cb.onFailure(createDisconnectedError());
> return;
> }
> PUBLISH command = new PUBLISH().qos(qos).retain(retain);
> command.topicName(topic).payload(payload);
> send(command, cb);
> }
> {code}
> 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: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5670) camel-mqtt - Nullpointer Exception
when disconnected from broker
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-5670:
-------------------------------
Affects Version/s: (was: 2.9.3)
Fix Version/s: 2.10.2
2.11.0
> camel-mqtt - Nullpointer Exception when disconnected from broker
> ----------------------------------------------------------------
>
> Key: CAMEL-5670
> URL: https://issues.apache.org/jira/browse/CAMEL-5670
> Project: Camel
> Issue Type: Bug
> Components: camel-mqtt
> Affects Versions: 2.10.1
> Reporter: Stefan Hudelmaier
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.11.0, 2.10.2
>
>
> Hi,
> from time to time, we get the following exception when producing messages via camel-mqtt:
> bq.
> {code}
> Caused by: java.lang.NullPointerException
> at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:551)
> at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:545)
> at org.apache.camel.component.mqtt.MQTTEndpoint.publish(MQTTEndpoint.java:166)
> at org.apache.camel.component.mqtt.MQTTProducer.doProcess(MQTTProducer.java:66)
> at org.apache.camel.component.mqtt.MQTTProducer.process(MQTTProducer.java:38)
> at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> [...]
> {code}
> 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:
> {code:title=CallbackConnection.java}
> public void publish(UTF8Buffer topic, Buffer payload, QoS qos, boolean retain, Callback<Void> cb) {
> queue.assertExecuting();
> if( disconnected ) {
> cb.onFailure(createDisconnectedError());
> return;
> }
> PUBLISH command = new PUBLISH().qos(qos).retain(retain);
> command.topicName(topic).payload(payload);
> send(command, cb);
> }
> {code}
> 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: http://www.atlassian.com/software/jira
[jira] [Resolved] (CAMEL-5670) camel-mqtt - Nullpointer Exception
when disconnected from broker
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-5670.
--------------------------------
Resolution: Fixed
Thanks for reporting. A callback is now provided. I also polished the code and added a bit bitter logging etc.
And also made the mqtt producer leverage the async routing engine.
> camel-mqtt - Nullpointer Exception when disconnected from broker
> ----------------------------------------------------------------
>
> Key: CAMEL-5670
> URL: https://issues.apache.org/jira/browse/CAMEL-5670
> Project: Camel
> Issue Type: Bug
> Components: camel-mqtt
> Affects Versions: 2.10.1
> Reporter: Stefan Hudelmaier
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.11.0, 2.10.2
>
>
> Hi,
> from time to time, we get the following exception when producing messages via camel-mqtt:
> bq.
> {code}
> Caused by: java.lang.NullPointerException
> at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:551)
> at org.fusesource.mqtt.client.CallbackConnection.publish(CallbackConnection.java:545)
> at org.apache.camel.component.mqtt.MQTTEndpoint.publish(MQTTEndpoint.java:166)
> at org.apache.camel.component.mqtt.MQTTProducer.doProcess(MQTTProducer.java:66)
> at org.apache.camel.component.mqtt.MQTTProducer.process(MQTTProducer.java:38)
> at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> [...]
> {code}
> 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:
> {code:title=CallbackConnection.java}
> public void publish(UTF8Buffer topic, Buffer payload, QoS qos, boolean retain, Callback<Void> cb) {
> queue.assertExecuting();
> if( disconnected ) {
> cb.onFailure(createDisconnectedError());
> return;
> }
> PUBLISH command = new PUBLISH().qos(qos).retain(retain);
> command.topicName(topic).payload(payload);
> send(command, cb);
> }
> {code}
> 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: http://www.atlassian.com/software/jira