org.eclipse.paho.client.mqttv3.MqttException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Details: Mqtt broker: apache apollo 1.7 Mqtt eclipse paho client There is some logic on our server that constructs outbound (response) topic name based on incoming message topic name. The logic is pretty straightforward. Client sends message to the topic name {{path/<device-id>/<sub-device-id>/outbound}} and gets server echo message on {{path/<device-id>/<sub-device-id>/inbound}} topic. We didn't implement any topic validation logic on server side yet and this causes the next issue: When some device (not in our control) sends message to the topic name {{path/\+/\+/outbound}} (which is wrong topic name format) server constructs the next topic name for the response message: {{path/\+/\+/inbound}}. The topic name to send message is obviously invalid and after _multiple attempts_ to send message to this topic name system hangs at {{MqttPahoMessageDrivenChannelAdapter}} with the message "Attempting reconnect". The log contains the following exceptions + {{MqttPahoMessageDrivenChannelAdapter}} becomes running in the loop trying to re-connect to mqtt broker: {noformat} org.springframework.messaging.MessageHandlingException: error occurred in message handler [mqttOutboundHandler]; nested exception is java.lang.IllegalArgumentException: The topic name MUST NOT contain any wildcard characters (#+) at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:139) at org.springframework.integration.config.annotation.ServiceActivatorAnnotationPostProcessor$ReplyProducingMessageHandlerWrapper.handleRequestMessage(ServiceActivatorAnnotationPostProcessor.java:99) at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:99) at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ................ org.eclipse.paho.client.mqttv3.MqttException: Client is connected at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.connect(MqttAsyncClient.java:465) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.connect(MqttAsyncClient.java:455) at org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter.connectAndSubscribe(MqttPahoMessageDrivenChannelAdapter.java:194) at org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter.access$300(MqttPahoMessageDrivenChannelAdapter.java:41) at org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter$1.run(MqttPahoMessageDrivenChannelAdapter.java:237) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 2015-12-21 16:02:28.362 DEBUG 65151 --- [task-scheduler-1] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:28.364 DEBUG 65151 --- [task-scheduler-4] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:33.697 DEBUG 65151 --- [task-scheduler-8] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:37.898 DEBUG 65151 --- [task-scheduler-6] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:37.900 DEBUG 65151 --- [task-scheduler-9] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:37.921 DEBUG 65151 --- [task-scheduler-2] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:38.024 DEBUG 65151 --- [task-scheduler-7] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect ............... {noformat} indefinitely trying to reconnect. We can definitely fix this issue on our server side to validate topic names but there is still open question why {{MqttPahoMessageDrivenChannelAdapter}} : Attempting reconnect appears on paho {{java.lang.IllegalArgumentException: The topic name MUST NOT contain any wildcard characters (#+)}} in general? And more important question why channel adapter hangs on attempts to reconnect?
    via by Anton,
  • Details: Mqtt broker: apache apollo 1.7 Mqtt eclipse paho client There is some logic on our server that constructs outbound (response) topic name based on incoming message topic name. The logic is pretty straightforward. Client sends message to the topic name {{path/<device-id>/<sub-device-id>/outbound}} and gets server echo message on {{path/<device-id>/<sub-device-id>/inbound}} topic. We didn't implement any topic validation logic on server side yet and this causes the next issue: When some device (not in our control) sends message to the topic name {{path/\+/\+/outbound}} (which is wrong topic name format) server constructs the next topic name for the response message: {{path/\+/\+/inbound}}. The topic name to send message is obviously invalid and after _multiple attempts_ to send message to this topic name system hangs at {{MqttPahoMessageDrivenChannelAdapter}} with the message "Attempting reconnect". The log contains the following exceptions + {{MqttPahoMessageDrivenChannelAdapter}} becomes running in the loop trying to re-connect to mqtt broker: {noformat} org.springframework.messaging.MessageHandlingException: error occurred in message handler [mqttOutboundHandler]; nested exception is java.lang.IllegalArgumentException: The topic name MUST NOT contain any wildcard characters (#+) at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:139) at org.springframework.integration.config.annotation.ServiceActivatorAnnotationPostProcessor$ReplyProducingMessageHandlerWrapper.handleRequestMessage(ServiceActivatorAnnotationPostProcessor.java:99) at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:99) at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ................ org.eclipse.paho.client.mqttv3.MqttException: Client is connected at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.connect(MqttAsyncClient.java:465) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.connect(MqttAsyncClient.java:455) at org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter.connectAndSubscribe(MqttPahoMessageDrivenChannelAdapter.java:194) at org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter.access$300(MqttPahoMessageDrivenChannelAdapter.java:41) at org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter$1.run(MqttPahoMessageDrivenChannelAdapter.java:237) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 2015-12-21 16:02:28.362 DEBUG 65151 --- [task-scheduler-1] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:28.364 DEBUG 65151 --- [task-scheduler-4] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:33.697 DEBUG 65151 --- [task-scheduler-8] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:37.898 DEBUG 65151 --- [task-scheduler-6] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:37.900 DEBUG 65151 --- [task-scheduler-9] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:37.921 DEBUG 65151 --- [task-scheduler-2] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect 2015-12-21 16:02:38.024 DEBUG 65151 --- [task-scheduler-7] .m.i.MqttPahoMessageDrivenChannelAdapter : Attempting reconnect ............... {noformat} indefinitely trying to reconnect. We can definitely fix this issue on our server side to validate topic names but there is still open question why {{MqttPahoMessageDrivenChannelAdapter}} : Attempting reconnect appears on paho {{java.lang.IllegalArgumentException: The topic name MUST NOT contain any wildcard characters (#+)}} in general? And more important question why channel adapter hangs on attempts to reconnect?
    via by Anton,
  • MQTT binding slow/hangs on startup
    via by Ben Jones,
  • GitHub comment 311#270089338
    via GitHub by sylvek
    ,
  • MQTT binding errors - Bindings - openHAB Community
    via by Unknown author,
    • org.eclipse.paho.client.mqttv3.MqttException: Client is connected at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.connect(MqttAsyncClient.java:465) at org.eclipse.paho.client.mqttv3.MqttAsyncClient.connect(MqttAsyncClient.java:455) at org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter.connectAndSubscribe(MqttPahoMessageDrivenChannelAdapter.java:194) at org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter.access$300(MqttPahoMessageDrivenChannelAdapter.java:41) at org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter$1.run(MqttPahoMessageDrivenChannelAdapter.java:237) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
    No Bugmate found.