Skip to content

Commit

Permalink
Handle RuntimeException when getting/setting JMS headers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cfredri4 committed Dec 17, 2024
1 parent 3383e5c commit f007427
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public JmsProcessObservationContext(Message receivedMessage) {
try {
return message.getStringProperty(key);
}
catch (JMSException exc) {
catch (JMSException | RuntimeException exc) {
return null;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public JmsPublishObservationContext(@Nullable Message sendMessage) {
message.setStringProperty(key, value);
}
}
catch (JMSException exc) {
catch (JMSException | RuntimeException exc) {
// ignore
}
});
Expand Down

0 comments on commit f007427

Please sign in to comment.