-
Notifications
You must be signed in to change notification settings - Fork 5k
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
CAMEL-21589: Enable manual acks mqtt5 #16702
base: main
Are you sure you want to change the base?
Conversation
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🤖 CI automation will test this PR automatically. 🐫 Apache Camel Committers, please review the following items:
|
@@ -88,6 +88,8 @@ public class PahoMqtt5Configuration implements Cloneable { | |||
private int executorServiceTimeout = 1; | |||
@UriParam(defaultValue = "-1") | |||
private long sessionExpiryInterval = -1; | |||
@UriParam(defaultValue = "false") | |||
private boolean manualAcksEnabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a boolean is false by default, so remove
* | ||
*/ | ||
public boolean isManualAcksEnabled() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty line
try { | ||
PahoMqtt5Consumer.this.client.messageArrivedComplete(mqttMessage.getId(), mqttMessage.getQos()); | ||
} catch (MqttException e) { | ||
throw new RuntimeException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont rethrown but log a WARN about not able to commit
|
||
@Override | ||
public void onFailure(Exchange exchange) { | ||
LOG.error("Error: " + exchange.getExchangeId(), exchange.getException()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better description, such as "Rollback message due to error processing ..."
Description
This PR implements a new parameter called manualAcksEnabled, which would make it possible for the user to enable manual acknowledgements in the client. By default, the parameter is set to false and messages will be automatically acknowledged. If set to true, the acknowledgement is added in the exchange's completion callback.
Target
camel-3.x
, whereas Camel 4 uses themain
branch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTests
locally from root folder and I have committed all auto-generated changes.