Closed ctron closed 1 year ago
does it mean that the message object could have an ack()
method and we should have an auto-ack message option that would perform the current ack for retro compatibility ?
I would agree with Julien but leaving autoack as default for backward compatibility of course.
@ctron would you like to contribute?
I could draft up a PR. However I am not sure I can find the time to follow up on this to get it merged. I think this should come from the project.
can i take this feature? Please provide some information regarding this.
@SivaAkiro yes you can, you can read the contribution guidelines
Thanks, can I get some.information about this ticket.
Thanks, can I get some.information about this ticket.
ack
method should be added to the message interfaceyes and also server options
On Mon, Aug 1, 2022 at 9:15 PM SivaAkiro @.***> wrote:
Question, Options means MQTTClientOptions right?
— Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-mqtt/issues/200#issuecomment-1201610723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCQROPXWKVCH7D3EHLTVXAO6VANCNFSM45UXN4YQ . You are receiving this because you commented.Message ID: @.***>
For QoS 1 every message, we need to check the whether this message should be auto ack or not. Default, all the messages will get auto-ack, if not user has to manually call the ack method.
We need to add the isAutoAck() in MqttPublishMessage Class and all the message which is received by the Client, will validate against this param?
Is my understanding correct?
No, you have the auto-ack boolean flag in the options ... so you have to check against it. A PUBLISH message cannot bring the information that it has to be auto-ack or not. It's a client or server configuration as we said.
I all, I think this issue can be closed since #235 is merged.
Closed with #235
Currently it is not possible to control the acknowledgement of an MQTT message, as the client auto-acknowledges messages.
Version
Context
Receiving messages.
Extra
Using QoS 1, the client currently auto-acknowledges messages received from a server, it also does this before calling the user provided handler:
https://github.com/vert-x3/vertx-mqtt/blob/5455c484347bdaf854fdd556653ea37b29ff860d/src/main/java/io/vertx/mqtt/impl/MqttClientImpl.java#L1191-L1195
Taking a look at section "4.3.2" and figure "Figure 4.2" of the MQTT v3.1.1 spec, you can see that the acknowledgement must be sent, after the receiver has taken ownership of the message.
However, the MQTT client being an un-opinionated MQTT client, should not acknowledge a message before it has passed it on the application level code, which ultimately takes ownership of the message.