Azure / azure-functions-eventhubs-extension

Event Hubs extension for Azure Functions
MIT License
20 stars 26 forks source link

Dispose EventHubProcessor in EventHubListener #53

Closed alrod closed 4 years ago

alrod commented 4 years ago

We need to dispose EventHubProcessor on EventHubListener disposing. The current behavior can lead to processing messages after EventHubListener is disposed.

https://github.com/Azure/azure-functions-eventhubs-extension/blob/dev/src/Microsoft.Azure.WebJobs.Extensions.EventHubs/Listeners/EventHubListener.cs#L72

alrod commented 4 years ago

I verified that EventProcessor.CloseAsync (https://github.com/Azure/azure-functions-eventhubs-extension/blob/dev/src/Microsoft.Azure.WebJobs.Extensions.EventHubs/Listeners/EventHubListener.cs#L131) before EventHubListener.Dispose (https://github.com/Azure/azure-functions-eventhubs-extension/blob/dev/src/Microsoft.Azure.WebJobs.Extensions.EventHubs/Listeners/EventHubListener.cs#L72). So no changes are needed.