Home

ActiveMQ

qianmoQqianmoQ· 更新于 2026-10-13· 阅读 4 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

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>

评论

登录后参与评论

正在加载评论…