Using Apache Kafka for event processing
Apache Kafka can be an alternative to using Azure Queue Storage and Azure Event Hubs – especially when it comes to on-premises solutions. This technology is used by many companies in their on-premises environments for high performance application-to-application messaging, supports a scalable multiple producers and consumers environment (like Event Hub), and supports a read-only-once scenario like message queues.
Starting the AppHost with the OnPremises
launch profile will now use the previously created Codebreaker.Bot
. This uses a REST API instead of message queues, replaces the event publishing mechanism of the game-apis
service, and makes the event subscription from ranking-service
use Apache Kafka.
First, we’ll change app-model
.
Configuring Apache Kafka with app-model
To use the Apache Kafka resource with app-model
, we must add the Aspire.Hosting.Kafka
NuGet package:
Codebreaker.AppHost/Program.cs
var kafka...