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

Feature: Implement Azure Event Hubs #713

Open
megamaster4 opened this issue Oct 10, 2024 · 2 comments
Open

Feature: Implement Azure Event Hubs #713

megamaster4 opened this issue Oct 10, 2024 · 2 comments

Comments

@megamaster4
Copy link

megamaster4 commented Oct 10, 2024

What are you trying to do?
Since the 11th of June, it is possible to emulate azure eventhubs. The intention of this enhancement is to implement an Azure Event Hubs test container to facilitate local development and testing of applications that interact with Azure Event Hubs. This allows developers to simulate the behavior of Azure Event Hubs without needing access to the actual cloud service, thereby improving development efficiency and reducing costs.

Why should it be done this way?
Benefits of a feature as such, are comparable to the other testcontainer modules;

  1. Cost Efficiency
    • Developers can test their applications locally without incurring costs associated with using the actual Azure Event Hubs service.
  2. Isolation & Consistancy
    • It allows for isolated and consistent testing environments
  3. Offline development
    • Enables development and testing in environments without internet access

Beside the benefits, it is not that trivial to set it up with the generic containers as it needs some dependencies like a checkpoint storage in the form of an Azurite container.

Other references:
See:

  • An overview of the newly implemented azure eventhub emulator
  • An explaination on how to facilitate the emulator on your local machine
  • An example for python
@megamaster4
Copy link
Author

Additional Information
I tried implementing a similar structure as in the Selenium container, which also depends on a secondary container. This is necessary for Azure Event Hubs since it uses a storage account (Azurite) as checkpoint storage. However, when running the containers, I'm encountering the following error message:

azure.eventhub.exceptions.ConnectError: Failed to initiate the connection due to exception: [WinError 1225] The remote computer refused the network connection
Error condition: ErrorCondition.SocketError

I attempted to run the Docker Compose file directly with docker-compose, and it worked fine. The only difference I notice with my Testcontainer variant is the usage of internal IPs. When running docker-compose, it uses the same internal IP addresses as the exposed ones. I believe that the emulator still needs these internal IPs to be the same.

Request for Assistance
Does anyone have suggestions on how to resolve this issue? Any guidance would be greatly appreciated. Thanks in advance!

@nagyesta
Copy link

nagyesta commented Dec 9, 2024

Hi @megamaster4 ,
just ran into this thread by accident. I think the host/IP should not be that important, because the two config variables look pretty flexible for me based on this official config: https://github.com/Azure/azure-event-hubs-emulator-installer/blob/main/Docker-Compose-Template/docker-compose-custom-ports-linux.yml#L13-L14

I am not promising that I will know the answer, but sharing some more details might help someone to realize what the issue is...

  • Would it be possible for you to share the compose you tried to use (or replicate with configuration) as an example?
  • Also, when you said, that the Testcontainer variant used internal IPs and that was different than the original case. Could you please somehow illustrate this? What did you see exactly in one case or the other?

Thank you in advance!

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

No branches or pull requests

3 participants