I'm trying to move my application from EE8 to EE10 and while ActiveMQ has published a Jakarta-compatible "transition" client, as per my earlier question, I need to run an embedded, OpenWire compatible, broker for some tests.

The official Apache ActiveMQ Artemis project publishes the artemis-jakarta-server, but I'm unable to create a JUnit 5 extension supporting the OpenWire protocol. They also publish an artifact called artemis-junit-5, but this is not Jakarta compatible.

As far as I can tell, the missing piece is a Jakarta compatible artemis-openwire-protocol artifact.

Any ideas?

2

There are 2 best solutions below

0
On BEST ANSWER

I found a solution to my problem, but it doesn't really involve embedding. By utilizing my new favourite tool Testcontainers I was able to remove ActiveMQ server from my classpath, thereby sidestepping the problem entirely. Since there currently is no "official" ActiveMQ Testcontainers library, I created my own using their excellent API.

public class ActiveMQContainer extends GenericContainer<ActiveMQContainer> {

private static final int OPENWIRE_PORT = 61616;
public ActiveMQContainer(Logger logger) {
    this(logger, "5.18.2");
}

public ActiveMQContainer(Logger logger, String version) {
    super(DockerImageName.parse("apache/activemq-classic:" + version));

    setExposedPorts(List.of(OPENWIRE_PORT));
    setLogConsumers(List.of(new Slf4jLogConsumer(logger)));
}

public String getURL() {
    return "tcp://localhost:" + getMappedPort(OPENWIRE_PORT);
}

}

I realize this technically isn't an answer to the question I posed but I feel it's better solution even though it depends on Docker.

0
On

To whom it may concern: turns out, ActiveMQ 6 was released: https://activemq.apache.org/new-features-in-60

This should enable running ActiveMQ 6 embedded but I won't be going back from my Testcontainers solution, with which I'm quite satisfied.