{"id":21153045,"url":"https://github.com/opentracing-contrib/java-jms","last_synced_at":"2025-07-04T16:06:28.038Z","repository":{"id":57735969,"uuid":"87761270","full_name":"opentracing-contrib/java-jms","owner":"opentracing-contrib","description":"OpenTracing Instrumentation for JMS API","archived":false,"fork":false,"pushed_at":"2024-02-02T22:59:24.000Z","size":332,"stargazers_count":4,"open_issues_count":5,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T22:11:31.380Z","etag":null,"topics":["java","jms","opentracing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opentracing-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-10T03:11:43.000Z","updated_at":"2024-02-20T16:00:49.000Z","dependencies_parsed_at":"2024-11-20T11:23:24.852Z","dependency_job_id":"3a78d25c-7f4d-4f67-bc4d-c1469cac5ecb","html_url":"https://github.com/opentracing-contrib/java-jms","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/opentracing-contrib/java-jms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing-contrib%2Fjava-jms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing-contrib%2Fjava-jms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing-contrib%2Fjava-jms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing-contrib%2Fjava-jms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentracing-contrib","download_url":"https://codeload.github.com/opentracing-contrib/java-jms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing-contrib%2Fjava-jms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263572947,"owners_count":23482552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","jms","opentracing"],"created_at":"2024-11-20T10:48:16.653Z","updated_at":"2025-07-04T16:06:27.983Z","avatar_url":"https://github.com/opentracing-contrib.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![Released Version][maven-img]][maven] [![Apache-2.0 license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n# OpenTracing JMS Instrumentation\nOpenTracing instrumentation for JMS.\n\n## Installation\n\n### JMS 1\npom.xml\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.opentracing.contrib\u003c/groupId\u003e\n    \u003cartifactId\u003eopentracing-jms-1\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### JMS 2\npom.xml\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.opentracing.contrib\u003c/groupId\u003e\n    \u003cartifactId\u003eopentracing-jms-2\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Spring JMS\npom.xml\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.opentracing.contrib\u003c/groupId\u003e\n    \u003cartifactId\u003eopentracing-jms-spring\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n\u003c/dependency\u003e\n```\nYou most likely need to exclude spring-jms and spring-context dependencies and add own (to avoid jar hell):\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.opentracing.contrib\u003c/groupId\u003e\n    \u003cartifactId\u003eopentracing-jms-spring\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n    \u003cexclusions\u003e\n        \u003cexclusion\u003e\n            \u003cgroupId\u003eorg.springframework\u003c/groupId\u003e\n            \u003cartifactId\u003espring-jms\u003c/artifactId\u003e\n        \u003c/exclusion\u003e\n        \u003cexclusion\u003e\n             \u003cgroupId\u003eorg.springframework\u003c/groupId\u003e\n             \u003cartifactId\u003espring-context\u003c/artifactId\u003e\n        \u003c/exclusion\u003e\n    \u003c/exclusions\u003e\n\u003c/dependency\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.springframework\u003c/groupId\u003e\n    \u003cartifactId\u003espring-jms\u003c/artifactId\u003e\n    \u003cversion\u003erequired version\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.springframework\u003c/groupId\u003e\n    \u003cartifactId\u003espring-context\u003c/artifactId\u003e\n    \u003cversion\u003erequired version\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\n```java\n// Instantiate tracer\nTracer tracer = ...\n\n```\n\n### JMS API\n```java\n// decorate JMS MessageProducer with TracingMessageProducer\nTracingMessageProducer producer = new TracingMessageProducer(messageProducer, tracer);\n\n// decorate JMS JMSProducer with TracingJMSProducer need Session\nSession session = ...\nTracingJMSProducer producer = new TracingJMSProducer(jmsProducer, session, tracer);\n// or with JMSContext\nJMSContext jmsContext = ...\nTracingJMSProducer producer = new TracingJMSProducer(jmsProducer, jmsContext, tracer);\n\n// decorate JMS MessageConsumer with TracingMessageConsumer\nTracingMessageConsumer consumer = new TracingMessageConsumer(messageConsumer, tracer);\n\n// decorate JMS MessageListener if used with TracingMessageListener\nTracingMessageListener listener = new TracingMessageListener(messageListener, tracer);\nconsumer.setMessageListener(listener);\n\n// send message\nMessage message = ...\nproducer.send(message);\n\n// receive message\nMessage message = consumer.receive();\n\n```\n\n### Spring JMS\n```java\n// create TracingJmsTemplate which extends Spring JmsTemplate\nJmsTemplate jmsTemplate = new TracingJmsTemplate(connectionFactory, tracer); \n\n// send and receive messages as usual\njmsTemplate.send(...)\njmsTemplate.convertAndSend(...);\njmsTemplate.receive(...)\njmsTemplate.receiveAndConvert(...);\n...\n```\n\nIf `@JmsListener` is used then it is required to import TracingJmsConfiguration e.g.\n ```java\n@Configuration \n@Import(TracingJmsConfiguration.class)\n@EnableJms\npublic class JmsConfiguration {\n  ...\n}\n```\n\n### Java 9+\n\nModules _opentracing-jms-1_ and _opentracing-jms-2_ have next _Automatic-Module-Name_ accordingly:\n- io.opentracing.contrib.jms1\n- io.opentracing.contrib.jms2\n\n## OpenTracing Conventions\n\n### Message properties\n\nWhen a message exchange between a producer and consumer is traced using an OpenTracing compliant tracer,\nthe trace context and any defined baggage items will be carried in the JMS message properties.\n\nOpenTracing does not place any restrictions on the names used for the trace context and baggage item\nproperties. However the JMS API does not permit the hyphen/dash `-` character to be used. Therefore, it\nis necessary to encode the trace context and baggage item names.\n\nThe steps used to encode the key names are:\n\n- replace any `-` character with `__dash__`\n\nWhen the message is consumed, the steps are reversed to decode the original key names.\n\nAny libraries that instrument the JMS API should conform to this convention to enable tracing interoperability.\n\n## License\n\n[Apache 2.0 License](./LICENSE).\n\n[ci-img]: https://travis-ci.org/opentracing-contrib/java-jms.svg?branch=master\n[ci]: https://travis-ci.org/opentracing-contrib/java-jms\n[cov-img]: https://coveralls.io/repos/github/opentracing-contrib/java-jms/badge.svg?branch=master\n[cov]: https://coveralls.io/github/opentracing-contrib/java-jms?branch=master\n[maven-img]: https://img.shields.io/maven-central/v/io.opentracing.contrib/opentracing-jms-1.svg\n[maven]: http://search.maven.org/#search%7Cga%7C1%7Copentracing-jms-1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentracing-contrib%2Fjava-jms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentracing-contrib%2Fjava-jms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentracing-contrib%2Fjava-jms/lists"}