MQTT: A common topic for each ESPs (clients) or unique topic for each ESP (client)

Hello Everyone,
I'm working on MQTT project and I've been thinking of implementing any of the following two topologies:

  1. There would be the common topic to which all ESPs (clients) would publish the data consisting of the unique identifier so that the Server has to subscribe to a single common topic, using a unique identifier in data the Server would be able to identify the message is coming from which ESP (client).
  2. Each ESP would publish data on its unique topic, Server has to subscribe to all these unique topics.
    Which topology should I prefer?
    Which topology is usually preferred by IoT accessories companies?

Using the # character in the subscribe topic allows wildcard subscriptions.
As an example I use "Sensors/#" as the subscribe topic and all my sensors that publish to this this path are picked up.
Sensors/Lounge, Sensors/Kitchen, Sensors/Bedroom, Sensors/Bathroom etc

MQTT server, Broker, does not subscribe to topics.

If I'm right, In order to identify that this data belongs to a certain sensor, you must be sending the unique identifier of that sensor in the data.
Eg., Sensor/Lounge: In data: {id: "Lounge", data...}
Sensor/Kitchen: In data: {id: "Kitchen", data...}
where id is a unique identifier.

I didn't mean MQTT server.
Server: where the website is hosted and it's also a mqtt client.

I use Node-Red with mosquitto broker and the sending device name shows up in the topic

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.