0
votes

I am trying to use Azure EventHub in order to process messages and it works fine as long as I have one sender and one consumer.

I simple make my consumer listen to a specific Consumer Grooup and all is fine

Now the problem is when I send different types of messages that I want processed by different Consumer Group I dont see how that can be done

I am creating my sender like this

private static EventHubProducerClient eventHubClient = new EventHubProducerClient(eventHubConnectionString, eventHubName);

But I find no way to tell it what Consumer Group it should send to, it simple sends to hub itself and that hub has multiple resource groups

How do I decide what consumergroup gets this message?

I googled for hours without finding the way to "map" input messages from specific senders to a specific output Consumer Group

1
resource group? do you mean Consumer group?Ivan Yang
Yes sorry I edited the questionMatt Douhan
Actually, you cannot do that if you know what's consumer group. Messages are sent to partitions, partitions are included in each consumer group.Ivan Yang
OK but the same problem persists, how do I know what partition a message is send to and how do I know what partition a consumer group is in?Matt Douhan

1 Answers

0
votes

You cannot specify which message is sent to a specified Consumer group. Messages are sent to partitions, partitions are all included in each consumer group, you can check the diagram in this doc. The screenshot as below:

enter image description here

Now for you question: when I send different types of messages that I want processed by different Consumer Group I dont see how that can be done.

As a workaround, when you send messages, you can specify a property for each message. When read these messages from consumer group, you can also use the property to determine if you want to process it or abandon it.

Hope it helps.