SPL File IotPlatform.spl

Content

Operators
  • IotPlatform: Application providing integration with an IBM Watson IoT Platform organization.

Composites

composite IotPlatform

Application providing integration with an IBM Watson IoT Platform organization.

This application performs the role of ingest and egress (for device commands) for IBM Watson IoT Platform. Multiple independent analytic applications can then subscribe to the published streams as required. Thus these applications are isolated from having to have knowledge of connection details for the IBM Watson IoT Platform organization.

Streams of device events, commands and statuses are published:

  • Device events with streams topic: streamsx/iot/devices/events with schema of DeviceEvent
  • Device commands with streams topic: streamsx/iot/devices/commands/sent with schema of DeviceCmd
  • Device status updates with streams topic: streamsx/iot/devices/statuses with schema of DeviceStatus

The streams topic streamsx/iot/devices/commands/send (schema DeviceCmd) is subscribed to allow analytic applications to send commands to specific devices.

The Publish and Subscribe model from the com.ibm.streamsx.topology.topic toolkit is used. Applications may use the generic Publish and Subscribe operators from that toolkit but these operators provide additional functionality specific to this toolkit:

IotPlatform supports Watson IoT Platform's scalable application mode that distributes messages (device events, commands and statuses) across multiple MQTT subscribers. This is configured by setting the optional parameters scaleEvents, scaleCommands and scaleStatuses. IBM Streams parallel regions are used to instantiate multiple MQTT source operators and publish those events, commands or statuses using multiple streams. Applications that subscribe using EventsSubscribe, CommandsSubscribe, StatusesSubscribe or Subscribe will correctly see the required tuples, regardless of the scale factor or if the subscriber is itself using parallel regions.

Scalable application mode also supports failures of the MQTT source operators or their connections by automatically delivering messages across the remaining active connections. Once a connection from this application is resetablished it will again be included in message delivery.

All of this composite's parameters can be set using submission time values at job submission time.

Parameters

  • org: Organization identifier (required)
  • domain: Service domain, used to define the host for the MQTT message hub host, which will be org.messaging.domain (optional, defaults to internetofthings.ibmcloud.com supporting IBM Watson IoT Platform hosted on IBM Cloud).
  • authKey: API key (required)
  • authToken: API Token (required)
  • encrypted: true to use encrypted (TLSv1.2) connections to IoT Plaform, false to use unencrypted (optional, defaults to true)
  • allowFilters: true to use allow applications subscribing to device events, sent device commands and device statuses to push filtering to this application. false to disallow execution of subscriber filters (optional defaults to true)
  • scaleEvents: Scaling factor for device events (optional, defaults to 1)
  • scaleCommands: Scaling factor for sent device commands. Optional, defaults to 1)
  • scaleStatuses: Scaling factor for device statuses (optional, defaults to 1)