Closed jrauschenbusch closed 5 years ago
I think this is really a good point to be covered in this module. Even I was looking for something similar to this. I'm planning to checkpoint the messages whenever the eventprocessor host instance stops all of a sudden. But I'm not sure on how I can get to know that the shutdown has happened. for example: notify about the shutdown through any event or any error type. Something similar to IEventProcessor.onClose/IEventProcessor.CloseAsync in dotnet eventprocessorhost lib
@jrauschenbusch, @vaish1707 Thanks for reporting and apologies in the delay for responding to this issue.
The start()
method takes a onError
handler as well. My assumption is that the callback you provide here is called for any error that occurs in the EPH. Will this not suffice for you to be notified of any issues with the EPH?
Sure. I'll check that. @ramya-rao-a Is it possible that you can help me out with the other issue that I have raised ? https://github.com/Azure/azure-event-hubs-node/issues/210 .
Closing this issue as the user provided onError
handler is indeed called for any error during event processing.
Is your feature request related to a problem? Please describe. To enable the state handling of multiple EPH instances inside an application it would be great to have the opportunity to get notified as soon as an EPH instance is getting stopped to whatever reason (e.g. error during partition management, removal of an EventHub, etc.)
Describe the solution you'd like An additional
onClose()
oronShutdown()
handler signature inside theFromTokenProviderOptions
API. Maybe the passed parameter could be an enumerated CloseReason.Maybe
_context.partitionManager._runTask.then(() => ...)
is the right place for this feature.Describe alternatives you've considered The returned Promise of the start() method is not sufficient as it only indicates that the EPH has started properly.