azure-spring-boot-samples icon indicating copy to clipboard operation
azure-spring-boot-samples copied to clipboard

[QUERY]Stick one EventHub consumer to read a specific partition from AEH using spring-messaging-azure-eventhubs SDK

Open hpunjan1 opened this issue 2 years ago • 2 comments

Query/Question How can we stick one EventHub consumer instance to read a specific partition from Azure EventHub with using the Spring Azure EventHub SK- spring-messaging-azure-eventhubs 4.1.0? Our current codebase is based on this:

  • We have multiple instances of consumer process running reading from same EventHub with 10 partitions and 1 consumer group.
  • We checkpoint manually into separate storage account containers.
  • It is working fine but since we checkpoint for individual event hub partitions in separate container locations and our consumers can start/stop randomly, multiple consumers potentially read from older checkpoints and reload the same data, resulting in duplicates. Because of this issue, we want to stick each consumer to particular partition
  • We have 10 partitions on our event hub

Why is this not a Bug or a feature Request? We are already using the Spring Azure EventHub SDK open-sourced by Microsoft. We only have a query related to the SDK usage.

Setup (please complete the following information if applicable):

  • OS: Linux
  • IDE: Eclipse
  • Library/Libraries: spring-messaging-azure-eventhubs version 4.1.0

hpunjan1 avatar Sep 12 '23 23:09 hpunjan1

Hi @hpunjan1 , thanks for reaching out. spring-messaging-azure-eventhubs using EventProcessorClient, which is self-balancing, does not support sticking to a particular partition.

Netyyyy avatar Sep 13 '23 06:09 Netyyyy

Hi, Thanks for your reply.

What flavor of Spring integration would support BOTH?

  • specifying a particular partition per consumer
  • specifying a particular offset to read from that partition

hpunjan1 avatar Sep 13 '23 16:09 hpunjan1