I have events of different types. For example, some data is telemetry data, some is error information etc.
I thought it would be a good idea to create several IEventProcessor implementations, one for each event type. So each implementation will handle the event differently. Like writing to file or to database.
What's the best way to route events to a specific EventProcessor?
- Should I let an EventProcessor monitor a specific partitionkey and if so, how?
- Should I use the constructor of the EventProcessorHost that lets me specify a consumergroupname? If so, how can I send to a specific consumergroup using the EventHubClient? I do not see an option to specify a consumergroup there.
- Should I do none of the above and just check an incoming eventdata for a specific property and just ignore the ones that I am not interested in?
I must say that I find the relation between partitionkey and consumergroup (if there is any) badly documented.
I've used option 2 but so far each EventProcessor get messages from all the consumergroupnames, not just the one specified in the EventProcessorHost constructor.