JFR JMS

A JMS wrapper that generates JFR events.

License

License

MIT
GroupId

GroupId

com.github.marschall
ArtifactId

ArtifactId

jfr-jmstemplate
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

JFR JMS
A JMS wrapper that generates JFR events.
Project URL

Project URL

https://github.com/marschall/jfr-jmstemplate
Source Code Management

Source Code Management

https://github.com/marschall/jfr-jmstemplate

Download jfr-jmstemplate

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.marschall/jfr-jmstemplate/ -->
<dependency>
    <groupId>com.github.marschall</groupId>
    <artifactId>jfr-jmstemplate</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.marschall/jfr-jmstemplate/
implementation 'com.github.marschall:jfr-jmstemplate:0.1.0'
// https://jarcasting.com/artifacts/com.github.marschall/jfr-jmstemplate/
implementation ("com.github.marschall:jfr-jmstemplate:0.1.0")
'com.github.marschall:jfr-jmstemplate:jar:0.1.0'
<dependency org="com.github.marschall" name="jfr-jmstemplate" rev="0.1.0">
  <artifact name="jfr-jmstemplate" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.marschall', module='jfr-jmstemplate', version='0.1.0')
)
libraryDependencies += "com.github.marschall" % "jfr-jmstemplate" % "0.1.0"
[com.github.marschall/jfr-jmstemplate "0.1.0"]

Dependencies

provided (2)

Group / Artifact Type Version
org.springframework : spring-jms jar
jakarta.jms : jakarta.jms-api jar 2.0.3

test (7)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar
org.junit.vintage : junit-vintage-engine jar
org.apache.activemq : activemq-broker jar 5.16.0
org.apache.activemq.tooling : activemq-junit jar 5.16.0
org.apache.logging.log4j : log4j-core jar 2.13.3
org.apache.logging.log4j : log4j-slf4j-impl jar 2.13.3
org.apache.logging.log4j : log4j-jcl jar 2.13.3

Project Modules

There are no modules declared in this project.

JFR JmsTemplate Maven Central Javadocs Build Status

An implementation of Spring JmsTemplate that generates Flight Recorder events.

This project requires Java 11 based on OpenJDK or later.

<dependency>
  <groupId>com.github.marschall</groupId>
  <artifactId>jfr-jmstemplate</artifactId>
  <version>0.1.0</version>
</dependency>

Flight Recording of a JUnit Test

Compared to approaches based on ConnectionFactory an approach based on JmsTemplate has the advantage that it captures a complete queue interaction. A JmsTemplate based approach generates a single JFR event for an entire message queue interaction that involves several JMS method invocations.

Overhead

We try to keep overhead to a minimum and have no additional allocations besides the JFR events. Besides the overhead of the event the only additional overhead is

  • a wrapper around JmsTemplate
  • a few instanceof operations and casts
  • a finally block

We assume javax.jms.Queue#getQueueName() and javax.jms.Topic#getTopicName() are simple getters.

Usage

@Configuration
public class JmsConfiguration {

   @Autowired
   private ConnectionFactory connectionFactory;

   @Bean
   public JmsOperations jmsOperations() {
     return new JfrJmsOperations(new JmsTemplate(this.connectionFactory));
   }

}

Limitations

  • We can not intercept JmsTemplate#setDefaultDestination(Destination) or JmsTemplate#setDefaultDestinationName(String) so for operations on the default destination we can not report the destination name.

Versions

Version
0.1.0