An Azure real-time data ingestion service.
Welcome to Microsoft Q&A,
@Mahendra Sawarkar I hope you are doing well,
The higher outgoing message count does not necessarily mean Event Hubs is generating duplicate messages. Since you are consuming through the Kafka protocol, I would first check the consumer offset and rebalance behavior.
Event Hubs provides at-least-once delivery, so a record can be delivered again if the consumer loses its partition assignment or the offset is not committed after processing.
Since partition assignment is automatic, I recommend checking:
- Make sure all consumer threads that should share the workload use the same
group.id. - Check for frequent consumer rebalances.
- Review
max.poll.interval.msif message processing takes significant time. - Verify your offset commit configuration (
enable.auto.commit,commitSync, orcommitAsync) and ensure offsets are not committed before processing completes. - Log the Event Hubs/Kafka
partitionandoffsetfor each processed record. If the same partition/offset is processed multiple times, that confirms reprocessing rather than new messages.
Also, having one consumer thread per partition is not inherently incorrect. Kafka will assign the partitions automatically within the consumer group.
Microsoft documentation: https://learn.microsoft.com/en-us/azure/event-hubs/azure-event-hubs-apache-kafka-overview https://learn.microsoft.com/en-us/azure/event-hubs/apache-kafka-configurations https://learn.microsoft.com/en-us/azure/event-hubs/apache-kafka-troubleshooting-guide