Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* @author Mark Pollack
* @author Mark Fisher
* @author Dave Syer
* @author James Carr
*/
public abstract class AbstractMessageListenerContainer extends RabbitAccessor implements BeanNameAware, DisposableBean,
SmartLifecycle {
Expand Down Expand Up @@ -423,9 +424,9 @@ protected void invokeErrorHandler(Throwable ex) {
if (this.errorHandler != null) {
this.errorHandler.handleError(ex);
} else if (logger.isDebugEnabled()) {
logger.debug("Execution of Rabbit message listener failed, and no ErrorHandler has been set.", ex);
logger.warn("Execution of Rabbit message listener failed, and no ErrorHandler has been set.", ex);
} else if (logger.isInfoEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not log under warn after testing for isInfoEnabled (or isDebugEnabled). Always log at the same level as if test.

simply replace both with a single

if (logger.isWarnEnabled() {
logger.warn(...., ex);
}

(See JMS AMLC)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Just updated the commit range.

logger.info("Execution of Rabbit message listener failed, and no ErrorHandler has been set: "
logger.warn("Execution of Rabbit message listener failed, and no ErrorHandler has been set: "
+ ex.getClass() + ": " + ex.getMessage());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Great!

You should remove this last else if{...} stanza; it will never be executed because the one above it will run.

Thanks.

}
Expand Down