Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Will the instances for a work role which consume messages from an EventHub get the same ?

$
0
0

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.


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>