feat: Add Event Hub Subscriber support#227
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds Event Hub subscriber support to the Azure Event Grid Simulator, enabling events to be delivered to Azure Event Hubs alongside existing HTTP, Service Bus, and Storage Queue delivery mechanisms.
Key Changes:
- Added Event Hub delivery service with connection pooling and proper resource disposal
- Implemented comprehensive validation for Event Hub subscriber settings with support for topic-level connection string inheritance
- Extended Docker compose setup to include Azure Event Hubs emulator for local testing
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Directory.Packages.props | Added Azure.Messaging.EventHubs package dependency (v5.12.2) |
| src/AzureEventGridSimulator/Program.cs | Registered EventHubEventDeliveryService and added subscriber logging on startup |
| src/AzureEventGridSimulator/Infrastructure/Settings/TopicSettings.cs | Added Event Hub connection string and namespace credential properties for topic-level defaults |
| src/AzureEventGridSimulator/Infrastructure/Settings/Subscribers/SubscribersSettingsConverter.cs | Extended JSON converter to support eventHub array deserialization |
| src/AzureEventGridSimulator/Infrastructure/Settings/Subscribers/SubscribersSettings.cs | Added EventHub property and EventHubSubscribers enumerable to subscriber collection |
| src/AzureEventGridSimulator/Infrastructure/Settings/Subscribers/EventHubSubscriberSettings.cs | New settings class with validation, connection string inheritance, and effective connection string resolution |
| src/AzureEventGridSimulator/Infrastructure/Settings/SimulatorSettings.cs | Added parent topic assignment for Event Hub subscribers during validation |
| src/AzureEventGridSimulator/Domain/Services/Retry/RetryDeliveryBackgroundService.cs | Added DeliverToEventHubAsync method for retry delivery support |
| src/AzureEventGridSimulator/Domain/Services/Delivery/EventHubEventDeliveryService.cs | New delivery service implementing event serialization, producer client pooling, and Event Hub message sending |
| src/AzureEventGridSimulator/Domain/Entities/DeliveryOutcome.cs | Added EventHubError outcome type |
| src/AzureEventGridSimulator/Domain/Commands/SendNotificationEventsToSubscriberCommandHandler.cs | Added debug logging for all subscriber types |
| src/AzureEventGridSimulator/AzureEventGridSimulator.csproj | Added package reference for Azure.Messaging.EventHubs |
| src/AzureEventGridSimulator.Tests/appsettings.test.json | Updated test configuration to use new grouped subscriber format with Event Hub example |
| src/AzureEventGridSimulator.Tests/UnitTests/Subscribers/Validation/EventHubSubscriberSettingsValidationTests.cs | Comprehensive validation tests covering all authentication scenarios and error cases |
| src/AzureEventGridSimulator.Tests/UnitTests/Subscribers/Delivery/EventHubEventDeliveryServiceTests.cs | Unit tests for delivery service covering schema formatting, property resolution, and error handling |
| src/AzureEventGridSimulator.Tests/UnitTests/Configuration/ConfigurationLoadingTests.cs | Added test for Event Hub subscriber deserialization via IConfiguration binding |
| docker/rebuild.ps1 | New PowerShell script for rebuilding Docker Compose stack |
| docker/eventhub-config.json | Configuration file for Azure Event Hubs emulator |
| docker/docker-compose.yml | Added Event Hubs emulator service with Azurite dependency |
| docker/appsettings.docker.json | Added Event Hub subscriber example configuration |
| README.md | Updated documentation with Event Hub subscriber settings, examples, and emulator information |
| AGENTS.md | Updated developer documentation to include Event Hub support and configuration examples |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.