Currently, we have a work role which contains 2 instances for Publish to azure, will the 2 instances get the same data from the event hub when run it in azure VM? if not, it isdistinguished by the host name or consumer group name?
public override void Run()
{
var eventHubName = "testhub";
var eventHubConnectionString = GetEventHubConnectionString();
EventHubClient eventHubClient = EventHubClient.CreateFromConnectionString(eventHubConnectionString, eventHubName);
// Get the default Consumer Group
var defaultConsumerGroup = eventHubClient.GetDefaultConsumerGroup();
var eventProcessorHost = new EventProcessorHost(
"host",
eventHubClient.Path,
defaultConsumerGroup.GroupName,
eventHubConnectionString,
GetStorageConnectionString());
eventProcessorHost.RegisterEventProcessorAsync<SimpleEventProcessor>().Wait();
}
this is our work role code, and I publish to azure, from the result, I got the same data twice.