# JMS onMessage not covered as span

**URL:** <https://discuss.elastic.co/t/jms-onmessage-not-covered-as-span/189529>\
**Category:** APM\
**Tags:** java\
**Created:** [July 9, 2019, 11:12am UTC](https://discuss.elastic.co/t/jms-onmessage-not-covered-as-span/189529 "2019-07-09T11:12:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [July 9, 2019, 11:12am UTC](https://discuss.elastic.co/t/jms-onmessage-not-covered-as-span/189529/1 "2019-07-09T11:12:36Z")

</div>

The tracing of jms send works as expeceted. ( The send proceducre is covered by a span)

![image](https://us1.discourse-cdn.com/elastic/original/3X/b/8/b8768a8df62ec2c79af1d9ed5fef9745f96e52aa.png)

But the receive direction ( regradless which approach I tried receive,receivNoWait, MDB or setMessageListener ) is covered only by a transaction. So that the meta information Type,Subtype,Action is not covered. This information is very helpful for dashboarding of the messaging system IMHO.

![image](https://us1.discourse-cdn.com/elastic/original/3X/b/e/be975972d13887fb7521da2f2be375085943525d.png).

---

<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:** [July 9, 2019, 11:50am UTC](https://discuss.elastic.co/t/jms-onmessage-not-covered-as-span/189529/2 "2019-07-09T11:50:37Z")

</div>

Hi again 🙂

The send action is a span without a doubt, however, the receive action would normally qualify as a Transaction (especially when using `MessageListener#onMessage`) and not a span, as it is normally the entry point of traced flow within a service. This may change in the future as we evolve our support for messaging. You can see more in [our data model documentation](https://www.elastic.co/guide/en/apm/get-started/current/apm-data-model.html) what part each of these types play.  
Transactions don't have subtype and action, but the JMS transactions have `messaging` in their `transaction.type` field if that helps...

---

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [July 9, 2019, 1:46pm UTC](https://discuss.elastic.co/t/jms-onmessage-not-covered-as-span/189529/3 "2019-07-09T13:46:14Z")

</div>

> [@Eyal\_Koren](#):
>
> Transactions don't have subtype and action, but the JMS transactions have `messaging` in their `transaction.type` field if that helps...

You'r right. But IMHO in the context of an analysis, it's easier to have a span. So you can divide between incomming an outgoing messages in the same way.

Currenlty i work with labels.

---

<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:** [July 30, 2019, 9:46am UTC](https://discuss.elastic.co/t/jms-onmessage-not-covered-as-span/189529/4 "2019-07-30T09:46:15Z")

</div>

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