/microservices-java-kafka

Project work for the course Learn how to create microservices that are based on CQRS & Event Sourcing. Powered by Spring Boot and Apache Kafka.

Primary LanguageJava

CQRS & Event Sourcing w/ Spring Boot and Apache Kafka.

This is the case study project built during the course Learn how to create microservices that are based on CQRS & Event Sourcing. Powered by Spring Boot and Apache Kafka.

Tools

Use Visual Studio code with remote containers extension - a configuration is included in this repository.

Visual Studio Code workspace layout

Debug and test

Limitations and disclaimer

This is only a case-study for practicing the concepts - it is not production ready in any way.

For example, publishing events is done in not transactional way (e.g., there is no Outbox pattern implemented).

You probably want to use existing libraries or frameworks for doing proper CQRS applications, see this video for ideas.

TODO

  • Error handling is missing - using a central ControllerAdvice makes sense
  • Unit and integrations are missing - yep, sadly the course was not supporting automatic testing but it should not be a problem to retrofit these.
    • integration tests are the most difficult since there are many moving pieces around
    • unit tests should be easy to do

References

CQRS is a technical architecture for supporting Domain-Driven Design, so you may want to dive deep in this approach and understand its consequences. Besides google'ing and watching videos, you may want to read the following:

  • Domain Driven Design - this is the historical book from Eric Evans, it is not really practical but still valuable.
  • Learning Domain-Driven Design - this is a great summary, connecting the business modelling and architectural implementation with a lot of examples. It is not providing you with a ready-to-use solution but it gives you the needed high-level views for understanding how business agility and software architectures relates in the DDD context.