How to install the Send messages to a queue integration through Azion Marketplace

Sending messages to a queue refers to the process of adding messages to a message queue, which is a data structure that stores messages in “first-in-first-out” (FIFO) order. Messages are added to the back of the queue and removed from the front. Messages can be sent asynchronously and processed by the receiving component later, allowing for easy communication between different parts of a system.


To use the Send messages to a queue integration provided by Azion Marketplace:

  1. Access Real-Time Manager (RTM) > Marketplace.
  2. On the Marketplace homepage, select the integration’s card.
  3. Once the integration’s page opens, click the Get It Now button, at the bottom-right corner of the page.

A successful message appears to confirm your integration is installed.


Being an Edge Application function, Send messages to a queue runs on the edge employing an existing edge application.

Follow the next steps to instantiate the integration:

  1. On the upper-left corner, select Products menu > Edge Application on the BUILD section.
  2. On the listing page of your edge applications, select the one you want to use with the integration.
  3. On the application page, open the Main Settings tab.
  4. Enable the Edge Functions switch to activate this module.
  5. Click the Save button.

A successful message appears informing that the edge application has been updated.


Still in the Edge Application page, follow these steps:

  1. Select the Functions tab.
  2. Click the Add Function button.
  3. On the Edge Function’s name text box, type an easy-to-remember name.
  4. On the dropdown function menu, select the Send messages to a queue function.

This action will load the function, showing a form with the source code of the function and, just above it, two tabs: Code and Args. By clicking the Code tab, you’ll be able to navigate through the code but won’t be able to change it.

You can configure three messaging services for this integration: RabbitMQ, Amazon SQS, and Kafka-REST. You can configure it in advance beforehand. For each one of these integrations, you’ll have a different Args box and different credentials, as in the following examples:

{
"server_type": "amqp",
"connection_url": "https://my-service.azion.com/queue",
"connection_authorization": "Basic my_basic_auth",
"connection_args: {
"routing_key: "my_queue",
"payload: "my_custom_payload"
}
}
{
"server_type": "sqs",
"connection_url": "https://my-service.azion.com/sqs-queue",
"connection_authorization": "Basic my_basic_auth",
"connection_args: {
"auth_params: "my_aditional_auth_params",
"version": "2012-11-05",
"expires": "Wed, 21 Oct 2015 07:28:00 GMT"
}
}
{
"server_type": "kafka-rest",
"connection_url": "https://my-service.azion.com/topics/my-topic",
"connection_args: {
"payload": "my_custom_payload"
}
}

Where:

  • server_type: defines the connection type used (amqp, sqs, and kafka-rest are the three possible values).
  • connection_url: defines the server URL of the service you choose.
  • connection_authorization: defines the type of authorization needed for the connection. This is an optional field.

You can also set extra parameters to your queue, passing them in the connection_args section. Each supported service has different extra parameters to use. It’s optional to inform these to push your function to the edge.

To end the process, click the Save button. Now your function is configured.


Configuring a rule on Rules Engine

Section titled Configuring a rule on Rules Engine

Now you have to configure the rules you want (criteria and behavior) to apply to run your function.

Still in the Edge Application page, follow these steps:

  1. Select the Rules Engine tab.
  2. Click on Default Rule.
    • You can’t change the criteria field for the Default Rule on Rules Engine.
  3. On the behavior field, select Run Function from the dropdown menu.
  4. Select the Send messages to a queue function, according to the name you gave it in the instantiation step.
  5. Click the Save button.

Done. Now you have your integration running on the edge.


Contributors