Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

Logging interceptors#13

Merged
sleepkqq merged 2 commits into
masterfrom
feature/logging-interceptors
Dec 7, 2025
Merged

Logging interceptors#13
sleepkqq merged 2 commits into
masterfrom
feature/logging-interceptors

Conversation

@sleepkqq

@sleepkqq sleepkqq commented Dec 7, 2025

Copy link
Copy Markdown
Member

PR Type

Enhancement


Description

  • Remove verbose logging from Kafka producers and consumers

  • Simplify notification sending logic by inlining sendToTopic method

  • Update solo-leveling-lib dependency to version 1.4.8


Diagram Walkthrough

flowchart LR
  A["ReceiveNotificationProducer"] -->|remove logger| B["Simplified send logic"]
  C["SendNotificationConsumer"] -->|remove log statement| D["Cleaner processEvent"]
  E["pom.xml"] -->|update version| F["solo-leveling-lib 1.4.8"]
Loading

File Walkthrough

Relevant files
Enhancement
ReceiveNotificationProducer.kt
Remove logging and inline send logic                                         

solo-leveling-notification-service/src/main/kotlin/com/sleepkqq/sololeveling/notification/kafka/ReceiveNotificationProducer.kt

  • Remove LoggerFactory import and logger instance variable
  • Eliminate sendToTopic private method with verbose logging
  • Inline kafkaTemplate.send call directly in forEach lambda
  • Remove info and error log statements for notification delivery
+1/-15   
SendNotificationConsumer.kt
Remove verbose logging from consumer                                         

solo-leveling-notification-service/src/main/kotlin/com/sleepkqq/sololeveling/notification/kafka/SendNotificationConsumer.kt

  • Remove log.info statement from processEvent method
  • Simplify event processing by removing verbose logging
+0/-1     
Dependencies
pom.xml
Update solo-leveling-lib dependency version                           

pom.xml

  • Update solo-leveling-lib.version from 1.3.3 to 1.4.8
+1/-1     

@qodo-code-review

Copy link
Copy Markdown

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
Audit logging removed: The PR removes success/failure logging for notification sends, potentially reducing
auditability of a critical action (notification delivery outcomes) without showing an
alternative audit mechanism.

Referred Code
fun send(priority: NotificationPriority, event: ReceiveNotificationEvent) =
	routingStrategy.getTopics(priority)
		.forEach { kafkaTemplate.send(it, event) }

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Error handling removed: The PR removes per-send completion handling that differentiated success vs failure, which
may lead to silent failures unless handled elsewhere.

Referred Code
fun send(priority: NotificationPriority, event: ReceiveNotificationEvent) =
	routingStrategy.getTopics(priority)
		.forEach { kafkaTemplate.send(it, event) }

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Handle asynchronous send operation failures

Reintroduce a completion handler for the asynchronous kafkaTemplate.send call to
handle and log potential exceptions, preventing silent message delivery
failures.

solo-leveling-notification-service/src/main/kotlin/com/sleepkqq/sololeveling/notification/kafka/ReceiveNotificationProducer.kt [17]

-.forEach { kafkaTemplate.send(it, event) }
+.forEach { topic ->
+    kafkaTemplate.send(topic, event).whenComplete { _, ex ->
+        if (ex != null) {
+            // A logger instance is required here to log the exception.
+            // For example: log.error("Failed to send notification to {} | txId={}", topic, event.txId, ex)
+        }
+    }
+}
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that removing the CompletableFuture handler for the asynchronous kafkaTemplate.send call can lead to silent message delivery failures, which is a critical correctness issue.

Medium
  • More

@sleepkqq
sleepkqq merged commit 80babd1 into master Dec 7, 2025
2 checks passed
@sleepkqq
sleepkqq deleted the feature/logging-interceptors branch December 7, 2025 19:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant