Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMQP detailed documentation #348

Open
letavia opened this issue Apr 11, 2019 · 6 comments
Open

AMQP detailed documentation #348

letavia opened this issue Apr 11, 2019 · 6 comments

Comments

@letavia
Copy link

letavia commented Apr 11, 2019

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.

@AlvaroVega
Copy link
Member

AlvaroVega commented Apr 12, 2019

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

@letavia
Copy link
Author

letavia commented Apr 12, 2019

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?

@AlvaroVega
Copy link
Member

Yes, similar to MQTT provision but with transport AMQP

@letavia
Copy link
Author

letavia commented Apr 12, 2019

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.

@AlvaroVega
Copy link
Member

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.

@letavia
Copy link
Author

letavia commented May 6, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants