-
-
Notifications
You must be signed in to change notification settings - Fork 341
feat: Add Azure Event Hubs module #1342
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
Closed
rafek1241
wants to merge
40
commits into
testcontainers:develop
from
rafek1241:feature/add-azure-event-hubs
Closed
Changes from 29 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
8fe0070
Support Azure EventHubs
WakaToa 3d5c226
Adjust EventHubsConfiguration
WakaToa ebccc8c
Add CPM for Azure.Messaging.EventHubs
WakaToa b264e42
better ordering of package version Azure.Messaging.EventHubs
WakaToa 2503ceb
fix: file-scope namespace
rafek1241 b411706
fix: global using
rafek1241 459dae9
Merge branch 'develop' into feature/add-azure-event-hubs
rafek1241 0ba4f84
feat: use same pattern for EULA license
rafek1241 79d4b40
chore: remove redundant reference to config builder
rafek1241 da84fea
fix: target frameworks
rafek1241 4a1383a
fix: target framework of the test project
rafek1241 87f4d32
chore: small refactor + add docs for better understanding
rafek1241 2c7d413
Revert "chore: remove redundant reference to config builder"
rafek1241 8ca479d
refactor: add validation of configuration builder
rafek1241 6b27965
chore: move waiting strategy to init()
rafek1241 a5116e2
fix: validation
rafek1241 de5d54b
fix: test name and network hardcoded name
rafek1241 99efb2c
feat: implement built-in and configurable azurite docker container in…
rafek1241 2d28534
fix: default namespace name according to documentation
rafek1241 f650ea2
build: workflow
rafek1241 40bd09a
refactor: azurite dependency
rafek1241 0758827
feat: tests to cover custom azurite case
rafek1241 f7121d1
revert: changes copied from PR !1335
rafek1241 a9fe768
refactor: move creation of dependent stuff in build() process
rafek1241 7eabf4e
Merge remote-tracking branch 'upstream/develop' into feature/add-azur…
rafek1241 21637c5
docs: azure eventhubs documentation page
rafek1241 72c6b52
fix: mkdocs
rafek1241 5cfa3d8
fix: docs
rafek1241 58a9dd9
docs: fix module name
rafek1241 c3bf5e0
Merge remote-tracking branch 'origin/develop' into fork/rafek1241/fea…
HofmeisterAn 53150dc
Merge remote-tracking branch 'origin/develop' into fork/rafek1241/fea…
HofmeisterAn 0b03f27
chore: Align EventHubs module implementation
HofmeisterAn cfb21b8
Merge branch 'develop' into feature/add-azure-event-hubs
HofmeisterAn bfe1996
Merge remote-tracking branch 'rafek1241/feature/add-azure-event-hubs'…
HofmeisterAn 34cc45d
chore: Remove WithNetworkAliases
HofmeisterAn d9f4bdc
Merge pull request #1 from testcontainers/fork/rafek1241/feature/add-…
rafek1241 4f932be
fix: format
rafek1241 73e6af7
fix: docs
rafek1241 e9df035
refactor: logic to have service configuration instead of Configuratio…
rafek1241 aee785d
tests(WIP): eventhubs kafka usage example
rafek1241 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Azure EventHubs | ||
|
|
||
| [Azure EventHubs](https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-about) is a native data-streaming service in the cloud that can stream millions of events per second, with low latency, from any source to any destination. Event Hubs is compatible with Apache Kafka. It enables you to run existing Kafka workloads without any code changes. | ||
| In this module, you will learn how to use Testcontainers to start an [Azure EventHubs emulator](https://learn.microsoft.com/en-us/azure/event-hubs/overview-emulator) container for testing. To be able to use the Azure EventHubs emulator, you need to accept the [Microsoft Event Hubs Emulator License](https://github.com/Azure/azure-event-hubs-emulator-installer/blob/main/EMULATOR_EULA.md). | ||
|
|
||
| !!!Warning | ||
|
|
||
| In the official documentation, there are **known limitations** to the Azure EventHubs emulator. You can find it [here](https://learn.microsoft.com/en-us/azure/event-hubs/overview-emulator#known-limitations). | ||
|
|
||
| Add the following dependency to your project file: | ||
|
|
||
| ```shell title="NuGet" | ||
| dotnet add package Testcontainers.EventHubs | ||
| ``` | ||
|
|
||
| You can start a Azure EventHubs emulator instance from any .NET application. Here, we create different container instances and pass them to the base test class. This allows us to test different configurations. | ||
|
|
||
| To create a container instance with minimal configuration, use the following code: | ||
|
|
||
| === "Create initial configuration JSON" | ||
| ```csharp | ||
| --8<-- "tests/Testcontainers.EventHubs.Tests/EventHubsContainerTest.cs:MinimalConfigurationJson" | ||
| ``` | ||
|
|
||
| === "Create Container Instance" | ||
| ```csharp | ||
| --8<-- "tests/Testcontainers.EventHubs.Tests/EventHubsContainerTest.cs:MinimalConfigurationEventHubs" | ||
| ``` | ||
|
|
||
| This example uses xUnit.net's `IAsyncLifetime` interface to manage the lifecycle of the container. The container is started in the `InitializeAsync` method before the test method runs, ensuring that the environment is ready for testing. After the test completes, the container is removed in the `DisposeAsync` method. | ||
|
|
||
| === "Usage Example" | ||
| ```csharp | ||
| --8<-- "tests/Testcontainers.EventHubs.Tests/EventHubsContainerTest.cs:EventHubsUsage" | ||
| ``` |
Oops, something went wrong.
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.