-
Notifications
You must be signed in to change notification settings - Fork 258
[ISSUE #1060] [Java] Enhance the logic of MessageInterceptor #1061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[ISSUE #1060] [Java] Enhance the logic of MessageInterceptor #1061
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1061 +/- ##
============================================
- Coverage 53.26% 53.11% -0.16%
- Complexity 651 665 +14
============================================
Files 208 211 +3
Lines 14303 14039 -264
Branches 5845 5541 -304
============================================
- Hits 7619 7457 -162
+ Misses 6308 6206 -102
Partials 376 376
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -36,6 +38,11 @@ public class LoggingInterceptor implements ClientInterceptor { | |||
private static final Logger log = LoggerFactory.getLogger(LoggingInterceptor.class); | |||
|
|||
private static final LoggingInterceptor INSTANCE = new LoggingInterceptor(); | |||
private static String remoteAddr = ""; | |||
|
|||
public static String getRemoteAddr() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static?
@@ -36,6 +38,11 @@ public class LoggingInterceptor implements ClientInterceptor { | |||
private static final Logger log = LoggerFactory.getLogger(LoggingInterceptor.class); | |||
|
|||
private static final LoggingInterceptor INSTANCE = new LoggingInterceptor(); | |||
private static String remoteAddr = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using static not support muti client instance
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class ConsumeTask implements Callable<ConsumeResult> { | ||
private static final Logger log = LoggerFactory.getLogger(ConsumeTask.class); | ||
|
||
private static final String MESSAGE_VIEW_CONTEXT = "messageView"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AttributeKey
Which Issue(s) This PR Fixes
Fixes #1060
Brief Description
Added MessageInterceptorContext information to provide more comprehensive information to the MessageInterceptor, including the remote address, messages sent by the producer, messages received, message type, consumption exceptions, and more.