Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing observation for @JmsListener response messages #33221

Closed
jghandour opened this issue Jul 15, 2024 · 2 comments
Closed

Missing observation for @JmsListener response messages #33221

jghandour opened this issue Jul 15, 2024 · 2 comments
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) theme: observability An issue related to observability and tracing type: bug A general bug
Milestone

Comments

@jghandour
Copy link

jghandour commented Jul 15, 2024

When using @JmsListener that is configured with an ObservationRegistry can see that the ObservationRegistry is used for the incoming message but not utilized for the outgoing response message. Specifically, the 'traceparent' header is not included in the response. This was using Spring JMS 6.1.10 via Spring Boot 3.3.1.

A simple workout in the meantime is to explicitly use a JmsTemplate configured with ObservationRegistry to send a response.

@Bean
DefaultJmsListenerContainerFactory jmsContainerFactory(ConnectionFactory connectionFactory, ObservationRegistry registry) {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(connectionFactory)
factory.setObservationRegistry(registry);
return factory;
}

@JmsListener("someQueue")
Message<String> handleMessage(Message message) { 
// Do stuff
return MessageBuilder.withPayload("test").build();
}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 15, 2024
@bclozel bclozel self-assigned this Jul 15, 2024
@bclozel bclozel added in: messaging Issues in messaging modules (jms, messaging) theme: observability An issue related to observability and tracing type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jul 15, 2024
@bclozel bclozel added this to the 6.1.12 milestone Jul 19, 2024
@bclozel bclozel changed the title JmsListener using ObersvationRegistry for responses Missing observation for @JmsListener response messages Jul 19, 2024
@bclozel
Copy link
Member

bclozel commented Jul 19, 2024

Thanks for your report @jghandour - this should be available in a few minutes with 6.1.12-SNAPSHOTs.

@jghandour
Copy link
Author

Excellent, thank you for the quick turn around!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) theme: observability An issue related to observability and tracing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants