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

EventProcessorHost, IEventProcessorFactory and IEventProcessor crash handling: can just instantiate new ones?

$
0
0

Hi!

Should there be extra precautions taken against crashing of EventProcessorHost,IEventProcessor and IEventProcessor? Can I just resume processing eventsas usual as soon as a new EventProcessorHost will be instantiated in case either of both of the variableshost and factory should crash or become garbage collected for some reason. What ifIEventProcessor derived class crashes, say, in ProcessEventsAsync(PartitionContext context, IEnumerable<EventData> messages), will just a new one be instantiated?

The custom IEventProcessorFactory implementation and a custom IEventProcessor implementation instantantiation are scetched as follows

var host = new EventProcessorHost(
                hostName,
                eventHubName,
                consumerGroupName,
                eventHubConnectionString,
                storageConnectionString, eventHubName.ToLowerInvariant());

var factory = new CustomEventProcessorFactory(hostName);
await host.RegisterEventProcessorFactoryAsync(factory);

public IEventProcessor CreateEventProcessor(PartitionContext context)
        {
            var processor = new CustomProcessor();
            return processor;
        }


Sudet ulvovat -- karavaani kulkee



Viewing all articles
Browse latest Browse all 1916

Trending Articles



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