Skip to content

Solace Container

This module helps running Solace PubSub+ using Testcontainers.

Note that it's based on the official Docker image.

Usage example

You can start a solace container instance from any Java application by using:

SolaceContainer solaceContainer = new SolaceContainer("solace/solace-pubsub-standard:10.2")
    .withCredentials("user", "pass")
    .withTopic("Topic/ActualTopic", Service.SMF)
    .withVpn("test_vpn")
SolaceContainer solaceContainer = new SolaceContainer("solace/solace-pubsub-standard:10.2")
    .withClientCert(
        MountableFile.forClasspathResource("solace.pem"),
        MountableFile.forClasspathResource("rootCA.crt")
    )
    .withTopic("Topic/ActualTopic", Service.SMF_SSL)
Session session = createSession(
    solaceContainer.getUsername(),
    solaceContainer.getPassword(),
    solaceContainer.getOrigin(Service.AMQP)
);

Adding this module to your project dependencies

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

testImplementation "org.testcontainers:solace:1.19.0"
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>solace</artifactId>
    <version>1.19.0</version>
    <scope>test</scope>
</dependency>