Skip to content

[#5] Implement command service skeleton with Kafka producer#117

Merged
igorsatsyuk merged 7 commits into
mainfrom
feature/#5-command-service-skeleton
May 15, 2026
Merged

[#5] Implement command service skeleton with Kafka producer#117
igorsatsyuk merged 7 commits into
mainfrom
feature/#5-command-service-skeleton

Conversation

@igorsatsyuk

Copy link
Copy Markdown
Owner

Description

Implements Issue #5 MVP skeleton for command-service.

What was added

  • WebFlux command endpoint: POST /commands/user/login
  • Kafka producer publishing UserLoggedInEvent to topic user.login.events
  • Temporary in-memory event storage for accepted events
  • Validation and API error handling (CommandResponse envelope)
  • Unit tests for controller and service behavior
  • Module README for local run/test steps

Docs/process alignment included

  • Unified branch naming rule across docs: <type>/#XX-description (feature|fix|docs|test)

Closes

Related

Checklist

  • Code follows style guidelines
  • Self-review completed
  • Tests added/updated
  • Documentation updated

Testing

Set-Location backend
mvn -pl command-service -am test

Copilot AI review requested due to automatic review settings May 15, 2026 09:04

Copilot 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.

Pull request overview

Implements the MVP command-service skeleton for the backend CQRS flow, adding a WebFlux command endpoint that turns login commands into UserLoggedInEvents and publishes them to Kafka.

Changes:

  • Added login command controller/service, Kafka topic configuration, publish exception handling, and temporary in-memory event storage.
  • Added unit tests for controller success flow and service publish/store behavior.
  • Updated module README and workflow documentation for branch naming and issue progress.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
START_HERE.md Updates branch naming guidance.
GITHUB_ISSUES_PLAN.md Marks issue #5 subtasks complete and updates branch strategy.
CONTRIBUTING.md Expands mandatory branch naming convention.
AGENTS.md Aligns agent guidance with branch naming convention.
backend/command-service/README.md Documents command-service run, quick check, and test steps.
backend/command-service/src/main/java/lt/satsyuk/distributed/audit/command/CommandServiceApplication.java Enables configuration properties scanning.
backend/command-service/src/main/java/lt/satsyuk/distributed/audit/command/api/CommandController.java Adds POST /commands/user/login.
backend/command-service/src/main/java/lt/satsyuk/distributed/audit/command/api/GlobalExceptionHandler.java Adds API error handling.
backend/command-service/src/main/java/lt/satsyuk/distributed/audit/command/config/KafkaTopicsProperties.java Adds externalized Kafka topic properties.
backend/command-service/src/main/java/lt/satsyuk/distributed/audit/command/repository/InMemoryEventStorage.java Adds temporary in-memory event storage.
backend/command-service/src/main/java/lt/satsyuk/distributed/audit/command/service/CommandPublishException.java Adds publish failure exception type.
backend/command-service/src/main/java/lt/satsyuk/distributed/audit/command/service/UserLoginCommandService.java Creates and publishes login events, then stores accepted events.
backend/command-service/src/test/java/lt/satsyuk/distributed/audit/command/api/CommandControllerTest.java Adds controller success-flow unit test.
backend/command-service/src/test/java/lt/satsyuk/distributed/audit/command/service/UserLoginCommandServiceTest.java Adds service publish/store and failure tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/command-service/README.md Outdated
@igorsatsyuk

Copy link
Copy Markdown
Owner Author

@copilot-pull-request-reviewer review

Copilot 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.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Comment thread GITHUB_ISSUES_PLAN.md Outdated
Copilot stopped work on behalf of igorsatsyuk due to an error May 15, 2026 09:28

Copilot 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.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Comment thread backend/command-service/README.md
…, add subscribeOn for Kafka threading, document prerequisites

Copilot 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.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Comment thread backend/command-service/README.md

Copilot 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.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Copilot 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.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

@igorsatsyuk igorsatsyuk self-assigned this May 15, 2026
@igorsatsyuk igorsatsyuk merged commit c677440 into main May 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment