1

We're using MassTransit with Kafka for simple service-to-service communication. A service might read hundreds of records from a source and publish ("produce") the corresponding messages to Kafka.

On app startup, we configure the Kafka rider (AddMassTransit() -> AddRider() -> UsingKafka()), build the host, and call host.RunAsync().

If there's a Kafka connectivity issue, whether because of failed authentication, or because the Kafka cluster is down, or due to some other error, we don't want to attempt producing each message with the same failure outcome.

What would be a good (and ideally simple) approach to checking connectivity first, and how would I implement it with MassTransit?

I've searched online for health check setup and usage in MassTransit, but didn't come across Kafka-specific examples, and non-Kafka examples were harder to piece together for a Kafka / MassTransit newbie.

Thank you.

EDIT: It would be more helpful if responses weren't produced by AI. The reason I posted this question on Stackoverflow in the first place is because AI had given me incorrect information.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.