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

The right way for the EventProcessorHost to consume messsages from EventHub?

$
0
0
  1. In our Cloud Service project, we have 2 instances for work role (deploy to Azure), the work role is consume events from the EventHub using EventProcessorHost, sowe use the Guid as the HostName, is it right?  If we use the hard code Host name (like “testhost”), it will got the same events for the two instances.
  2. For the CheckpointAsync()method from the PartitionContext Class

///<summary>

/// Checkpoints progress of an Event Hubs message stream. Make sure to call this method once all the messages in a batch are processed.

///</summary>

    ///

    ///<returns>

    /// The task representing the asynchronous operation.

///</returns>

publicTask CheckpointAsync();

Could we do not set the time span for it, we call it when we processed a batch messages? Like:

Does it affect the Performance?

        publicasyncTask ProcessEventsAsync(PartitionContext context, IEnumerable<EventData> events)

        {

           if (events !=null&& events.ToList().Any())

            {

               // handle the messages

            }

           await context.CheckpointAsync();

}


Viewing all articles
Browse latest Browse all 1916

Trending Articles



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