MQTT Eventing#
The AAS Repository can publish hierarchical MQTT events for repository operations and operations on an individual Asset Administration Shell.
Warning
Starting with BaSyx Java Server SDK Milestone 14, MQTT uses canonical topics with unpadded UTF-8 Base64URL-encoded identifier segments. Submodel-reference topics no longer contain the raw submodel identifier, and AAS service topics no longer contain a raw or URL-percent-encoded shell identifier.
This is a breaking subscription change. Events are not also published on the legacy topics, so existing subscribers must update their topic filters when upgrading to Milestone 14.
Configuration#
Enable MQTT eventing in the standalone AAS Repository component with:
basyx.aasrepository.feature.mqtt.enabled=true
mqtt.clientId=aas-repository
mqtt.hostname=localhost
mqtt.port=1883
mqtt.clientId must be unique among clients connected to the broker. The connection scheme defaults to tcp. The complete connection configuration is:
Property |
Required |
Default |
Description |
|---|---|---|---|
|
Yes |
- |
MQTT client identifier |
|
Yes |
- |
MQTT broker host name |
|
Yes |
- |
MQTT broker port |
|
No |
|
Connection URI scheme, for example |
|
No |
Empty |
Broker user name |
|
No |
Empty |
Broker password |
Credentials are applied only when both mqtt.username and mqtt.password are set. Automatic reconnect is enabled.
The available feature switches are:
Property |
Events enabled |
|---|---|
|
AAS repository events; this module is included in the standalone AAS Repository component |
|
Events for operations on an individual AAS; add |
|
Every MQTT feature available on the application’s classpath |
Topic placeholders#
Placeholder |
Meaning |
|---|---|
|
Repository name configured with |
|
AAS identifier encoded as unpadded UTF-8 Base64URL |
|
Submodel identifier encoded as unpadded UTF-8 Base64URL |
For example, the identifier https://example.com/aas/1 becomes aHR0cHM6Ly9leGFtcGxlLmNvbS9hYXMvMQ. Base64URL uses - and _ instead of + and / and omits trailing = padding.
AAS repository events#
Event |
Topic |
Payload |
|---|---|---|
AAS created |
|
Created AAS JSON |
AAS updated |
|
Updated AAS JSON |
AAS deleted |
|
Deleted AAS JSON |
Submodel reference created |
|
Created AAS JSON |
Submodel reference deleted |
|
Deleted AAS JSON |
AAS service events#
These events are provided by the Java SDK’s basyx.aasservice-feature-mqtt module. When composing a custom application with this module, enable it with basyx.aasservice.feature.mqtt.enabled=true or the global switch described above. The module is not bundled in the standalone AAS Repository component.
Event |
Topic |
Payload |
|---|---|---|
Asset information set |
|
Updated AssetInformation JSON |
Submodel reference added |
|
Created SubmodelReference JSON |
Submodel reference removed |
|
Deleted SubmodelReference JSON |
Milestone 14 migration#
Event |
Before Milestone 14 |
Starting with Milestone 14 |
|---|---|---|
Repository submodel-reference create/delete |
Raw submodel ID in the topic |
|
AAS service operations |
Raw or URL-percent-encoded shell ID |
|
Repository names remain unchanged. A broad subscriber can use aas-repository/$repoId/#; consumers that parse identifier segments must Base64URL-decode the relevant segment as UTF-8.
