hivemq / hivemq-mqtt-client

HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
https://hivemq.github.io/hivemq-mqtt-client/
Apache License 2.0
832 stars 153 forks source link

Mqtt3 Client stops subscribing on Exception #553

Closed raddatzk closed 4 months ago

raddatzk commented 1 year ago

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

pglombardo commented 1 year ago

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 commented 4 months ago

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!