AtherEnergy / rumqtt

Pure rust mqtt cilent
The Unlicense
202 stars 71 forks source link

Unsubscribe message #83

Open ivanovaleksey opened 6 years ago

ivanovaleksey commented 6 years ago

Hello, I would like to have dynamic subscriptions.

On certain action subscription should be created, it is done by MqttClient::subscribe. And on another action this subscription should be deleted (as I understand MQTT has UNSUBSCRIBE message for that).

And I just realized that I can't see any method for unsubscribing.

Is there any solution for this?

Thanks.

TheBestJohn commented 5 years ago

Unsubscribe does have an implementation in the mqtt311 lib and I have been able to get a branch sending and recieving unsubacks. I think I may have to do some more logic to let rumqtt know that i've unsubbed but it looks as if I no longer get the pubs from that channel.

bachrc commented 4 years ago

We could close this issue now this is resolved?

alepez commented 4 years ago

We could close this issue now this is resolved?

Actually, with mqtt311 0.2 (the last one) it hits unimplemented. It is an mqtt311 issue but at the moment if you call rumqtt::MqttClient::unsubscribe it panics.

At the moment it is not yet implemented, try callng rumqtt::MqttClient::unsubscribe, it will hit unimplemented here: https://github.com/AtherEnergy/rumqtt/blob/dae78c914672062092027d17360c34cca0616ca2/src/client/mqttstate.rs#L72