com.apama.cumulocity.devices
Event DeviceService
This provides actions to manage device consumers and publishers for different tenants and transports.
Note: The DeviceService is currently in public preview and may be subject to change in future.
addTenant
void static addTenant(string tenantID, dictionary<string, string> tenantConfig)
Initializes the DeviceService chain configuration parameters for a given tenant.
This must be called before connecting consumers or publishers.- Parameters:
- tenantID - The tenant identifier.
- tenantConfig - A dictionary of configuration values (e.g., service URL, credentials, topic mappings).
connectConsumers
sequence<com.apama.cumulocity.devices.DeviceConsumer> static connectConsumers(string tenantID, string transport)
Connects device consumers for a given tenant and transport.
This action is idempotent. It establishes connections to the appropriate consumer chains. The number of consumers is determined by configuration: (CUMULOCITY_DEVICESERVICE_NUMBER_CLIENTS) - Per-tenant: defaults to number of CPUs - Multi-tenant: defaults to 1- Parameters:
- tenantID - The tenant identifier.
- transport - The transport type (e.g., "mqtt").
- Returns:
- A sequence of DeviceConsumer objects representing the connected consumers.
connectPublisher
com.apama.cumulocity.devices.DevicePublisher static connectPublisher(string tenantID, string transport)
Connects a device publisher for a given tenant and transport.
It creates a publisher connection to send device data to to-device topic.- Parameters:
- tenantID - The tenant identifier.
- transport - The transport type (e.g., "mqtt").
- Returns:
- A DevicePublisher instance.
removeTenant
void static removeTenant(string tenantID)
Removes the tenant based chains.- Parameters:
- tenantID