Skip to content

Latest commit

 

History

History
124 lines (77 loc) · 3.86 KB

artemis.md

File metadata and controls

124 lines (77 loc) · 3.86 KB

Apache ActiveMQ Artemis

Since testcontainers-go :material-tag: v0.23.0

Introduction

The Testcontainers module for Artemis.

Adding this module to your project dependencies

Please run the following command to add the Artemis module to your Go dependencies:

go get github.com/testcontainers/testcontainers-go/modules/artemis

Usage example

Creating and connecting to an Artemis container inside_block:ExampleRunContainer

Module reference

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.

Container Options

When starting the Artemis container, you can pass options in a variadic way to configure it.

Image

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").

Wait Strategies

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.

Credentials

If you need to change the default admin credentials (i.e. artemis:artemis) use WithCredentials.

With credentials inside_block:withCredentials

Anonymous Login

If you need to enable anonymous logins (which are disabled by default) use WithAnonymousLogin.

With Anonymous Login inside_block:withAnonymousLogin

Custom Arguments

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

Docker type modifiers

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.

Container Methods

The Artemis container exposes the following methods:

User

User returns the administrator username.

Retrieving the Administrator User inside_block:containerUser

Password

Password returns the administrator password.

Retrieving the Administrator Password inside_block:containerPassword

BrokerEndpoint

BrokerEndpoint returns the host:port for the combined protocols endpoint.

Get broker endpoint inside_block:brokerEndpoint

ConsoleURL

ConsoleURL returns the URL for the management console.

Get console URL inside_block:consoleURL