Skip to content

feat: migrate messaging to Spring Cloud Stream and add comprehensive API documentation#1

Merged
Sympol merged 2 commits intomainfrom
develop
Feb 1, 2026
Merged

feat: migrate messaging to Spring Cloud Stream and add comprehensive API documentation#1
Sympol merged 2 commits intomainfrom
develop

Conversation

@Sympol
Copy link
Copy Markdown
Owner

@Sympol Sympol commented Feb 1, 2026

Description

This PR introduces a major improvement to both platform architecture and developer experience.

Messaging layer migration

The messaging infrastructure has been migrated from direct Kafka usage to Spring Cloud Stream, allowing microservices to be decoupled from vendor-specific messaging implementations.
This improves portability, maintainability, and testability while aligning the system with modern Spring best practices.

Key changes:

  • Replaced spring-kafka with spring-cloud-starter-stream-kafka
  • Migrated producers to StreamBridge
  • Migrated consumers to the functional Consumer<T> programming model
  • Centralized stream bindings and binder configuration in config-service
  • Standardized Avro message handling across all services

API documentation

  • Added docs/API_REFERENCE.md with detailed endpoint documentation for all microservices
  • Included request/response payloads and curl examples
  • Updated README.md to reference the new API documentation

This PR lays the groundwork for improved scalability, clearer contracts, and easier onboarding.

Fixes # (issue)


Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

The changes were validated through local testing and service-level verification:

  • Message production and consumption tested across services using Kafka binder

  • Verified functional consumers and producers with real event flows

  • Manual API validation using provided curl examples

  • Application startup and configuration loading tested across environments

  • Unit Tests

  • Integration Tests


Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

- Decouple microservices from direct Kafka dependencies to ensure vendor neutrality.
- Replace `spring-kafka` with `spring-cloud-starter-stream-kafka` in `profile-service`, `consent-service`, `segment-service`, and `preference-service`.
- Refactor event publishers to use `StreamBridge` instead of `KafkaTemplate`.
- Migrate message consumers to the functional `java.util.function.Consumer` model.
- Centralize stream binding and binder configurations in `config-service`.
- Clean up unused imports and standardize Avro message handling across services.
- Add `docs/API_REFERENCE.md` containing detailed endpoint documentation, payloads, and curl examples for all microservices.
- Update [README.md]
@Sympol Sympol merged commit a71159a into main Feb 1, 2026
2 checks passed
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.

1 participant