Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "BaSyx / Documentation / Components / AAS Server / Features / Hierarchical MQTT"

(Created page with "== User Story & Use Case == ''As AAS Components user'' ''I want hierarchical MQTT topics in the AAS Server Component'' ''so that I can subscribe precisely to the topics of i...")
 
m (Adds LambdaProperty disclaimer)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
= Hierarchical MQTT Eventing =
 
== User Story & Use Case ==
 
== User Story & Use Case ==
 
''As AAS Components user''
 
''As AAS Components user''
Line 7: Line 8:
  
  
MQTT supports hierarchical topics with wildcard subscription support.
+
MQTT supports hierarchical topics with [https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/ wildcard subscription support].
For example, if the topics ''a/b/x'' and ''a/b/y'' exist, subscribing to ''a/b/*'' subscribes to all events broadcasted on both topics.
+
For example, if the topics ''a/b/x'' and ''a/b/y'' exist, subscribing to ''a/b/+'' subscribes to all events broadcasted on both topics.
 +
 
 +
 
 +
Please note, that this feature can not be combined with lambda properties due to them being only updated on query.
  
 
== Feature Overview ==
 
== Feature Overview ==
 
The following hierarchical topics with their respective payloads are implemented:
 
The following hierarchical topics with their respective payloads are implemented:
  
*/aas-repository/<repo-id>/shells/created
+
*aas-repository/<repo-id>/shells/created
 
** Payload: Complete AAS (without ConceptDictionaries)
 
** Payload: Complete AAS (without ConceptDictionaries)
*/aas-repository/<repo-id>/shells/deleted
+
*aas-repository/<repo-id>/shells/deleted
 
*** Payload: Complete AAS (old, without ConceptDictionaries)
 
*** Payload: Complete AAS (old, without ConceptDictionaries)
*/aas-repository/<repo-id>/shells/updated
+
*aas-repository/<repo-id>/shells/updated
 
** Payload: Complete AAS (without ConceptDictionaries)
 
** Payload: Complete AAS (without ConceptDictionaries)
  
*/aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/created
+
 
 +
*aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/created
 
** Payload: Submodels without SMEs
 
** Payload: Submodels without SMEs
*/aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/deleted
+
*aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/deleted
 
** Payload: Submodels without SMEs
 
** Payload: Submodels without SMEs
*/aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/updated
+
*aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/updated
 
** Payload: Submodels without SMEs
 
** Payload: Submodels without SMEs
  
*/aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/created
+
 
 +
*aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/created
 
** Payload:  SME without value (or value-equivalent)
 
** Payload:  SME without value (or value-equivalent)
*/aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/deleted
+
*aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/deleted
 
** Payload:  old SME without value (or value-equivalent)
 
** Payload:  old SME without value (or value-equivalent)
*/aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/updated
+
*aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/updated
 
** Payload:  SME without value (or value-equivalent)
 
** Payload:  SME without value (or value-equivalent)
*/aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/value
+
*aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/value
 
** SME value, if not specified otherwise via qualifier
 
** SME value, if not specified otherwise via qualifier
  
Line 40: Line 46:
  
 
== Feature Configuration ==
 
== Feature Configuration ==
The feature can be configured via the aas.properties by selecting aas.
+
The feature can be configured in the ''aas.properties'' file by setting ''aas.events = MQTTV2'' for Base64URL encoding or ''aas.events = MQTTV2_SIMPLE_ENCODING'' for URL encoding.
 +
Additionally, the repo id needs to be configured via ''aas.id = <repo-id>''.
 +
 
 +
An example configuration for this feature could be:
 +
 
 +
aas.events = MQTTV2
 +
aas.id = product-aas-repo
 +
 
 +
The MQTT broker connectivity is configured via [[BaSyx_/_Documentation_/_Components_/_MQTT | mqtt.properties ]]
 +
 
 +
Additional to the overall event configuration, the payload send on the ''../value'' topic for updating a SubmodelElement's value can be tailored. For SubmodelElements containing huge values like Blobs, it may be sensible to disable sending their value's content. If this is the case, a qualifier with type ''emptyValueUpdateEvent'' and value set to ''true'' will configure empty value updates for the specific SubmodelElement (cf. [https://github.com/eclipse-basyx/basyx-java-sdk/blob/development/src/main/java/org/eclipse/basyx/submodel/restapi/observing/ObserableSubmodelAPIV2Helper.java#L62 ObservableSubmodelAPIV2Helper]).

Latest revision as of 04:21, 23 May 2023

Hierarchical MQTT Eventing

User Story & Use Case

As AAS Components user

I want hierarchical MQTT topics in the AAS Server Component

so that I can subscribe precisely to the topics of interest without having to filter on client side


MQTT supports hierarchical topics with wildcard subscription support. For example, if the topics a/b/x and a/b/y exist, subscribing to a/b/+ subscribes to all events broadcasted on both topics.


Please note, that this feature can not be combined with lambda properties due to them being only updated on query.

Feature Overview

The following hierarchical topics with their respective payloads are implemented:

  • aas-repository/<repo-id>/shells/created
    • Payload: Complete AAS (without ConceptDictionaries)
  • aas-repository/<repo-id>/shells/deleted
      • Payload: Complete AAS (old, without ConceptDictionaries)
  • aas-repository/<repo-id>/shells/updated
    • Payload: Complete AAS (without ConceptDictionaries)


  • aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/created
    • Payload: Submodels without SMEs
  • aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/deleted
    • Payload: Submodels without SMEs
  • aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/updated
    • Payload: Submodels without SMEs


  • aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/created
    • Payload: SME without value (or value-equivalent)
  • aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/deleted
    • Payload: old SME without value (or value-equivalent)
  • aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/updated
    • Payload: SME without value (or value-equivalent)
  • aas-repository/<repo-id>/shells/<encoded-aas-identifier>/submodels/<encoded-sm-identifier>/submodelElements/<idShortPath>/value
    • SME value, if not specified otherwise via qualifier


For AAS/SM-Identifier encoding, Base64URL encoding and URL encoding are available.

Feature Configuration

The feature can be configured in the aas.properties file by setting aas.events = MQTTV2 for Base64URL encoding or aas.events = MQTTV2_SIMPLE_ENCODING for URL encoding. Additionally, the repo id needs to be configured via aas.id = <repo-id>.

An example configuration for this feature could be:

aas.events = MQTTV2
aas.id = product-aas-repo

The MQTT broker connectivity is configured via mqtt.properties

Additional to the overall event configuration, the payload send on the ../value topic for updating a SubmodelElement's value can be tailored. For SubmodelElements containing huge values like Blobs, it may be sensible to disable sending their value's content. If this is the case, a qualifier with type emptyValueUpdateEvent and value set to true will configure empty value updates for the specific SubmodelElement (cf. ObservableSubmodelAPIV2Helper).

Back to the top