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 Field | Description |
|---|---|
| Name | Name of the connection. |
| Hostname | Host name and port of your AMQP server, for example amqp.example.com:5672 with TCP or amqp.example.com:5671 with SSL. |
| Published topic pattern | Pattern of the topic of the uplinks, for example amqp.things.{DevEUI}.uplink. See Topic Pattern Expression. |
| Subscribed topic pattern | Pattern of the topic of the downlinks, for example amqp.things.{DevEUI}.downlink. |
| Protocol | SSL or TCP. The form changes depending on the protocol selected. |
| Certificate | Client certificate file used to connect to your AMQP server. Only with SSL. |
| Private Key | Client private key file used to connect to your AMQP server. Only with SSL. |
| AMQP Username | Username to access your AMQP server. |
| AMQP Password | Password to access your AMQP server. |
| Exchange Name | Name of the exchange, for example amq.topic. |
| Description | Optional description of the connection. |
Creating a Connection With UI
-
In ThingPark Enterprise, click Connections -> + Add Connection -> ThingPark X IoT Flow.

-
In ThingPark X IoT Flow, click AMQP in the list of connectors.

-
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.

- Name: a clear name for the connection, for example
-
Click Create. A notification confirms that the connection has been created, and the connection details open.
-
In the connection details, check that the connection is OPENED (see Connection States).
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.
-
Click the Edit button next to the setting to change.
-
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 /connectionsto create a new Connection instancePUT /connectionsto update a Connection instanceDELETE /connectionsto delete a Connection instance
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 Field | Description |
|---|---|
connectorId | Must be set to actility-amqp-0.9.1-iot. |
configuration/uplinkTopicPattern | Defines a pattern of topic for the Uplink. Check Topic Pattern Expression for examples. |
configuration/downlinkTopicPattern | Defines a pattern of topic for the Downlink. Check Topic Pattern Expression for examples. |
configuration/hostName | The Hostname and Port of your AMQP server. Example: amqp.example.com:5672. |
configuration/protocol | Protocol to be used for your connection to the AMQP server. Can be set to TCP or SSL. |
configuration/username and configuration/password | Credentials to access your AMQP server. |
configuration/certificate | The client certificate file used to connect to your AMQP server. Only needed if protocol is set to SSL. |
configuration/privateKey | The client private key file used to connect to your AMQP server. Only needed if protocol is set to SSL. |
configuration/exchangeName | The exchange name, for example amq.topic. |
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:
-
Open the RabbitMQ management UI and click the Connections section.

-
Select your connection in the list.

-
Check the details and the status of your connection.

Limitations
There are currently no known limitations to the AMQP connector.
Troubleshooting
There is no known issue.