* Add kafka eventbus to Catalog, Ordering and Payment. Only catalog is confirmed to work, I think the ordering background service and payment are still subscribing to rabbitMQ for some reason (needs more investigation) * Fix kafka consumer group ids. * Fix build problems (duplicate package + lower version) All services seem to use Kafka now, but it seems like kafka takes to long to start up and the services fail to connect to the borkers (either we have to do retries similar like rabbitmq) or we are going to enforce the execution order in docker compose by using something like healthchecks. * Add kafka broker dependency for other services. Still have bug in eventBus subscription because for example the ordering service should handle a UserCheckoutAccepted event put it does have no subscription for it when such an event is published to the Kafka topic: ``` src-ordering-api-1 | [15:04:42 WRN] No subscription for Kafka event: UserCheckoutAccepted src-ordering-api-1 | Consumed event: UserCheckoutAccepted src-ordering-api-1 | Content: 632B63DB0CE145D499FE01904F76A475 ``` * Add logging for subscription manager problem. Seems like the subscription manager is not used correctly in the kafka eventbus (two different objects?). * add printing handlers * actually trigger printing handlers * add kafkapersistentconnection registration * Revert "add kafkapersistentconnection registration" This reverts commit 704ee3e36f09f3f3ad48057de31996654a8e3894. * add allowAutoCreateTopics in consumers (different than default) and in producers (just to be explicit) * register DefaultKafkaPersistentConnection in ordering.backgroundtasks * remove noise in logs * Make eventNames in kafka eventbus consistent. Do not remove IntegrationEventSuffix, before this change the subscription handlers and eventNames did not match. * Create kafka admin background service to create empty topic. We have to create the eshop_event_bus kafka topic on startup, because otherwise the consumer of the microservices would fail. --------- Co-authored-by: Philipp Theyssen <p.theyssen@gmail.com> Co-authored-by: Philipp Theyssen <34607877+PTheyssen@users.noreply.github.com>
23 lines
466 B
JSON
23 lines
466 B
JSON
{
|
|
"Logging": {
|
|
"IncludeScopes": false,
|
|
"LogLevel": {
|
|
"Default": "Debug",
|
|
"System": "Information",
|
|
"Microsoft": "Information"
|
|
}
|
|
},
|
|
"KafkaEnabled": true,
|
|
"Kafka": {
|
|
"ProducerSettings": {
|
|
"BootstrapServers": "broker:9092",
|
|
"AllowAutoCreateTopics": true
|
|
},
|
|
"ConsumerSettings": {
|
|
"BootstrapServers": "broker:9092",
|
|
"GroupId": "payment-group-id",
|
|
"AllowAutoCreateTopics": true
|
|
}
|
|
}
|
|
}
|