Record unhanlded JMS exceptions as observation errors
Prior to this commit, when using the `DefaultMessageListenerContainer` as a backing listener container for JMS messages, the instrumentation would not record JMS exceptions as observation errors when they were not handled by configured `ErrorHandler`. This commit ensures that this is the case. Fixes gh-32458
This commit is contained in:
@@ -339,7 +339,12 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
|
||||
}
|
||||
status.setRollbackOnly();
|
||||
}
|
||||
handleListenerException(ex);
|
||||
try {
|
||||
handleListenerException(ex);
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
observation.error(throwable);
|
||||
}
|
||||
// Rethrow JMSException to indicate an infrastructure problem
|
||||
// that may have to trigger recovery...
|
||||
if (ex instanceof JMSException jmsException) {
|
||||
|
||||
Reference in New Issue
Block a user