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

Added the field localCorrelationData to MqttPublish for better flow-handling in reactive-APIs #546

Open codepitbull opened 1 year ago

codepitbull commented 1 year ago

Motivation Using the reactive integrations (rxjava2/reactor) results in a situation where after an MqttPublish has been processed a Mqtt5PublishResult is forward in the stream. This object doesn't contain any processing context which makes a few usecases rather unintuitive to implement. In my case I am receiving from Kafka and want to commit AFTER the message has been sent to HiveMQ. For that I need to get the commit-offset to the end of the stream.

Changes To support the above mentioned usecase I added a localCorrelationData (similar to what Kafka is doing in their client-lib). This field is never propagated to HiveMQ but can be used down the streams. In my case I store the Kafka-Commit-Offset in there and use it to trigger the actual commit.

cla-bot[bot] commented 1 year ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @codepitbull on file. In order for us to review and merge your code, please sign our Contributor License Agreement to get yourself added. You'll find the CLA and more information here: https://github.com/hivemq/hivemq-community/blob/master/CONTRIBUTING.adoc#contributor-license-agreement

cla-bot[bot] commented 1 year ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @codepitbull on file. In order for us to review and merge your code, please sign our Contributor License Agreement to get yourself added. You'll find the CLA and more information here: https://github.com/hivemq/hivemq-community/blob/master/CONTRIBUTING.adoc#contributor-license-agreement

cla-bot[bot] commented 1 year ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @codepitbull on file. In order for us to review and merge your code, please sign our Contributor License Agreement to get yourself added. You'll find the CLA and more information here: https://github.com/hivemq/hivemq-community/blob/master/CONTRIBUTING.adoc#contributor-license-agreement

pglombardo commented 1 year ago

@cla-bot u so lazy

pglombardo commented 1 year ago

@cla-bot check

cla-bot[bot] commented 1 year ago

The cla-bot has been summoned, and re-checked this pull request!

pglombardo commented 1 year ago

Hi all - let's wrap up this PR this week if possible so it doesn't go stale.