I need MQTT node that have input and output

MQTT is not a request/response type of protocol. There is no way for an MQTT client to ask the broker for just one message from a topic. If the client wants to do that, it has to subscribe to the topic, wait until a message arrives and then unsubscribe. But nothing would stop the broker from sending 30 messages before the unsubscribe arrives and is processed.

So the more general pattern to use would be, as has been suggested, an MQTT In node subscribed to the topic you are interested in, saving the most recent value received into local context which you can access at any time.

Where there is a need for another MQTT node is to be able to dynamically subscribe to topics at runtime - where you can't hard code the topic into the node.

We do have a design for such a node and it is sat in the backlog until someone is interested enough to contribute to its implementation.

5 Likes