---
title: Use RabbitMQ or JMS for message queues
source: https://docs.newrelic.com/docs/apm/agents/java-agent/instrumentation/use-rabbitmq-or-jms-message-queues
---

Our Java agent version 3.9.0 or higher supports both the [Java Message Service (JMS) 1.1 API](https://docs.oracle.com/javaee/7/api/javax/jms/package-summary.html#package.description) and the [RabbitMQ Java client library](https://www.rabbitmq.com/java-client.html). This gives you insights into the performance of your message processing, for both incoming and outgoing messages.

The APM UI will show transactions initiated via JMS 1.1 or RabbitMQ message receipt as **Message** background tasks. Message creation via JMS or RabbitMQ also appears in transaction traces.

## Requirements [#installation]

To monitor your RabbitMQ client activity, make sure you have downloaded and installed [Java agent version 3.9.0 or higher](https://docs.newrelic.com/docs/release-notes/agent-release-notes/java-release-notes) of New Relic.

To monitor JMS, make sure you have downloaded and installed [Java agent version 3.3.1 or higher](https://docs.newrelic.com/docs/release-notes/agent-release-notes/java-release-notes/java-agent-331) of New Relic.

> #### 💡 TIP
>
> For more in-depth RabbitMQ monitoring, we recommend [our RabbitMQ on-host integration](https://docs.newrelic.com/docs/infrastructure/host-integrations/host-integrations-list/rabbitmq-monitoring-integration).

## Performance improvements with background tasks [#background]

One way to increase responsiveness of web applications is to delegate work to background processes. Message queues are commonly used for this inter-process communication.

In the context of message queuing systems, applications typically interact with message brokers to send and receive messages. The RabbitMQ Java client library allows Java applications to interface with message brokers that implement the Advanced Message Queueing Protocol (AMQP) 0.9.

The Java agent of New Relic shows messages sent and received using the RabbitMQ client library and JMS. With this visibility, you can see details including:

-   Number of messages handled by your app
-   Time your app spends publishing messages
-   Time your app spends processing "dequeued" messages

[APM's](#view-queue) conveniently group and report operations that interact with temporary queues. By analyzing this information, you can more easily identify areas where processes take too much time and may be handled better as background messages.

## Queue operations [#queue-ops]

Supported entry points for queue operations appear as `Put` (publish a message) or `Take` (receive a message) in APM's user interface.

| **Queue operations** | **Publish a message (`Put` in UI)** | **Receive a message (`Take` in UI)**             |
| -------------------- | ----------------------------------- | ------------------------------------------------ |
| RabbitMQ             | `basicPublish`                      | `basicGet`, `nextDelivery`, and `handleDelivery` |
| JMS                  | `send`                              | `receive`, `receiveNoWait`, and `onMessage`      |

## View message queue operations [#view-queue]

Queue operations appear in APM's [**Transactions** page](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/transactions-dashboard) for the selected app. The `Put` and `Take` metrics appear in the **Breakdown table** and are categorized as `MessageBroker` metrics. [Transaction traces](https://docs.newrelic.com/docs/apm/transactions/transaction-traces/transaction-traces) may provide additional details.

![Breakdown table inside the transaction details page](https://docs.newrelic.com/images/apm_screenshot-crop_breakdown-table.webp "Breakdown table inside the transaction details page")

Go to **[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > APM & services** and click your app. Under the **Monitor** section, click **Transaction**, select a transaction to see the breakdown table.

Other places RabbitMQ information may appear:

-   The [**Transaction trace summary** page](https://docs.newrelic.com/docs/apm/transactions/transaction-traces/transaction-traces-trace-details-page) may show `Put` and `Take` operations in the **Slowest components** section.
-   The **Transaction trace** page may include a dedicated **Messages** tab.
