Skip to content

[Java] Fix to use correct logger class in CompositedMessageInterceptor - #1330

Open
mns-one wants to merge 1 commit into
apache:masterfrom
mns-one:fix/composited-interceptor-logger-class
Open

[Java] Fix to use correct logger class in CompositedMessageInterceptor#1330
mns-one wants to merge 1 commit into
apache:masterfrom
mns-one:fix/composited-interceptor-logger-class

Conversation

@mns-one

@mns-one mns-one commented Aug 11, 2026

Copy link
Copy Markdown

Problem

CompositedMessageInterceptor and MessageMeterInterceptor both implement MessageInterceptor interface

Logger in MessageMeterInterceptor was initialized with MessageMeterInterceptor.class but logger in CompositedMessageInterceptor was initialized with MessageInterceptor.class (the interface) instead of
CompositedMessageInterceptor.class
This routed all log output to the wrong logger name, making per-class log level configuration ineffective and error tracing misleading.

Changes

Replaced MessageInterceptor.class with CompositedMessageInterceptor.class

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

Trivial one-line fix: the logger in CompositedMessageInterceptor was incorrectly using MessageInterceptor.class (the interface) instead of CompositedMessageInterceptor.class (the actual class). This corrects the logger category for proper log filtering. LGTM.


Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

This PR fixes the logger class in CompositedMessageInterceptor from the interface (MessageInterceptor.class) to the implementation class (CompositedMessageInterceptor.class).

Findings

  • [Warning] CompositedMessageInterceptor.java:30 — The logger was initialized with the wrong class, causing all log output to be routed to the interface's logger name instead of the implementation's. This makes per-class log level configuration ineffective and error tracing misleading.
  • [Info] The fix is a simple one-line change that correctly uses CompositedMessageInterceptor.class.

Overall

Good fix for logger configuration. This is a common mistake when implementing interfaces, and it's important for debugging and log level management.


Automated review by RockteMQ-AI

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.

2 participants