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

Handle RuntimeException when getting/setting JMS headers #5746

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cfredri4
Copy link

Currently JMSException is handled when getting/setting JMS headers. Some JMS providers will throw RuntimeException instead of JMSException when failing to get/set JMS headers. This change adds so that RuntimeException is also handled.

For example, Qpid JMS throws IllegalArgumentException which leads to similar issue as #4202.

Copy link
Member

@jonatan-ivanov jonatan-ivanov left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

I'm thinking about the consequences of doing this: since this can happen if a propagation format that contains - is used, this can hide the underlying problem and propagation still won't work.

I'm wondering if we should log a warning (maybe a warning first then debug using WarnThenDebugLogger). What do you think?

/cc @bclozel @shakuzen

@cfredri4 cfredri4 force-pushed the handle-runtime-exception-when-getting-setting-jms-headers branch from f007427 to d8fbfc7 Compare December 18, 2024 13:32
@cfredri4
Copy link
Author

Good idea. Pushed fix.

@jonatan-ivanov jonatan-ivanov added bug A general bug instrumentation An issue that is related to instrumenting a component labels Dec 18, 2024
@jonatan-ivanov
Copy link
Member

I think we should do this against 1.13.x but I can back-port this and modify the PR before merging.

@jonatan-ivanov jonatan-ivanov added this to the 1.13.10 milestone Dec 18, 2024
Currently JMSException is handled when getting/setting JMS headers.
Some JMS providers will throw RuntimeException instead of JMSException when failing to get/set JMS headers.
This change adds so that all exceptions are handled.
@cfredri4 cfredri4 force-pushed the handle-runtime-exception-when-getting-setting-jms-headers branch from d8fbfc7 to 0c40732 Compare December 19, 2024 07:48
@cfredri4
Copy link
Author

Pushed fixes. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug instrumentation An issue that is related to instrumenting a component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants