iotagent-ul
iotagent-ul copied to clipboard
AMQP detailed documentation
I am trying to use AMQP for IoT Agent-ul, but can't find proper documentation other than config params on the IoT Agent. I need more info about the configuration on AMQP broker (RabbitMQ) such as the exchange, queue, routing keys and service/device provisioning on the Agent side. Also how can we test and check if it works. Can you point me to such info or explain in brief in here.
There is some info in https://github.com/telefonicaid/iotagent-ul/blob/master/docs/usermanual.md#amqp-binding
Some useful commands for publish amqp are:
amqp-publish --url 'amqp://iota:PWD@localhost:5672' -r=".APIKEY.ID_DISP.attrs.ATTRIBUTE" -e=amq.topic -b 33
I have seen the document but was expecting something more detailed.
Is the service/device provisioning similar to that of MQTT except for the "transport" param?
Yes, similar to MQTT provision but with transport AMQP
About the queue, it says
The binding connects the IoT Agent to an exchange (usually amq.topic) and creates two queues (to share between all the instances of the IoTAgents in a cluster environment): one for the incoming measures, and another for command result update messages (named as the measure one, adding the _commands sufix).
Can you explain a bit more about this? In the IOTA config there's only one param for the queue (IOTA_AMQP_QUEUE). I cannot quite understand these 2 queues and how to use them.
If you set IOTA_AMQP_QUEUE to iotaqueue
then two queues iotaqueue
and iotaqueue_commands
are created. Default queue used is iotaqueue
but iotagent commands will use iotaqueue_commands queue.
So
I tested and it worked, but I have a few questions to make sure this is the right scenario for my app:
- Why the messages coming from the devices are not stored in these two queues (iotaqueue and iotaqueue_commands). Is it by design that these queues are only used as "proxy"? This scenario also results in other parties not being able to use the messages (e.g. message monitoring) because they are not stored in the queue.
- I created a new queue for commands (with routing key
.*.*.cmd
) and the devices consume the messages from this queue. Is this the correct scenario?