Semantic-Dataover the Message Queue Telemetry Transport (MQTT) to be compliant with the specifications mentioned in the section Normative references.
Messagesexchange over the MQTT protocol is out of the scope of this project. The library intentionally is designed to use any transport protocol meeting some basic requirements using external components. External components implementing MQTT connectivity can be seamlessly integrated with this SDK using dependency injection concept illustrated by the following domain model:
Serverpublish/subscribe messaging transport protocol. The protocol runs over TCP/IP, WebSocket or over other network protocols that provide ordered, lossless, bi-directional connections. According to the specification its features include:
Application Message. The
Application Messageis the data carried by the protocol across the network for the application. When
Application Messagesare transported they have an associated
Quality of Service(
QoS) and a
Topic Nameis the label attached to an
Application Messagewhich is matched against the
Subscriptionsknown to the
Serversends a copy of the
Application Messageto each Client that has a matching
Server(called also a broker) acts as an intermediary between
Clientswhich have made
Application Messagespublished by
Application Messagesthat match
Application Messagesso they can be delivered even if the
Subscriberis not online.
Network Connectionto the
Server. It can:
Application Messagesthat other
Clientsmight be interested in.
Application Messagesthat it is interested in receiving.
Subscription) to remove a request for
Topic Filterand a maximum
Subscriptionis associated with a single
Sessioncan contain more than one
Sessionhas a different
Topic Filteris an expression contained in a
Subscription, to indicate an interest in one or more topics. A
Topic Filtercan include wildcard characters.
Sessionslast only as long as the
Network Connection, others can span multiple consecutive
Network Connectionsbetween a
Serveris controlled using
Control Packet. The
Control Packetis a packet of data that is sent across the
Network Connection. The specification defines fourteen different types of
Control Packet, one of which (the PUBLISH packet) is used to convey
Keep Aliveattribute. It is a time interval measured in seconds and expressed as a 16-bit word. It is the maximum time interval that is permitted to elapse between the point in time at which the Client finishes transmitting one
Control Packetand the point it starts sending the next. It is the responsibility of the
Clientto ensure that the interval between
Control Packetsbeing sent does not exceed the
Topic Name. If present, it divides the
Topic Nameinto multiple topic levels. A
Topic Filtercan contain special wildcard characters, which allow
Clientto subscribe to multiple topics at once.
Publisher: is the actor that pushes
NetworkMessagestructures to an underlying transport layer.
Subscriber: is the actor that consumes data encapsulated by the
NetworkMessagestructure, which is polled from the underlying transport layer.
Subscriberdon't have any subscriptions management functionality, namely, they follow a communication paradigm called unsolicited notification. When unsolicited notification occurs, a client receives a message that it has never requested. The
Subscribermust use a filtering mechanism to process only messages it is interested in.
Application Messagewhich means the OPC.UA.PubSub
Subscriberentities shall be configured in advance with knowledge of the expected encoding.
Publisherentities should only publish
NetworkMessagesusing a single encoding to a unique MQTT
Application Message. It is expected that the software used to receive the message can process it without needing to know that it was transported via MQTT instead of UDP for example.
QueueNamewith the name
$Metadata. The MQTT RETAIN flag shall be set for metadata messages.
Server, however, this requires that the
Servermust be trusted. For that reason, it may be necessary to provide end-to-end security. Applications that require end-to-end security with MQTT need to use the binary message encoding and apply security protection defined in the OPC.UA.PubSub specification.
KeepAliveTimeis set on a
WriterGroup, a value slightly higher than the configured value of the group in seconds should be set as MQTT
Keep Aliveensuring that the connection is disconnected if the keep alive message was not sent by any writer in the specified time.
Quality of Service
BrokerTransportQualityOfServicevalues map to MQTT
Quality of Servicesettings as follows:
ConsumerMessageHandlerFactory- to create communication infrastructure for the consumer role
ProducerMessageHandlerFactory- to create communication infrastructure for the producer role