Skip to content

Feat microservice messaging pattern - #3564

Open
Mukul-Howale wants to merge 17 commits into
iluwatar:masterfrom
Mukul-Howale:feat-microservice-messaging-pattern-
Open

Feat microservice messaging pattern #3564
Mukul-Howale wants to merge 17 commits into
iluwatar:masterfrom
Mukul-Howale:feat-microservice-messaging-pattern-

Conversation

@Mukul-Howale

Copy link
Copy Markdown

What does this PR do?

Introduces the Microservices Messaging design pattern module (microservices-messaging), demonstrating asynchronous inter-service communication and event-driven architecture in Java 21 using Apache Kafka and in-memory messaging fallback.

Key Changes & Features

  • Core Microservices Example:
    • OrderService: Publishes order status events (Order Created, Order Shipped, Order Delivered, Order Cancelled).
    • InventoryService: Listens to order events to manage stock allocations.
    • PaymentService: Consumes messages to handle transaction payments.
    • NotificationService: Triggers user notifications asynchronously upon receiving topic events.
  • Messaging Infrastructure:
    • KafkaMessageProducer & KafkaMessageConsumer: Provides Apache Kafka integration with automatic fallback to an in-memory topic broker if Kafka is unavailable.
    • docker-compose.yml: Configures Kafka and Zookeeper containers for local development and testing.
    • Helper scripts run-app.ps1 and run-app.sh for cross-platform execution.
  • Testing & Documentation:
    • Complete JUnit 5 and Mockito unit test suite verifying all services and Kafka message handlers.
    • Detailed README.md with architectural flowcharts, sequence diagrams, applicability rules, and run instructions.

Fixes #2681

Mukul-Howale and others added 9 commits July 29, 2026 16:10
Add initial project structure for microservices-messaging using Spring Boot. Includes Maven configuration with dependencies for Kafka, Lombok, and testing, as well as main application, test class, and application properties.
1. Added initial project structure for demonstrating the microservices messaging pattern.
2. Introduced service stubs (OrderService, InventoryService, PaymentService, NotificationService), a Message and MessageBroker class, and a main App entry point.
3. Added README and logging configuration.
1. Added the Message class with unique ID, content, and timestamp fields, and a toString method.
2. Implemented the MessageBroker class to support topic-based publish-subscribe messaging, including subscriber management, message publishing, and logging.
1. Added message handling logic to InventoryService, PaymentService, and NotificationService.
2. OrderService now publishes order events to a MessageBroker, and App demonstrates the messaging workflow. 3. Each service processes relevant order events and logs actions for demonstration purposes.
1. Enhanced the README with detailed explanations, real-world examples, Java code samples, and references for the Microservices Messaging pattern.
2. Added flowchart and sequence diagram images to illustrate the pattern.
1. Added Apache Kafka for asynchronous communication between services.
2. Added KafkaMessageProducer and KafkaMessageConsumer classes, updated service implementations and main application logic to use Kafka, and adjusted the Maven configuration to include Kafka and Jackson dependencies.
3. Updated and moved all classes to the com.iluwatar.messaging package, improved documentation, and updated diagrams to reflect the new architecture.
1. Added comprehensive unit tests for App, InventoryService, KafkaMessageConsumer, KafkaMessageProducer, Message, NotificationService, OrderService, and PaymentService.
2. Added MIT license headers to all main source files and logback.xml.
3. Updated pom.xml to include JUnit Jupiter as a test dependency.
1. Simplified unit tests for InventoryService, NotificationService, and PaymentService by removing null content tests and adding instantiation checks.
2. Refactored KafkaMessageConsumerTest and KafkaMessageProducerTest to avoid requiring a real Kafka instance, focusing on class structure and method existence instead of integration behavior.
Introduce the microservices-messaging module and register it in the root pom.xml. Add docker-compose.yml to run a local Kafka (confluentinc/cp-kafka) with a healthcheck, plus run-app.ps1 and run-app.sh helper scripts that start Kafka if needed and then launch the application. Update the module README with usage instructions. Also remove a duplicated junit-jupiter-api test dependency from the module pom to rely on project defaults.
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR Summary

Integrated the Microservices Messaging pattern module using Kafka with in-memory fallback, including producer/consumer implementations, service stubs, tests, Docker-based infrastructure, and documentation. Updates enable asynchronous inter-service communication via an event-driven architecture demonstrator in Java 21, with local Kafka (via Docker) and cross-platform run scripts. Added unit tests for all services and core components, plus a detailed README and diagrams.

Changes

File Summary
.github/workflows/maven-ci.yml CI pipeline updated to spin up Kafka via Docker for the microservices-messaging module, wait for readiness using the kafka-topics binary, and tear down the Docker service after tests.
.github/workflows/maven-pr-builder.yml PR CI now starts a Kafka Docker service, polls readiness with kafka-topics, and tears down after tests to enable Kafka-dependent checks.
microservices-messaging/README.md Added a module README detailing the Microservices Messaging pattern, architecture, usage, run instructions, and diagrams.
microservices-messaging/docker-compose.yml Docker Compose config for Kafka (Confluent CP) with a healthcheck using kafka-topics and port mappings for local dev.
microservices-messaging/etc/microservices-messaging-flowchart.png New flowchart diagram illustrating the Microservices Messaging architecture.
microservices-messaging/etc/microservices-messaging-sequence-diagram.png New sequence diagram illustrating message flow between services.
microservices-messaging/pom.xml Module POM declaring Kafka/Jackson/JUnit dependencies, Lombok (provided), and an assembly main class; defines App as entry point.
microservices-messaging/run-app.ps1 PowerShell script to start Kafka (via Docker) if needed and run the Microservices Messaging app.
microservices-messaging/run-app.sh Shell script to start Kafka (via Docker) if needed and run the Microservices Messaging app.
microservices-messaging/src/main/java/com/iluwatar/messaging/App.java App demonstrating the messaging workflow: constructs producer/consumers, subscribes to topics, and publishes order events for demonstration.
microservices-messaging/src/main/java/com/iluwatar/messaging/InventoryService.java InventoryService consumes Messages and updates/restores inventory based on Order Created/Order Cancelled events.
microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageConsumer.java Kafka consumer wrapper that deserializes messages to Message and delegates handling; supports testable constructors via dependency injection.
microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageProducer.java Kafka producer wrapper that serializes Message to JSON and publishes to topic with callback; includes close() behavior.
microservices-messaging/src/main/java/com/iluwatar/messaging/Message.java Immutable Message class with id, content, and timestamp; JSON constructor, toString, and Lombok getter.
microservices-messaging/src/main/java/com/iluwatar/messaging/NotificationService.java NotificationService consumes messages and triggers user notifications for order events (Created/Updated/Cancelled).
microservices-messaging/src/main/java/com/iluwatar/messaging/OrderService.java OrderService producer publishing Order Created/Updated/Cancelled events to order-topic via KafkaMessageProducer.
microservices-messaging/src/main/java/com/iluwatar/messaging/PaymentService.java PaymentService consumer handling payments and refunds based on order events.
microservices-messaging/src/main/resources/logback.xml Logging config for module; INFO level and logger for com.iluwatar.messaging.
microservices-messaging/src/test/java/com/iluwatar/messaging/AppTest.java App constructor test ensuring instantiation of the demo application.
microservices-messaging/src/test/java/com/iluwatar/messaging/InventoryServiceTest.java Unit tests for InventoryService: instantiation and handling various messages without Kafka dependencies.
microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java Unit tests for KafkaMessageConsumer using MockConsumer to validate valid/invalid JSON paths and closure behavior.
microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java Unit tests for KafkaMessageProducer using MockProducer to verify publish success, error callback, and close.
microservices-messaging/src/test/java/com/iluwatar/messaging/MessageTest.java Comprehensive unit tests for Message including JSON (de)serialization and edge cases like null/empty content.
microservices-messaging/src/test/java/com/iluwatar/messaging/NotificationServiceTest.java Unit tests for NotificationService validating message handling across scenarios without Kafka.
microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java Unit tests for OrderService publishing via KafkaMessageProducer with a MockProducer; validates multiple operations.
microservices-messaging/src/test/java/com/iluwatar/messaging/PaymentServiceTest.java Unit tests for PaymentService message handling without Kafka dependencies.
pom.xml Root pom updated to include microservices-messaging module and license plugin exclusion for .ps1 scripts.

autogenerated by presubmit.ai

@github-actions github-actions Bot 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.

🚨 Pull request needs attention.

Review Summary

Commits Considered (9)
  • 2274ad7: Add microservices-messaging module and run scripts

Introduce the microservices-messaging module and register it in the root pom.xml. Add docker-compose.yml to run a local Kafka (confluentinc/cp-kafka) with a healthcheck, plus run-app.ps1 and run-app.sh helper scripts that start Kafka if needed and then launch the application. Update the module README with usage instructions. Also remove a duplicated junit-jupiter-api test dependency from the module pom to rely on project defaults.

  • a83b9aa: Refactor and simplify service and Kafka test classes
  1. Simplified unit tests for InventoryService, NotificationService, and PaymentService by removing null content tests and adding instantiation checks.
  2. Refactored KafkaMessageConsumerTest and KafkaMessageProducerTest to avoid requiring a real Kafka instance, focusing on class structure and method existence instead of integration behavior.
  • f2bb392: Add unit tests and license headers to messaging module
  1. Added comprehensive unit tests for App, InventoryService, KafkaMessageConsumer, KafkaMessageProducer, Message, NotificationService, OrderService, and PaymentService.
  2. Added MIT license headers to all main source files and logback.xml.
  3. Updated pom.xml to include JUnit Jupiter as a test dependency.
  • 24cc9af: Refactor to use Kafka for microservices messaging
  1. Added Apache Kafka for asynchronous communication between services.
  2. Added KafkaMessageProducer and KafkaMessageConsumer classes, updated service implementations and main application logic to use Kafka, and adjusted the Maven configuration to include Kafka and Jackson dependencies.
  3. Updated and moved all classes to the com.iluwatar.messaging package, improved documentation, and updated diagrams to reflect the new architecture.
  • 8852ab9: Expand microservices messaging docs and add diagrams
  1. Enhanced the README with detailed explanations, real-world examples, Java code samples, and references for the Microservices Messaging pattern.
  2. Added flowchart and sequence diagram images to illustrate the pattern.
  • ade60eb: Implement messaging pattern for microservices
  1. Added message handling logic to InventoryService, PaymentService, and NotificationService.
  2. OrderService now publishes order events to a MessageBroker, and App demonstrates the messaging workflow. 3. Each service processes relevant order events and logs actions for demonstration purposes.
  • dac0805: Implement Message and MessageBroker classes
  1. Added the Message class with unique ID, content, and timestamp fields, and a toString method.
  2. Implemented the MessageBroker class to support topic-based publish-subscribe messaging, including subscriber management, message publishing, and logging.
  • b76c9bb: Initialize microservices messaging pattern
  1. Added initial project structure for demonstrating the microservices messaging pattern.
  2. Introduced service stubs (OrderService, InventoryService, PaymentService, NotificationService), a Message and MessageBroker class, and a main App entry point.
  3. Added README and logging configuration.
  • 6b1913e: Initialize microservices-messaging Spring Boot project

Add initial project structure for microservices-messaging using Spring Boot. Includes Maven configuration with dependencies for Kafka, Lombok, and testing, as well as main application, test class, and application properties.

Files Processed (25)
  • microservices-messaging/README.md (1 hunk)
  • microservices-messaging/docker-compose.yml (1 hunk)
  • microservices-messaging/etc/microservices-messaging-flowchart.png (0 hunks)
  • microservices-messaging/etc/microservices-messaging-sequence-diagram.png (0 hunks)
  • microservices-messaging/pom.xml (1 hunk)
  • microservices-messaging/run-app.ps1 (1 hunk)
  • microservices-messaging/run-app.sh (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/App.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/InventoryService.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageConsumer.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageProducer.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/Message.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/NotificationService.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/OrderService.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/PaymentService.java (1 hunk)
  • microservices-messaging/src/main/resources/logback.xml (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/AppTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/InventoryServiceTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/MessageTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/NotificationServiceTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/PaymentServiceTest.java (1 hunk)
  • pom.xml (1 hunk)
Actionable Comments (1)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/Message.java [36-37]

    bug: "Missing Lombok dependency for Lombok-annotated Message class."

Skipped Comments (4)
  • microservices-messaging/pom.xml [72-79]

    best_practice: "Missing JUnit 5 API dependency in module pom."

  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageProducer.java [69-83]

    enhancement: "Missing resilient fallback for messaging when Kafka is down."

  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageConsumer.java [106-109]

    best_practice: "Graceful shutdown improvement for KafkaConsumer."

  • microservices-messaging/docker-compose.yml [1-28]

    security: "Security hardening for Dockerized Kafka"

Add Lombok as a provided dependency and apply formatting/refactoring across the microservices-messaging module. Changes include import reordering, Javadoc and logging formatting, consistent lambda/try/catch indentation, small Kafka consumer/producer refinements (Duration/Properties usage and callback formatting), Message class tweaks (@Getter, JSON ctor and toString formatting) and EOF/newline fixes. Unit tests were also reformatted for consistency. These are non-functional style and readability improvements; no behavior changes intended.

@github-actions github-actions Bot 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.

LGTM!

Review Summary

Commits Considered (1)
  • 4c08cdc: microservices-messaging: code style and Lombok

Add Lombok as a provided dependency and apply formatting/refactoring across the microservices-messaging module. Changes include import reordering, Javadoc and logging formatting, consistent lambda/try/catch indentation, small Kafka consumer/producer refinements (Duration/Properties usage and callback formatting), Message class tweaks (@Getter, JSON ctor and toString formatting) and EOF/newline fixes. Unit tests were also reformatted for consistency. These are non-functional style and readability improvements; no behavior changes intended.

Files Processed (25)
  • microservices-messaging/README.md (1 hunk)
  • microservices-messaging/docker-compose.yml (1 hunk)
  • microservices-messaging/etc/microservices-messaging-flowchart.png (0 hunks)
  • microservices-messaging/etc/microservices-messaging-sequence-diagram.png (0 hunks)
  • microservices-messaging/pom.xml (1 hunk)
  • microservices-messaging/run-app.ps1 (1 hunk)
  • microservices-messaging/run-app.sh (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/App.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/InventoryService.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageConsumer.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageProducer.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/Message.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/NotificationService.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/OrderService.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/PaymentService.java (1 hunk)
  • microservices-messaging/src/main/resources/logback.xml (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/AppTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/InventoryServiceTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/MessageTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/NotificationServiceTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/PaymentServiceTest.java (1 hunk)
  • pom.xml (1 hunk)
Actionable Comments (0)
Skipped Comments (4)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/Message.java [63-75]

    readability: "Potential readability issue in toString"

  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageProducer.java [67-89]

    possible issue: "Error handling in publish()"

  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageConsumer.java [81-93]

    threaded consumer loop: "Consumer loop processes messages from Kafka"

  • microservices-messaging/src/main/java/com/iluwatar/messaging/OrderService.java [46-51]

    best_practice: "Publish order-created message to topic"

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 43.49776% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.70%. Comparing base (74d2dbe) to head (4c08cdc).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...a/com/iluwatar/messaging/KafkaMessageConsumer.java 0.00% 38 Missing ⚠️
...ging/src/main/java/com/iluwatar/messaging/App.java 0.00% 37 Missing ⚠️
...a/com/iluwatar/messaging/KafkaMessageProducer.java 3.22% 30 Missing ⚠️
...va/com/iluwatar/messaging/NotificationService.java 75.00% 9 Missing ⚠️
.../java/com/iluwatar/messaging/InventoryService.java 76.92% 6 Missing ⚠️
...in/java/com/iluwatar/messaging/PaymentService.java 76.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3564      +/-   ##
============================================
- Coverage     83.24%   82.70%   -0.55%     
- Complexity     4025     4058      +33     
============================================
  Files          1060     1068       +8     
  Lines         14246    14469     +223     
  Branches        686      694       +8     
============================================
+ Hits          11859    11966     +107     
- Misses         2100     2217     +117     
+ Partials        287      286       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Refactor KafkaMessageProducer and KafkaMessageConsumer to depend on the Producer/Consumer interfaces and add constructors that accept mockable instances. Extract default producer/consumer creation into factory methods so tests can inject MockProducer/MockConsumer. Update tests across the microservices-messaging module to use MockProducer/MockConsumer, add more meaningful assertions, error/interrupt handling tests, and simplify AppTest. These changes improve unit testability and remove the need for a running Kafka instance while preserving runtime behavior.

@github-actions github-actions Bot 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.

LGTM!

Review Summary

Commits Considered (1)
  • 021f55d: Make Kafka producer/consumer testable

Refactor KafkaMessageProducer and KafkaMessageConsumer to depend on the Producer/Consumer interfaces and add constructors that accept mockable instances. Extract default producer/consumer creation into factory methods so tests can inject MockProducer/MockConsumer. Update tests across the microservices-messaging module to use MockProducer/MockConsumer, add more meaningful assertions, error/interrupt handling tests, and simplify AppTest. These changes improve unit testability and remove the need for a running Kafka instance while preserving runtime behavior.

Files Processed (9)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageConsumer.java (1 hunk)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageProducer.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/AppTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/InventoryServiceTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/NotificationServiceTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/PaymentServiceTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageConsumer.java [117-119]

    best_practice: "Graceful shutdown for Kafka consumer."

  • microservices-messaging/src/main/java/com/iluwatar/messaging/KafkaMessageProducer.java [75-93]

    enhancement: "Input validation for publish arguments."

Normalize Javadoc formatting and reorder static JUnit imports for consistency in messaging tests. Converted multi-line test Javadocs to single-line comments and adjusted import ordering in the following files:

- microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java
- microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java
- microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java

No functional changes.

@github-actions github-actions Bot 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.

LGTM!

Review Summary

Commits Considered (1)
  • 50c27b3: Format test Javadoc and reorder imports

Normalize Javadoc formatting and reorder static JUnit imports for consistency in messaging tests. Converted multi-line test Javadocs to single-line comments and adjusted import ordering in the following files:

  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java
  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java

No functional changes.

Files Processed (3)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java (1 hunk)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (11)
  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java [66-89]

    readability: "Verify payload processing in consumer test"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java [91-109]

    enhancement: "Handle invalid JSON payload more explicitly"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageConsumerTest.java [111-115]

    enhancement: "Close should be idempotent"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java [56-63]

    enhancement: "Validate produced record value"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java [66-75]

    enhancement: "Error path verification"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/KafkaMessageProducerTest.java [78-82]

    enhancement: "Close behavior verification"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java [49-59]

    enhancement: "Verify produced key matches orderId"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java [61-71]

    enhancement: "Verify produced key matches orderId (update)"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java [73-83]

    enhancement: "Verify produced key matches orderId (cancel)"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java [85-97]

    enhancement: "Multiple operations event tracking"

  • microservices-messaging/src/test/java/com/iluwatar/messaging/OrderServiceTest.java [99-109]

    enhancement: "Verify keys for multiple IDs"

Add MIT license headers to microservices-messaging/docker-compose.yml, run-app.ps1 and run-app.sh to ensure license text is present in these scripts. Update root pom.xml to exclude PowerShell (*.ps1) files from the license plugin checks so those files are not processed by the license rule.
Bring up Kafka for tests in CI and PR workflows. Adds steps to run docker compose for microservices-messaging, poll Kafka readiness (up to 20 retries), and always tear down with docker compose down. Enables Maven tests that depend on Kafka. Affects .github/workflows/maven-ci.yml and .github/workflows/maven-pr-builder.yml.
Replace calls to kafka-topics.sh with kafka-topics in CI workflows and the Docker Compose healthcheck. Updated .github/workflows/maven-ci.yml, .github/workflows/maven-pr-builder.yml, and microservices-messaging/docker-compose.yml to use the kafka-topics binary for readiness checks and healthchecks. This prevents failures on images that expose the kafka-topics command without the .sh wrapper.
@Mukul-Howale
Mukul-Howale marked this pull request as draft August 6, 2026 15:46
Replace the custom bash readiness loop with `docker compose ... up -d --wait` in CI and PR workflows. This simplifies startup of the microservices-messaging Kafka service and removes the manual retry/polling logic. Files changed: .github/workflows/maven-ci.yml, .github/workflows/maven-pr-builder.yml. Note: requires a Docker Compose version that supports the `--wait` flag.
@Mukul-Howale
Mukul-Howale marked this pull request as ready for review August 6, 2026 15:46
Reformatted KafkaMessageConsumerTest and PaymentServiceTest for readability and consistent formatting: reflowed constructor invocation, expanded anonymous HashMap and schedulePollTask lambda blocks, and aligned assertDoesNotThrow parameters. These are pure style changes with no behavioral modifications.
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.

Microservice pattern: Messaging

1 participant