# Install Send Messages to a Queue

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.

---

## Getting the integration

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

1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/) > **Marketplace**.
2. On the Marketplace homepage, select the integration's card.
3. Once the integration's page opens, click the **Install** button.

A successful message appears to confirm your integration is installed.

:::tip
You can search any integration by browsing through the cards, using the filters, or typing a keyword in the search bar.
:::

---

## Configuring the integration

Being an [Application function](/en/documentation/products/marketplace/integrations/#edge-application-functions), **Send messages to a queue** runs on the edge *employing* an existing application.

:::tip
Go to the [building section](/en/documentation/products/guides/build/build-an-application/) for more details on how to build an application.
:::

Follow the next steps to instantiate the integration:

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

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

:::caution[warning]
If a product or module is activated, it could generate usage-related costs. Check the [pricing page](/en/documentation/products/pricing/) for more information.
:::

---

## Instantiating the integration

Still in the **Application** page, follow these steps:

1. Select the **Functions Instances** tab.
2. Click the **+ Function Instance** button.
3. On the 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 **Arguments** tab.

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 **Arguments** box and different credentials, as in the following examples:

### AMQP:

```json
{
  "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"
  }
}
```

### SQS

```json
{
  "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"
  }
}
```

### Kafka-REST

```json
{
  "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.

:::note
It isn't possible to integrate Kafka "as is" because the Kafka clients available for JavaScript (Kafka JS and Kafka Node) use Node.js features that are incompatible with **Azion Cells**. However, you have the option to integrate it using Kafka-REST, a module that provides an HTTP RESTful interface to a Kafka cluster.
:::

5. Click the **Save** button.

---

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

---