paho.mqtt.java icon indicating copy to clipboard operation
paho.mqtt.java copied to clipboard

Invalid Packet Type

Open realdognose opened this issue 1 year ago • 0 comments

After some time of usage, the Pharo-client just disconnects with the error:

relates to REASON_CODE_INVALID_MESSAGE

Paket nicht erkannt (32108)
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31)
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:99)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:137)

Restarting the application immediately produces the same error again, only restarting the broker helps (for some time)

So, apparently the broker is sending "something" invalid there.

However, this exception can't be handled code-wise (from the app) because paho itself decides that this is a non-recoverable error and goes into stop-state. at:

catch (MqttException ex) {
	//@TRACE 856=Stopping, MQttException
	log.fine(CLASS_NAME,methodName,"856",null,ex);
	synchronized (lifecycle) {
		target_state = State.STOPPED;
	}
	// Token maybe null but that is handled in shutdown
	clientComms.shutdownConnection(token, ex);
}

Any Workarounds to "reject / ignore" invalid messages? Other MQTT-Clients are just working fine at the same time.

realdognose avatar Dec 30 '23 11:12 realdognose