Pub Sub Security Service Quickstart Guide

Quickstart

Short

  • To use the DS RabbitMQ for Publish/Subscribe operations, you need to get a DS RabbitMQ user account and the relevant permissions.
  • This process has been automated using the Pub/Sub Security Service.
  • The Pub/Sub Security Service offers an intuitive GUI to perform these design-time activities as explained below.

Publish Operations

Design Time Activities to Enable Publish Operations

  • To use the DS RabbitMQ for Publish operations (e.g., using MQTTS), you need to get a vhost for your company and a DS RabbitMQ user account under that vhost.

  • Get a new vhost: Once you visit the Pub Sub Security Service dashboard in the EFPF Portal, a new vhost for your company is automatically created.

  • vhost name: The name of the vhost is derived from your email Id - its the string following the @ symbol, with .’s replaced with -’s.

    • e.g. for user@companyx.com: Vhost = companyx-com
    • e.g. for user@department1.companyz.com: Vhost = department1-companyz-com
    • Exceptions:
      • user@gmail.com: Vhost = efpf-open-call-vhost
      • user@outlook.com: Vhost = efpf-open-call-vhost
  • Register a resource: Next, you need to register a resource (tool/iFlow), say ’tool1’, that intends to publish data. You can register tool1 using the Register Resource page.

  • Create a topic: For tool1, you need to create a new topic using the Create Topic page.

  • Topic name: The topic name would be of the form: <vhost name>/<Group ID>/<Message Type>/<Edge Node ID>/<Device ID, if any>. Example: companyx-com/FACTORY_Y/DDATA/FC_8/MOTION_SENSOR_1

  • Obtain the credentials: Search for your topic on the page View Topics, locate it, and obtain your DS RabbitMQ credentials from the Credentials > Publish tab, by clicking on the |↗️| button.

    NOTE: The “routingKey” provided on the Credentials Pop Up, should be used as the Topic Name directly.

  • Publish: Configure tool1 to use these credentials and publish to DS RabbitMQ over topic companyx-com/FACTORY_Y/DDATA/FC_8/MOTION_SENSOR_1 and start publishing data.

Example:

mosquitto_pub -h efpf.smecluster.com -p 8883 -u 'companyx-com:user1@companyx.com' -P 'replace_this_with_password' -t 'companyx-com/FACTORY_Y/DDATA/FC_8/MOTION_SENSOR_1' --cafile /c/Users/user1/Downloads/cacert-2020-07-22.pem -m test_message_1

Grant other users permission to Subscribe to your topics

  • View the pending requests: Go to the “New Requests” section on the Credentials admin page to view the pending requests.
  • Approve: Locate the request and approve it by clicking on ✓ in the Credential Request > Approve tab.

Subscribe Operations

Design Time Activities to Enable a Subscribe Operation

  • Let’s say, your EFPF username is user2@example.org, and you want to subscribe to the companyx-com/FACTORY_Y/DDATA/FC_8/MOTION_SENSOR_1 topic from the companyx-com vhost.

  • Discover the topic to subscribe to: Search for the topic that you want to subscribe to on the View Topics page.

  • Request access: Click on the (↓) button in the Credentials > Consume tab next to the topic to request Subscribe access from the topic owner. The button will change to (…) pending state.

  • Wait: Wait for the topic owner to approve the request.

  • Get the credentials: Once the request is approved, the button will change to |↗️|. Click on it to obtain the credentials.

    NOTE: The “routingKey” provided on the Credentials Pop Up, should be used as the Topic Name directly.

  • Subscribe: Configure your tool/iFlow to use these credentials and subscribe to the topic.

Example:

mosquitto_sub -h efpf.smecluster.com -p 8883 -u 'companyx-com:user2@example.org' -P 'replace_this_with_password' -t 'companyx-com/FACTORY_Y/DDATA/FC_8/MOTION_SENSOR_1' --cafile /c/Users/user2/Downloads/cacert-2020-07-22.pem

Detailed instructions:

Details instruction on how to use the Pub Sub Security Service can be found in the full User Guide:

Next