Skip to content

fix(mqtt): wait for broker ack before completing durable sends - #3745

Merged
jeremydmiller merged 2 commits into
JasperFx:mainfrom
dmitrynovik:feat/mqtt-durability
Aug 1, 2026
Merged

fix(mqtt): wait for broker ack before completing durable sends#3745
jeremydmiller merged 2 commits into
JasperFx:mainfrom
dmitrynovik:feat/mqtt-durability

Conversation

@dmitrynovik

Copy link
Copy Markdown
Contributor

I noticed that MQTT transport does not persist outgoing messages in sqlite's wolverine_outgoing_envelopes - something that potentially means message loss when using batching and the producer process is crashing.

MqttTopic's sender used EnqueueAsync, which queues locally and returns
before the broker acknowledges the publish. For endpoints configured with
UseDurableOutbox()/UseDurableInbox(), this let the outbox entry be deleted
before delivery was actually confirmed, silently losing messages if the
broker was unreachable or the process crashed in between.

Now, MQTT sends through a new MqttSenderProtocol that
blocks on PublishAsync until the broker acks, matching how every other
transport with real broker acknowledgements works. Inline mode keeps its
existing fire-and-forget behavior unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants