Skip to content

Conversation

@maliming
Copy link
Member

@maliming maliming commented Dec 7, 2025

Resolves #24340

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances Kafka event publishing reliability by implementing stronger guarantees for message delivery and adding validation to detect failures. The changes focus on ensuring that published events are actually persisted to Kafka before considering the operation successful.

Key Changes:

  • Configured Kafka producers with Acks.All and EnableIdempotence=true to prevent message loss and duplicates
  • Added PersistenceStatus validation after publishing events, throwing exceptions on failure instead of silently continuing
  • Changed from fire-and-forget Produce() to awaited ProduceAsync() for proper async/await patterns and error detection

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
ProducerPool.cs Sets default Kafka producer reliability configurations (Acks.All, EnableIdempotence=true) and removes trailing whitespace
KafkaDistributedEventBus.cs Fixes async modifier ordering, validates persistence status after publishing, and changes from synchronous Produce() to asynchronous ProduceAsync() with proper awaiting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

maliming and others added 3 commits December 7, 2025 13:28
…KafkaDistributedEventBus.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…KafkaDistributedEventBus.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…KafkaDistributedEventBus.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@maliming maliming requested a review from EngincanV December 8, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants