[ Web Proxy ]
URL:
Viewing: https://java.testcontainers.org/supported_docker_environment/../../features/../../modules/activemq/ [Back]  [Original]

ActiveMQ - Testcontainers for Java
Skip to content
Testcontainers [Testcontainers] Menu
testcontainers-java
Content

ActiveMQ

Testcontainers module for ActiveMQ and Artemis.

ActiveMQContainer's usage examples

You can start an ActiveMQ Classic container instance from any Java application by using:

Default ActiveMQ container
ActiveMQContainer activemq = new ActiveMQContainer("apache/activemq:5.18.7")

With custom credentials:

Setting custom credentials
ActiveMQContainer activemq = new ActiveMQContainer("apache/activemq:5.18.7")
    .withUser("testcontainers")
    .withPassword("testcontainers")

ArtemisContainer's usage examples

You can start an ActiveMQ Artemis container instance from any Java application by using:

Default Artemis container
ArtemisContainer artemis = new ArtemisContainer("apache/activemq-artemis:2.32.0-alpine")

With custom credentials:

Setting custom credentials
ArtemisContainer artemis = new ArtemisContainer("apache/activemq-artemis:2.32.0-alpine")
    .withUser("testcontainers")
    .withPassword("testcontainers")

With anonymous login:

Allow anonymous login
ArtemisContainer artemis = new ArtemisContainer("apache/activemq-artemis:2.32.0-alpine")
    .withEnv("ANONYMOUS_LOGIN", "true")

Adding this module to your project dependencies

Add the following dependency to your pom.xml/build.gradle file:

GradleMaven
testImplementation "org.testcontainers:testcontainers-activemq:2.0.5"
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>testcontainers-activemq</artifactId>
    <version>2.0.5</version>
    <scope>test</scope>
</dependency>

Web Proxy Viewer  |  New URL  |  Original Page