Setting Up Shared Subscriptions
Learn about setting up shared subscriptions in Connectware.
Last updated
Was this helpful?
Was this helpful?
description: |
Simple Mapping with Shared Subscription
metadata:
name: Simple Shared Subscription
resources:
sharedSubscriptionMapping:
type: Cybus::Mapping
properties:
mappings:
- subscribe:
topic: $share/group1/input
publish:
topic: output
rules:
- transform:
expression: |
{
"msg": $
}description: |
Shared Subscription Test
metadata:
name: Shared Subscription Test
parameters:
agentName:
description: Choose Agent
type: string
enum: ['agent01', 'agent02']
resources:
sharedSubscriptionMapping:
type: Cybus::Mapping
properties:
agentName: !ref agentName
mappings:
- subscribe:
topic: $share/group1/input
publish:
topic: output
rules:
- transform:
expression: !sub |
(
$merge([$, {"agent": "${agentName}"}]);
)---
description: |
Wildcard Mapping with Shared Subscription
metadata:
name: Wildcard Mapping Shared Subscription
provider: cybus
homepage: https://www.cybus.io
version: 1.0.0
parameters:
agentName:
type: string
default: protocol-mapper
mqttBroker:
type: string
default: broker.example.com
mqttUser:
type: string
default: admin
mqttPassword:
type: string
default: admin
resources:
mqttConnection:
type: Cybus::Connection
properties:
agentName: !ref agentName
protocol: Mqtt
targetState: connected
connection:
host: !ref mqttBroker
username: !ref mqttUser
password: !ref mqttPassword
wildcardMappingSharedSubscription:
type: Cybus::Mapping
properties:
agentName: !ref agentName
mappings:
- subscribe:
topic: $share/qa/services/#nodes
connection: !ref mqttConnection
publish:
topic: northbound/opcua/$nodes