-
Notifications
You must be signed in to change notification settings - Fork 227
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
Add Request::PublishWithNotify
to notify about selected pkid
#240
Conversation
* This allows to get notified about the selected `pkid` for a given `Publish` message. * The purpose of this is be able to wait for PubAck (QoS=1) or PubComp (QoS=2) messages on a per message basis. For that we need to know the `pkid` that is choosen by `rumqttc` as we can't realiably provide our own `pkid`.
How does this propagate all the way to client?
I don't see any publish method which uses |
@tekjar We use the We use this in our custom MQTT client (based on rumqttc) to implement a Ideally, |
Yeah. That would be good. This would be |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
As per MQTT 3.1.1:
They fail to define what an Ordered or Unordered Topic is but I assume that it means that the server may elect to acknowledge published messages in arbitrary order. Is this something that can still be added to rumqttc or is the wontfix label correct? |
@mladedav, the wontfix label was added by the bot. We had configured it wrong. It's supposed to be the "stale" label. Please consider it to mean something in the lines of "We are currently not seeing any activity on this issue/PR and hence we will be marking it as stale till there is an answer/commit in response by the author" |
@@ -309,6 +310,17 @@ impl MqttState { | |||
Ok(()) | |||
} | |||
|
|||
fn outgoing_publish_with_notify(&mut self, publish: Publish, notify: OneshotSender<u16>) -> Result<(), StateError> { | |||
let () = self.outgoing_publish(publish)?; | |||
if let Some(Event::Outgoing(Outgoing::Publish(pkid))) = self.events.back() { |
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.
This seems dangerous in in parallel environments. There is no guarantee that this will happen (and therefore the client could wait indefinetly for the notification) and even if this happens, there is a chance that the pkid is wrong.
There is a different PR that addresses very similar issue in #291. When you say you cannot reliably provide pkid, can you at least provide semi-random unique correlation IDs? |
This allows to get notified about the selected
pkid
for a givenPublish
message.The purpose of this is be able to wait for PubAck (QoS=1) or PubComp
(QoS=2) messages on a per message basis. For that we need to know the
pkid
that is choosen byrumqttc
as we can't realiably provide ourown
pkid
.