Skip to content

MqttPahoMessageDrivenChannelAdapter is unstoppable. #2275

@SotnikMS

Description

@SotnikMS

Hi,

I use Spring Integration to start/stop multiple MQTT clients in run time. Unfortunately I always receive EOFException when MQTT client is stopped:

Connection lost (32109) - java.io.EOFException`
    at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146)`
    at java.lang.Thread.run(Thread.java:745)`
Caused by: java.io.EOFException`
    at java.io.DataInputStream.readByte(DataInputStream.java:267)`
    at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65)`
    at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107)`
    ... 1 more

This exception is normal, it is even not traced by default.
But the problem is this exception is thrown after MqttPahoMessageDrivenChannelAdapter.doStop() method invocation. As a result MqttPahoMessageDrivenChannelAdapter.scheduleReconnect() is called and MQTT client is recreated.

So, the only way to stop MQTT client is application restart.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions