# The rabbitmq\_naming\_mode configuration is not working when RabbitMQ is used without Spring

**URL:** <https://discuss.elastic.co/t/the-rabbitmq-naming-mode-configuration-is-not-working-when-rabbitmq-is-used-without-spring/359509>\
**Category:** APM\
**Tags:** java\
**Created:** [May 15, 2024, 6:35am UTC](https://discuss.elastic.co/t/the-rabbitmq-naming-mode-configuration-is-not-working-when-rabbitmq-is-used-without-spring/359509 "2024-05-15T06:35:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtopalova](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@dtopalova](https://discuss.elastic.co/u/dtopalova)\
**Post date:** [May 15, 2024, 6:35am UTC](https://discuss.elastic.co/t/the-rabbitmq-naming-mode-configuration-is-not-working-when-rabbitmq-is-used-without-spring/359509/1 "2024-05-15T06:35:35Z")

</div>

**Kibana version** : 8.12.0

**Elasticsearch version** : 8.12.0

**APM Server version** : 8.12.0

**APM Agent language and version** : Java/1.49.0

**Fresh install or upgraded from other version?** Upgraded from 1.45.0

**Is there anything special in your setup?** Nothing specific

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

Hi team,

We encountered an issue, or rather a limitation, with the feature for the RabbitMQ plugin that allows changing the name of the transactions to use the Queues' names instead of the Exchange names. We're using RabbitMQ Java Client, version 5.19.0, without Spring framework. We tried to set the [configuration](https://www.elastic.co/guide/en/apm/agent/java/current/config-messaging.html#config-rabbitmq-naming-mode) following the documentation but without success, there is no change in the behavior with and without the config:

```auto
rabbitmq_naming_mode=QUEUE

```

After some investigation, we found out that this configuration is enabled only for the [spring-rabbit-plugin](https://github.com/elastic/apm-agent-java/pull/3424), which is not mentioned in the documentation though.  
We would like to ask, if there is an option to make this configuration available with all the RabbitMQ plugins, not only for Spring ones? This feature is really important to us because with the current implementation (with the exchange names) we can't trace our application properly and the transactions that we get are not useful at all.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Jonas\_Kunz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_kunz/32/110740_2.png) [@Jonas\_Kunz](https://discuss.elastic.co/u/Jonas_Kunz)\
**Post date:** [May 15, 2024, 10:50am UTC](https://discuss.elastic.co/t/the-rabbitmq-naming-mode-configuration-is-not-working-when-rabbitmq-is-used-without-spring/359509/2 "2024-05-15T10:50:28Z")

</div>

> After some investigation, we found out that this configuration is enabled only for the [spring-rabbit-plugin](https://github.com/elastic/apm-agent-java/pull/3424), which is not mentioned in the documentation though.

Thanks for pointing this out, this indeed seems to be an oversight.

I had a look, it seems like it is not really possible to implement this naming mode for the plain RabbitMQ client: IINM the queue name is not accessible from the [Consumer](https://javadoc.io/doc/com.rabbitmq/amqp-client/latest/index.html).

However, the routing key is accessible. Would that also help you?  
We have an [open issue](https://github.com/elastic/apm-agent-java/issues/3415) for supporting naming based on the routing key.  
Unfortunately we currently don't have the resources to prioritize this, though contributions would be welcome.

I'll clarify the docs that queue naming mode only works when using the spring rabbitmq client.

---

<div class="post-metadata">

**Author:** ![dtopalova](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@dtopalova](https://discuss.elastic.co/u/dtopalova)\
**Post date:** [May 20, 2024, 8:15am UTC](https://discuss.elastic.co/t/the-rabbitmq-naming-mode-configuration-is-not-working-when-rabbitmq-is-used-without-spring/359509/3 "2024-05-20T08:15:07Z")

</div>

Hi Jonas,

Thanks for chiming in! I opened a [pull request](https://github.com/elastic/apm-agent-java/pull/3636) in which I'm adding ROUTING\_KEY as an option to the `rabbitmq_naming_mode` configuration. Can you take a look when you have time?  
Thank you!

---

<div class="post-metadata">

**Author:** ![dtopalova](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@dtopalova](https://discuss.elastic.co/u/dtopalova)\
**Post date:** [July 9, 2024, 8:36am UTC](https://discuss.elastic.co/t/the-rabbitmq-naming-mode-configuration-is-not-working-when-rabbitmq-is-used-without-spring/359509/4 "2024-07-09T08:36:47Z")

</div>

@Jonas_Kunz Hey Jonas, when could we expect to have this feature officially available? Are you planning to make a new release containing this functionality soon?

Thanks!

---

<div class="post-metadata">

**Author:** ![Jonas\_Kunz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_kunz/32/110740_2.png) [@Jonas\_Kunz](https://discuss.elastic.co/u/Jonas_Kunz)\
**Post date:** [July 9, 2024, 12:37pm UTC](https://discuss.elastic.co/t/the-rabbitmq-naming-mode-configuration-is-not-working-when-rabbitmq-is-used-without-spring/359509/5 "2024-07-09T12:37:39Z")

</div>

We'll provide a new release soon, probably next week.
