Skip to content

[AMQ-9288] Fix TransportConnection logger to include exception message on Async Error (5.19.x backport)#2062

Open
trex-amazon wants to merge 1 commit into
apache:activemq-5.19.xfrom
trex-amazon:backport/amq-9288-async-error-log
Open

[AMQ-9288] Fix TransportConnection logger to include exception message on Async Error (5.19.x backport)#2062
trex-amazon wants to merge 1 commit into
apache:activemq-5.19.xfrom
trex-amazon:backport/amq-9288-async-error-log

Conversation

@trex-amazon
Copy link
Copy Markdown

Summary

Backport of AMQ-9288 (commit b751428eb, #1038) to the activemq-5.19.x branch.

When an async error occurs and DEBUG logging is not enabled, TransportConnection logged at WARN with a message that had no {} placeholder, while passing e.getMessage() as an argument:

} else {
    SERVICELOG.warn("Async error occurred", e.getMessage());
}

SLF4J drops the unreferenced argument, so the broker logs only the bare text Async error occurred with no detail — making the failure undiagnosable at the default log level. This was reported by an Amazon MQ for ActiveMQ user on AWS re:Post: "Async error occurred — without trace".

The fix already exists on the main, 6.0.x, 6.1.x, and 6.2.x branches via AMQ-9288, but was never backported to the still-supported 5.18.x / 5.19.x maintenance branches.

Change

-    SERVICELOG.warn("Async error occurred", e.getMessage());
+    SERVICELOG.warn("Async error occurred: {}", e.getMessage());

Adds the {} placeholder so the exception message is included at WARN. The Throwable is intentionally not passed — full stack traces at WARN were deliberately removed in AMQ-8548; the DEBUG branch one line above continues to log the full trace.

Testing

mvn -DskipTests install of the full 5.19.x reactor compiles cleanly on JDK 11. This mirrors the original AMQ-9288 commit exactly, which likewise changed only this line and added no test.

…e on Async Error

Backport of AMQ-9288 (commit b751428, PR apache#1038) to the 5.19.x branch.

When an async error occurs and DEBUG is not enabled, TransportConnection
logged at WARN with a message string that had no '{}' placeholder while
passing e.getMessage() as a parameter. SLF4J therefore dropped the
argument and logged only the bare text "Async error occurred" with no
detail, making the failure undiagnosable at the default log level.

Add the '{}' placeholder so the exception message is included, matching
the fix already present on the 6.x branches. The Throwable is
intentionally not passed (full stack traces at WARN were deliberately
removed in AMQ-8548); DEBUG continues to log the full trace.
@jbonofre jbonofre self-requested a review May 31, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant