Export data to Message Queue

更新时间:
复制 MD 格式

Alibaba Cloud Link WAN lets you export data to Alibaba Cloud Message Queue (MQ). This topic describes how to configure data forwarding to MQ from Alibaba Cloud Link WAN.

Configure data export

  1. Log on to the Alibaba Cloud Link WAN console.
  2. In the left navigation pane, select Node Management > Node Group, and click Data Forwarding in the Actions column for the target node group.
  3. In the Data Forwarding Settings dialog box, configure data forwarding as shown in the following figure.

    After the configuration is complete, subscribe to a topic in MQ to receive uplink data. For more information, see Message Queue for Apache RocketMQ.

    Newer versions of Link WAN no longer support sending downlink data through topics. This feature is available only to users of earlier versions. Instead, use API operations to send downlink data because this method provides more response information from the core network. For more information, see SendUnicastCommand.

    Note To accelerate your development, you can obtain the SDK with encapsulated API operations from the Java SDK usage guide.

    The data is exported in JSON format. The content is as follows:

    Field Type Description
    data string Uplink data message. A hexadecimal string.
    fport int Service port number.
    snr double Uplink signal-to-noise ratio (SNR).
    rssi int Uplink signal strength.
    joinEui string Application identifier.
    devAddr string Device address.
    devEui string Device identifier.
    gwEui string Gateway ID.
    time long Timestamp in milliseconds.
    datr string Spreading factor.
    mtype int Message type:
    • 0: join
    • 2: unconfirmed up
    • 4: confirmed up
    fcnt long Uplink frame count.

    The following code provides an example:

    {
        "data": "aa1fc800003710ff0005d769ffff00014100ffffffffffffffffffffffffff5b",
        "datr": "SF12BW125",
        "devAddr": "xxxx",
        "devEui": "xxxxxx",
        "fcnt": 1123,
        "fport": 99,
        "gwEui": "xxxxxx",
        "joinEui": "xxxxxxx",
        "mtype": 2,
        "rssi": -106,
        "snr": -17.0,
        "time": 1541412741702
    }                   

Downlink data from MQ

Note This feature is deprecated. We recommend that you switch to the new method as soon as possible.
Field Type Description
data string Downlink service message. A hexadecimal string.
fport int Downlink service port number.
devEui string Device number.
confirmed bool Specifies whether a response from the terminal is required.
maxRetries int The number of retries. This does not include the initial transmission.

The following code provides an example:

{
    "data": "aa1fc800003710ff0005d769ffff00014100ffffffffffffffffffffffffff5b",
    "devEui": "xxxx",
    "fport": 99,
    "confirmed": true,
    "maxRetries": 0
}