Since testcontainers-go :material-tag: v0.23.0
The Testcontainers module for Artemis.
Please run the following command to add the Artemis module to your Go dependencies:
go get github.com/testcontainers/testcontainers-go/modules/artemis
Creating and connecting to an Artemis container inside_block:ExampleRunContainer
The Artemis module exposes one entrypoint function to create the Artemis container, and this function receives two parameters:
func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Container, error)
context.Context
, the Go context.testcontainers.ContainerCustomizer
, a variadic argument for passing options.
When starting the Artemis container, you can pass options in a variadic way to configure it.
If you need to set a different Artemis Docker image, you can use testcontainers.WithImage
with a valid Docker image
for Artemis. E.g. testcontainers.WithImage("docker.io/apache/activemq-artemis:2.30.0")
.
If you need to set a different wait strategy for Artemis, you can use testcontainers.WithWaitStrategy
with a valid wait strategy
for Artemis.
!!!info The default deadline for the wait strategy is 60 seconds.
At the same time, it's possible to set a wait strategy and a custom deadline with testcontainers.WithWaitStrategyAndDeadline
.
If you need to change the default admin credentials (i.e. artemis:artemis
) use WithCredentials
.
With credentials inside_block:withCredentials
If you need to enable anonymous logins (which are disabled by default) use WithAnonymousLogin
.
With Anonymous Login inside_block:withAnonymousLogin
If you need to pass custom arguments to the artemis create
command, use WithExtraArgs
.
The default is --http-host 0.0.0.0 --relax-jolokia
.
Setting this value will override the default.
See the documentation on artemis create
for available options.
With Extra Arguments inside_block:withExtraArgs
If you need an advanced configuration for Artemis, you can leverage the following Docker type modifiers:
testcontainers.WithConfigModifier
testcontainers.WithHostConfigModifier
testcontainers.WithEndpointSettingsModifier
Please read the Create containers: Advanced Settings documentation for more information.
The Artemis container exposes the following methods:
User returns the administrator username.
Retrieving the Administrator User inside_block:containerUser
Password returns the administrator password.
Retrieving the Administrator Password inside_block:containerPassword
BrokerEndpoint returns the host:port for the combined protocols endpoint.
Get broker endpoint inside_block:brokerEndpoint
ConsoleURL returns the URL for the management console.
Get console URL inside_block:consoleURL