Matheus Fonseca
Matheus Fonseca

Reputation: 11

Publish/Subscribe pattern with subscriber response

Is this possible in a publish/subscribe pattern?

  1. A publisher publishes a message to a topic;
  2. Subscriber(s) receive(s) the message;
  3. The subscribers reply to publisher with a custom message.

Is step 3 possible? I'm designing a system that will use MQTT protocol (communication between smartphones and microcontrollers). However, the subscriber needs to send an answer to the publisher other than the Acknowledged message.

Upvotes: 1

Views: 418

Answers (1)

hardillb
hardillb

Reputation: 59826

There is no way to directly reply to the a message in a MQTT system, but there is nothing to stop you using 2 topics (outboud/inbound) and including a message id in the payload of the message to identify the reply to the original published message

Upvotes: 2

Related Questions