-
Notifications
You must be signed in to change notification settings - Fork 544
Open
Labels
kind/bugSomething isn't workingSomething isn't working
Description
Currently, the MQTT binding in Dapr only acknowledges (mqttMsg.Ack()) messages after successful processing by the handler. This behavior can lead to repeated message delivery by the broker when the handler fails after all retries, causing potential infinite loops and unnecessary load.
Expected Behavior
- The message should be acknowledged after the retry logic completes, regardless of success or failure.
Actual Behavior
- mqttMsg.Ack() is only called on success.
When retries fail, the message is never acknowledged, causing repeated delivery by the broker.
Steps to Reproduce the Problem
-
Configure MQTT binding with:
"it is QoS: 1"
CleanSession: true
retain: false
backOffMaxRetries: 0 -
Simulate a handler failure (e.g., return an error).
-
Observe that the message is retried indefinitely by the broker (I used a VerneMQ MQTT Brocker)
Proposed Solution
Move mqttMsg.Ack() outside the retry logic so it is always called after retries finish:
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingSomething isn't working