Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Azure EventHubs module #1342

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from

Conversation

rafek1241
Copy link

@rafek1241 rafek1241 commented Jan 18, 2025

First version of PR was made by @WakaToa at #1183

What does this PR do?

Add support for Azure EventHubs emulator.

Info

You need to provide an Azurite (emulator) instance/endpoint to start the EventHub emulator. This can be done using the EventHubsConfiguration.

You need to specify the following configuration file when starting the emulator.

{
  "UserConfig": {
    "NamespaceConfig": [
      {
        "Type": "EventHub",
        "Name": "emulatorNs1",
        "Entities": [
          {
            "Name": "eh1",
            "PartitionCount": "2",
            "ConsumerGroups": [
              {
                "Name": "cg1"
              }
            ]
          }
        ]
      }
    ], 
    "LoggingConfig": {
      "Type": "File"
    }
  }
}

It will be dynamically mapped and i have built a floating builder so that the user can set the configuration as easily as possible.
The namespace "emulatorNs1" is mandatory and it is the only one currently supported by the emulator.

var configurationBuilder = ConfigurationBuilder
    .Create()
    .WithEventHub(EventHubName, "2", new[] { EventHubConsumerGroupName });

var builder = new EventHubsBuilder()
        .WithAcceptLicenseAgreement(true)
        .WithConfigurationBuilder(ConfigurationBuilder);

_eventHubsContainer = builder.Build();

await _eventHubsContainer.StartAsync();

Copy link

netlify bot commented Jan 18, 2025

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit 0758827
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/678c07bd923b010008ef2c5a
😎 Deploy Preview https://deploy-preview-1342--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rafek1241
Copy link
Author

rafek1241 commented Jan 18, 2025

TODO:

  • create test case for existing azurite externally added WithAzurite(...).
  • Fix issues in tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants