-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom ACK function, check handler function status #396
Comments
I consume my messages then pass them off on a channel to my workers as mqtt.Message, which implements Ack(). However, the code inside router.go executes Ack() which wraps a sync.once.Do function. So exposing Ack() this way literally does nothing because it's already been executed inside router.go inside the matchAndDispatch function. |
As per @alsm comments on #459 this functionality is by design:
Please feel free to reopen if you disagree but its not something that we are likely to implement (pull requests would be considered but given the above I'm not sure this would be a good idea). |
IMO having the option to manually ACK a message is important for failure handling in a distributed system. Additionally, this functionality already exists in the Java (V5?) client (https://github.com/eclipse/paho.mqtt.java/blob/master/org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/client/IMqttAsyncClient.java#L823), so this is not new ground for Paho MQTT. |
Hi,
the current implementation of the
paho.mqtt.golang
acknowledges incoming messages once they're received, just after calling handler function.If the handler execution fails, the message shouldn't be acknowledged but repeated.
I wish to see two features:
Ack()
function - could be a wrapper, a decorator pattern, etc.Ack()
method if only the handler function returns non-error result.Best,
Marcin
The text was updated successfully, but these errors were encountered: