hivemq-mqtt-client icon indicating copy to clipboard operation
hivemq-mqtt-client copied to clipboard

Mqtt3 Client stops subscribing on Exception

Open raddatzk opened this issue 2 years ago • 1 comments

Expected behavior

After an exception occurred while consuming an mqtt 3 event, mqtt should continue consuming events

Actual behavior

A reactivex UndeliverableException will be thrown and no more events will be consumed

To Reproduce

Checkout the example repository and follow the steps from the README

Details

  • Affected HiveMQ MQTT Client version(s): 1.3.0
  • Used JVM version: 17.0.5
  • Used OS (name and version): MacOS Ventura
  • Used MQTT version: 3
  • Used MQTT broker (name and version): hivemq/hivemq3:latest

raddatzk avatar Dec 12 '22 15:12 raddatzk

Hi @raddatzk - thanks for the bug report and great supplementary repo with code!

There should be some protections against breaking the entire event stream although if end user consumer code is throwing exceptions, should that be hidden? Logged?

The best case is if consumer code protects against this as your work-around.

I'll need to give this some thought but in the meantime, this is a good note for other users. Consumer code should be careful to not let unexpected exceptions percolate up.

pglombardo avatar Dec 14 '22 09:12 pglombardo

We've filed a feature request in #624 to improve exception handling in the client. I'll close out this issue but if you have any other input/feedback, let us know!

pglombardo avatar Mar 05 '24 14:03 pglombardo