Skip to content

RabbitMQ AMQP port is random #7721

Answered by cobar79
cobar79 asked this question in Q&A
Oct 25, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

JUnit 5 5.9.3
Testcontainers 1.19.1
Manually starting? yes
Lifecycle container? @testcontainers()

The localstack container defined in an individual test class in another microservice was working with @Containter and @DynamicPropertySource.

Well after hours of debugging I noticed when I changed from @container to static blocks because RabbitMQ has static ports in their class so I was exposing ports and doing port bindings, the @DynamicPropertySource ended up between multiple static blocks. When I moved the ```@DynamicPropertySrouce`` after the static blocks it worked. Rookie mistake.

I since have gone back to @Container for all the containers except the RabbitMQ container.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@cobar79
Comment options

@eddumelendez
Comment options

@cobar79
Comment options

Answer selected by cobar79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants