Closed opensourcegeek closed 5 years ago
Does anyone know how to get the topic name?
Topic name on acks or topic name of incoming publishes?
It's for incoming publishes.
You receive a notification type and Publish
has topic_name
variable
for notification in notifications {
if let Notification::Publish(p) = notification {
println!("{:?}", p.topic_name);
}
}
Thanks @tekjar, I didn't see that method in docs. I'll go through source and see where that property is getting set.
Ok. Please close this once you got what you need
I'm looking to get the topic name from notification and I'm not sure how to get it. In previous API, I used to be able to pass a MqttCallback which takes in a closure that gets called for each message. That message type had topic name and now it seems like I just get the cross beam channel as receiver, I'm not sure how to get the topic name from the notification. Any idea what API method I should use?