Updated on 2024-07-17 GMT+08:00

Configuring MQS for Device Data Forwarding

Overview

ROMA Connect does not directly store data reported by devices. You must configure data forwarding rules to forward device data to other services for storage. In this practice, device data is forwarded to ROMA Connect's MQS for integration.

Procedure

  1. Create a message topic for storing device data.
    1. In the navigation pane on the left, choose Message Queue Service > Topic Management. On the page displayed, click Create Topic in the upper right corner.
    2. In the Create Topic dialog box, set topic parameters and click OK.
      Table 1 Topic configuration

      Parameter

      Description

      Topic Name

      Enter the topic name, which is user-defined.

      Integration Application

      Select the integration application created in Registering a Device on ROMA Connect.

      Permission

      Select the topic permission for the integration application to which the topic belongs. In this example, select Publish/Subscribe, which indicates that the topic can be used to produce and consume messages.

      Partitions

      The appropriate number of partitions can improve the concurrent performance of message creation and retrieval.

      Replicas

      ROMA Connect automatically backs up data on each replica. If one replica is faulty, data will still be available. The reliability increases with the number of replicas of a topic.

      Aging Time (h)

      After the aging time expires, messages stored in the topic are deleted.

      Synchronous Replication

      Whether to copy messages to all replicas before returning responses to the message client when the client produces messages to the topic. This parameter is not enabled here.

      Synchronous Flushing

      Whether to write each message produced by the message client to the topic to the disk immediately. This parameter is not enabled here.

      Tag

      A tag can be added for a topic to facilitate topic search.

      Sensitive Word

      Enter values to filter out topic messages containing these values. In this practice, sensitive fields are not required.

      Description

      Enter a brief description of the topic.

  2. Configure data forwarding rules.
    1. In the navigation pane on the left, choose LINK > Rule Engine. On the page displayed, click Create Rule in the upper right corner.
    2. In the Create Rule dialog box, set rule parameters and click OK.
      Table 2 Rule configuration

      Parameter

      Description

      Integration application

      Select the integration application created in Registering a Device on ROMA Connect.

      Rule Name

      Enter the rule name, which is user-defined.

      Description

      Enter a brief description of the rule.

      Status

      This parameter specifies whether to enable the rule. Retain the default value Enabled.

    3. In the rule list, click the name of the rule created in 2.b to access the rule details page.
    4. In the Source area, click Create Source, set related parameters, and click Save.
      Table 3 Source configuration

      Parameter

      Description

      Product Name

      Select the product created in Registering a Device on ROMA Connect.

      Device Name

      Select All devices.

      Topic Name

      Select the topic used by the device to send messages. The format is {Product ID}/out/+.

      Topic Level

      Select a topic level. The value is automatically adapted based on the value of Device Name. If you do not specify Device Name, Topic Level is Product-level. If you select a specific device from the Device Name drop-down list box, Topic Level is Device-level.

      Base64 Encoding

      This parameter specifies whether Base64 encoding is performed on the forwarded device data. This function is disabled here.

      Include Device Data

      Specifies whether the forwarded data includes device data. To facilitate subsequent identification of the device to which the forwarded data belongs, enable this option.

    5. In the Destination area, click Create Destination, set related parameters and click Save.
      Table 4 Destination configuration

      Parameter

      Description

      Destination

      In this practice, data is forwarded to the MQS of ROMA Connect. Therefore, select ROMA MQS.

      Connection Address

      Select the MQS intranet address of the current ROMA Connect instance. You can view the address on the Instance Information page of the ROMA Connect console.

      Topic Name

      Select the message topic created in 1.

      Username

      This parameter is mandatory only if MQS SASL_SSL is enabled for the ROMA Connect instance.

      Enter the key of the integration application to which the topic defined in Topic Name belongs.

      Password

      This parameter is mandatory only if MQS SASL_SSL is enabled for the ROMA Connect instance.

      Enter the secret of the integration application to which the topic defined in Topic Name belongs.