Closed tksarul closed 5 months ago
Hi!
The responseTopic
can not be directly specified in the method signature. Instead, with the latest 0.16.0 release you could inject the Mqtt5Publish
and go from there:
@MqttSubscribe(topic = "t/a/1", qos = EXACTLY_ONCE)
public void subscribeAdRequestTopic(Mqtt5Publish message, String payload, MqttTopic topic) {
Optional<MqttTopic> responseTopic = message.getResponseTopic();
log.debug("paylaod: {} in {}, and response to ", payload, topic, responseTopic);
}
Hope that helps :slightly_smiling_face:
Thanks, This helps lot.
I would like to get response topic (may be optional) in subscription. like below
@MqttSubscribe(topic = "t/a/1", qos = EXACTLY_ONCE) public void subscribeAdRequestTopic(String payload, MqttTopic topic, Optional responseTopic) {
log.debug("paylaod: {} in {}, and response to ", payload, topic, responseTopic);
}