-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
[Enhancement]: Azure Service Bus emulator #1302
Comments
If I am correct, the Azure Service Bus Emulator is not as straightforward as other modules because it requires a database container as well. Fortunately, we already have a module with similar requirements. I believe we can follow the implementation of our WebDriver module, which also sets up a network, network alias and connects multiple containers together. |
I started to work on the module implementation. |
I'm almost done and ready to create the PR, but unfortunately, I'm running into an issue with the tests. It's something we've encountered before with other Azure client libraries. When I try to send a message to the emulator, it fails and responds with an error message that isn't related to the container instance, but rather to Azure itself (it looks like it sends the request to the wrong endpoint):
testcontainers-dotnet/tests/Testcontainers.ServiceBus.Tests/ServiceBusContainerTest.cs Lines 35 to 36 in 7ef1437
The connection string looks like:
Does someone know to configure the client? |
It looks like this is not necessarily a client issue. If I add an additional delay, the test runs fine. I assume the console log message indicates readiness too early? |
Maybe it need time to create a queue? |
As I see emailtaor use config.json with wheee it define queue. |
I copied the example from MS and changed the queue name 👍, but didn't change anything. |
The MS example docker compose config explicitly uses port 5672 on the host and then no port specified in the connection string. Perhaps the client SDK only works on that port? |
I tried the default port (without a randomly assigned host port) and a connection string without the port as well. Same behavior. Interestingly, it works with the extra delay... |
I've created an upstream issue, right now, I have no idea how to reliably indicate readiness ☝️. |
I created a PR that includes a workaround, which adds an additional two-second wait before indicating readiness. It would be great if someone could review the PR and do some tests to check if the module works as expected 🙏. |
Thank you for creating the PR! I tested the changes on my setup (Docker with Windows 10), and the module works fine for me overall. However, I noticed that the Reuse feature isn't working in my case. I suspect it might be related to the inner MSSQL container. Let me know if you’d like me to share more details or try something specific to help debug this issue. |
Thank you for the tests.
Ah, that makes sense. We do not forward this configuration to the MSSQL container builder. We have the same issue in the WebDriver module. Thank you for bringing this to my attention. I need to think about how we can modify the API to allow forwarding such configurations to the nested builder. |
Just a bit late to the party, I implemented this myself in this integration test and was about to ask if a contribution was appreciated. Let me know if I can be of any help. |
Problem
It’s nice to have Azure Service Bus emulator
Solution
https://learn.microsoft.com/en-us/azure/service-bus-messaging/test-locally-with-service-bus-emulator?tabs=docker-linux-container
And
https://mcr.microsoft.com/en-us/artifact/mar/azure-messaging/servicebus-emulator/about
Benefit
Azure Service Bus emulator - useful for tests
Alternatives
No
Would you like to help contributing this enhancement?
Yes
The text was updated successfully, but these errors were encountered: