Skip to main content
Version: 1.8.5

CREATING AN AMQP CONNECTION

The AMQP connector publishes the uplinks of your devices to your AMQP 0.9.1 server, for example RabbitMQ, and subscribes to it to receive the downlinks that your application publishes there.

The data follows this path: LoRaWAN® device → ThingPark Enterprise → ThingPark X IoT Flow connection → your AMQP server → your application.

Before you create the connection, you must have deployed an AMQP server, and know its credentials and the exchange to use.

Collecting Expected Information​

Parameters required

UI FieldDescription
NameName of the connection.
HostnameHost name and port of your AMQP server, for example amqp.example.com:5672 with TCP or amqp.example.com:5671 with SSL.
Published topic patternPattern of the topic of the uplinks, for example amqp.things.{DevEUI}.uplink. See Topic Pattern Expression.
Subscribed topic patternPattern of the topic of the downlinks, for example amqp.things.{DevEUI}.downlink.
ProtocolSSL or TCP. The form changes depending on the protocol selected.
CertificateClient certificate file used to connect to your AMQP server. Only with SSL.
Private KeyClient private key file used to connect to your AMQP server. Only with SSL.
AMQP UsernameUsername to access your AMQP server.
AMQP PasswordPassword to access your AMQP server.
Exchange NameName of the exchange, for example amq.topic.
DescriptionOptional description of the connection.

Creating a Connection With UI​

  1. In ThingPark Enterprise, click Connections -> + Add Connection -> ThingPark X IoT Flow. Add a ThingPark X IoT Flow connection in ThingPark Enterprise

  2. In ThingPark X IoT Flow, click AMQP in the list of connectors. Select the AMQP connector

  3. Fill in the form:

    • Name: a clear name for the connection, for example My AMQP Connection.
    • Hostname: the host name and port of your AMQP server.
    • Published topic pattern: the topic pattern of the uplinks.
    • Subscribed topic pattern: the topic pattern of the downlinks.
    • Protocol: SSL or TCP. The form changes depending on the protocol selected.
    • Certificate: with SSL, the client certificate file used to connect to your AMQP server.
    • Private Key: with SSL, the client private key file used to connect to your AMQP server.
    • AMQP Username: the username to access your AMQP server.
    • AMQP Password: the password to access your AMQP server.
    • Exchange Name: the name of the exchange.
    • Description: optional. Set your AMQP connection
  4. Click Create. A notification confirms that the connection has been created, and the connection details open.

  5. In the connection details, check that the connection is OPENED (see Connection States).

Note

Parameters marked with * are mandatory.

Changing the Settings After Creation​

In the connection details, the settings sections show the settings of the connection, such as the username or the password.

  1. Click the Edit button next to the setting to change.

  2. Enter the new value and click the Confirm button, then confirm the update.

A notification confirms that the setting is updated.

Creating a Connection With API​

The creation of a connection establishes a bidirectional messaging transport link between ThingPark X IoT Flow and your AMQP server. Events and commands from multiple Devices will be multiplexed over this messaging transport link.

To do this, you need to use the Connections group resource:

  • POST /connections to create a new Connection instance
  • PUT /connections to update a Connection instance
  • DELETE /connections to delete a Connection instance
Note

We follow the REST-full API pattern, when updating configuration properties for a connection resource. Thus, you must also provide the whole configuration again.

Example for creation of a new connection instance:

  • AMQP connection with TCP
POST /connections
{
"connectorId": "actility-amqp-0.9.1-iot",
"name": "Actility AMQP (TCP) Connection",
"configuration": {
"uplinkTopicPattern": "amqp.things.{DevEUI}.uplink",
"downlinkTopicPattern": "amqp.things.{DevEUI}.downlink",
"hostName": "amqp.example.com:5672",
"protocol": "TCP",
"username": "mycompany",
"password": "{YOUR-AMQP-PASSWORD}",
"exchangeName": "IotFlowExchange"
}
}
  • AMQP connection with SSL
POST /connections
{
"connectorId": "actility-amqp-0.9.1-iot",
"name": "Actility AMQP (SSL) Connection",
"configuration": {
"uplinkTopicPattern": "amqp.things.{DevEUI}.uplink",
"downlinkTopicPattern": "amqp.things.{DevEUI}.downlink",
"hostName": "amqp.example.com:5671",
"protocol": "SSL",
"username": "mycompany",
"password": "{YOUR-AMQP-PASSWORD}",
"certificate": "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----",
"privateKey": "-----BEGIN RSA PRIVATE KEY-----...-----END RSA PRIVATE KEY-----",
"exchangeName": "IotFlowExchange"
}
}

The following table lists the properties applicable to a connection instance.

JSON FieldDescription
connectorIdMust be set to actility-amqp-0.9.1-iot.
configuration/uplinkTopicPatternDefines a pattern of topic for the Uplink. Check Topic Pattern Expression for examples.
configuration/downlinkTopicPatternDefines a pattern of topic for the Downlink. Check Topic Pattern Expression for examples.
configuration/hostNameThe Hostname and Port of your AMQP server. Example: amqp.example.com:5672.
configuration/protocolProtocol to be used for your connection to the AMQP server. Can be set to TCP or SSL.
configuration/username and configuration/passwordCredentials to access your AMQP server.
configuration/certificateThe client certificate file used to connect to your AMQP server. Only needed if protocol is set to SSL.
configuration/privateKeyThe client private key file used to connect to your AMQP server. Only needed if protocol is set to SSL.
configuration/exchangeNameThe exchange name, for example amq.topic.
Important note

All properties are not present in this example. You can check the rest of these properties in the common parameters section.

Displaying Information to Know if It Worked​

With a RabbitMQ server:

  1. Open the RabbitMQ management UI and click the Connections section. Connections section of RabbitMQ

  2. Select your connection in the list. List of the RabbitMQ connections

  3. Check the details and the status of your connection. Details of a RabbitMQ connection

Limitations​

There are currently no known limitations to the AMQP connector.

Troubleshooting​

There is no known issue.