Skip to content

Apps declare their Kafka topics and key messages by entity, as in the JVM sample - #325

Draft
oskardudycz wants to merge 2 commits into
e-commerce-shop-pagesfrom
e-commerce-kafka
Draft

oskardudycz wants to merge 2 commits into
e-commerce-shop-pagesfrom
e-commerce-kafka

Conversation

@oskardudycz

Copy link
Copy Markdown
Owner

The Kafka broker in the root Compose file and in the test container no longer creates topics on first use, as in the JVM e-commerce sample. A topic that nobody declared is a configuration mistake, and an auto-created one hides it.

What changes for the apps:

  • Each app that uses Core.Kafka declares the topics it produces to and consumes from, with 3 partitions and 1 replica. Publishing to a topic the producer did not declare fails and names the topic.
  • Each record carries its message type in the __TypeId__ header, as the JVM bus writes it, so the key is free for the entity id. A shopping cart checkout is keyed by its cart (ecommerce.cart.<id>), so all messages about one cart land in one partition, in order.
  • The Helpdesk samples, which have their own producer, declare their topic too.
  • The cross-module hosts in ECommerce.Tests use real Kafka on both sides; the module API tests keep replacing it.

Stacked on #324. Open questions are listed in specs/e-commerce-port/to-discuss.md.

This branch has not been deployed

No deployments
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