An implementation of Spring RestTemplate that generates Flight Recorder events.
Versions 2.x are for Spring 6, versions 1.x are for Spring 5.
<dependency>
<groupId>com.github.marschall</groupId>
<artifactId>jfr-resttemplate</artifactId>
<version>2.0.0</version>
</dependency>
This project requires Java 11 based on OpenJDK or later.
We try to keep overhead to a minimum and the only additional allocations besides the JFR events are URI#toString()
.
@Configuration
public class RestConfiguration {
@Bean
public RestOperations restOperations() {
ClientHttpRequestFactory requestFactory = ...;
RestOperations restOperations = new RestTemplate(requestFactory);
return new JfrRestOperations(restOperations);
}
}