Skip to content

Basic JMS Support#650

Merged
eyalkoren merged 14 commits intoelastic:masterfrom
eyalkoren:jms-support
Jun 11, 2019
Merged

Basic JMS Support#650
eyalkoren merged 14 commits intoelastic:masterfrom
eyalkoren:jms-support

Conversation

@eyalkoren
Copy link
Copy Markdown
Contributor

@eyalkoren eyalkoren commented May 30, 2019

Closes #466

Supports:
JMS 1.1 and 2, APIs: send, receive, receiveNoWait, onMessage.

Testing:
ActiveMQ (JMS 1.1), wrapped by a connection-pooling client and ActiveMQ Artemis (JMS 2) - the successor of HornetQ).

Implementation details:
MessageProducer#send traced and used for context propagation through Message String property. Since JMS 2 is an extension of JMS 1.1This is assumed to be enough to support JMSProducer#send (JMS 2 API) as it likely one makes use of the other (tested with one library).
JMSConsumer#receive, JMSConsumer#receivereceiveNoWait and MessageListener#onMessage are traced for receiver side, reading the context from the message property and using it for distributed tracing.

Assumptions and decisions made:

  • receive API tracing can result either in a Transaction (if occurs on a non-traced thread) or a Span. If the latter, distributed tracing context will be ignored and span will remain child of its original parent.
  • Until we have a dedicated filed in schema for that, destination (queue/topic) name will be part of the span/transaction name
  • onMessage always results in a transaction. The assumption is that it is never expected to be executed on an already traced thread.

Not within the scope of this PR:

@eyalkoren eyalkoren self-assigned this May 30, 2019
@eyalkoren eyalkoren requested a review from felixbarny May 30, 2019 14:42
Copy link
Copy Markdown
Member

@felixbarny felixbarny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good form a first look!

It would be great to follow up with an elastic/apm issue about changes in the intake API (queue/topic name) etc. But that can come in after merging this PR.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 1, 2019

Codecov Report

Merging #650 into master will decrease coverage by 4.62%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #650      +/-   ##
===========================================
- Coverage     66.73%   62.1%   -4.63%     
  Complexity       68      68              
===========================================
  Files           196     199       +3     
  Lines          8802    7711    -1091     
  Branches       1209     945     -264     
===========================================
- Hits           5874    4789    -1085     
- Misses         2609    2625      +16     
+ Partials        319     297      -22
Impacted Files Coverage Δ Complexity Δ
...lastic/apm/agent/jms/JmsInstrumentationHelper.java 0% <0%> (ø) 0 <0> (?)
...m/agent/jms/JmsMessageConsumerInstrumentation.java 0% <0%> (ø) 0 <0> (?)
...ic/apm/agent/jms/JmsInstrumentationHelperImpl.java 0% <0%> (ø) 0 <0> (?)
...m/agent/jms/JmsMessageListenerInstrumentation.java 0% <0%> (ø) 0 <0> (?)
...m/agent/jms/JmsMessageProducerInstrumentation.java 0% <0%> (ø) 0 <0> (?)
.../elastic/apm/agent/jms/BaseJmsInstrumentation.java 0% <0%> (ø) 0 <0> (?)
...a/co/elastic/apm/agent/metrics/MetricRegistry.java 85.71% <0%> (-8.99%) 0% <0%> (ø)
.../apm/agent/report/serialize/DslJsonSerializer.java 83.23% <0%> (-6.47%) 0% <0%> (ø)
...astic/apm/agent/impl/transaction/AbstractSpan.java 75.67% <0%> (-5.91%) 0% <0%> (ø)
...co/elastic/apm/agent/report/ApmServerReporter.java 57.84% <0%> (-5.86%) 0% <0%> (ø)
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8d4ee1...595e831. Read the comment docs.

@eyalkoren
Copy link
Copy Markdown
Contributor Author

Jenkins test this please

@eyalkoren eyalkoren merged commit 0b31979 into elastic:master Jun 11, 2019
@eyalkoren eyalkoren deleted the jms-support branch June 11, 2019 10:27
@eyalkoren eyalkoren mentioned this pull request Jun 12, 2019
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support basic JMS scenarios

5 participants