# Support for asynchronous message communication with Spring Cloud Stream on RabbitMQ

**URL:** <https://discuss.elastic.co/t/support-for-asynchronous-message-communication-with-spring-cloud-stream-on-rabbitmq/218175>\
**Category:** APM\
**Tags:** java\
**Created:** [February 6, 2020, 12:59pm UTC](https://discuss.elastic.co/t/support-for-asynchronous-message-communication-with-spring-cloud-stream-on-rabbitmq/218175 "2020-02-06T12:59:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DannyT](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@DannyT](https://discuss.elastic.co/u/DannyT)\
**Post date:** [February 6, 2020, 12:59pm UTC](https://discuss.elastic.co/t/support-for-asynchronous-message-communication-with-spring-cloud-stream-on-rabbitmq/218175/1 "2020-02-06T12:59:30Z")

</div>

Hi everyone,  
according to [Does Elastic APM support Spring Cloud Stream?](https://discuss.elastic.co/t/does-elastic-apm-support-spring-cloud-stream/173620) the current Java Agent (elastic-apm-agent-1.12.0.jar and Elastic 7.5.1) does not support creation of transactions and spans from asynchronous message communication .

We have a Spring Boot microservice landscape where almost everything communicates with Spring Cloud Stream on RabbitMQ. This means, that transactions are only visible at the Rest Endpoint service right now, and all other invoked services are not shown in APM.

Since I read at [Setup APM distributed tracing to work with kafka and multiple node services](https://discuss.elastic.co/t/setup-apm-distributed-tracing-to-work-with-kafka-and-multiple-node-services/216716) that you are working on integrating Kafka, what about RabbitMQ and Spring Cloud Stream ? Is it already implemented?  
If not, do you know of any attempts to integrate Spring Cloud Stream in the Java Agent?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [February 6, 2020, 2:11pm UTC](https://discuss.elastic.co/t/support-for-asynchronous-message-communication-with-spring-cloud-stream-on-rabbitmq/218175/2 "2020-02-06T14:11:37Z")

</div>

The Kafka integration is almost done but we have not started with Rabbit MQ yet. It's on the roadmap, but we don't have a date for it yet.

You could use our API to manually create transactions and spans for RabbitMQ: [https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html)

---

<div class="post-metadata">

**Author:** ![DannyT](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@DannyT](https://discuss.elastic.co/u/DannyT)\
**Post date:** [February 6, 2020, 2:35pm UTC](https://discuss.elastic.co/t/support-for-asynchronous-message-communication-with-spring-cloud-stream-on-rabbitmq/218175/3 "2020-02-06T14:35:34Z")

</div>

Can you show, where the Kafka integration was implemented ? Maybe it is possible for us to adapt that quick&dirty to RabbitMQ .

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [February 6, 2020, 3:10pm UTC](https://discuss.elastic.co/t/support-for-asynchronous-message-communication-with-spring-cloud-stream-on-rabbitmq/218175/4 "2020-02-06T15:10:02Z")

</div>

Here's the implementation for Kafka: [https://github.com/elastic/apm-agent-java/tree/master/apm-agent-plugins/apm-kafka-plugin](https://github.com/elastic/apm-agent-java/tree/master/apm-agent-plugins/apm-kafka-plugin)

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [February 10, 2020, 5:51am UTC](https://discuss.elastic.co/t/support-for-asynchronous-message-communication-with-spring-cloud-stream-on-rabbitmq/218175/5 "2020-02-10T05:51:41Z")

</div>

@DannyT if you are relying on the Kafka plugin, be aware that the internal APIs we use to compute the outgoing trace context header and create a transaction based on it in the consumer side are about to change.  
In addition, it uses binary headers, as this is what expected in Kafka. If you need to send text headers, you can use out API, as described in [this topic](https://discuss.elastic.co/t/how-to-use-injecttraceheaders/189451) for example.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 2, 2020, 1:51am UTC](https://discuss.elastic.co/t/support-for-asynchronous-message-communication-with-spring-cloud-stream-on-rabbitmq/218175/6 "2020-03-02T01:51:48Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
