asp.netapache-kafkamasstransit

How to Isolate Developers' Kafka Message Consumption in MassTransit Without Using Temporary Topics?


We are using MassTransit to consume Kafka messages in our application. However, we've encountered an issue where different service instances on developers' machines consume each other's messages during testing. To avoid this, developers have been defining temporary topics for isolation.

Is there a more efficient solution that doesn't require defining these temporary topics?

Update

kfc.TopicEndpoint<string, OrderMessage>("order-request", Guid.NewId().ToString(), e =>
{
   e.ConfigureConsumer<OrderMessageConsumer>(context);
});

Solution

  • Either don't share the same Kafka broker (run it locally in Docker) for testing, or you'll need separate topics for each developer.