0
votes

So MQTT is the light weight messaging protocol based on publish/subscribe model.

Originally OPC-UA was based on a request/response model, but I have read that it now also supports pub/sub extension.

I also understand that OPC-UA is a not really a protocol but a system architecture. Other than this fact, from the view point of protocol features (considering pub/sub only) what is the difference between MQTT and OPC-UA?

2

2 Answers

2
votes

OPC-UA Pub/Sub by itself is protocol agnostic, and MQTT is one of the transport protocols it can use (and is among those that already have the mapping specified). Other transport protocols currently defined in the OPC UA PubSub spec are AMQP, UDP, and "raw" Ethernet.

1
votes

OPC UA PubSub extends the classic client/server communication pattern with a publish/subscribe pattern. OPC UA PubSub itself is not defined in terms of a specific protocol, instead a number of mappings to transports (and encondings) are specified.

An MQTT transport with a JSON encoding of the data is one of the mappings. This mapping defines a standard how to encode UA data models as JSON. It also defines a standard how to publish (JSON) meta data describing this data.

This allows to publish a UA DA datatype like an AnalogItem via MQTT and get describing properties like a Range or a Unit.

OPC UA also describes interfaces which allows to configure the publisher.

Details can be found here: https://reference.opcfoundation.org/v104/Core/docs/Part14/

To get an overview it is enough to read section 2, 3, 4 and the earlier parts of 5.