Skip to content

HiveMQ Testcontainer 1.3.0 Released

by Yannick Weber
2 min read

The HiveMQ team is pleased to announce the release of HiveMQ Testcontainer 1.3.0. This new version adds the following features:

  • Loading of Gradle-based HiveMQ Extensions

  • API for removing prepacked HiveMQ Extensions

Load an extension from a gradle project

You can package and load an extension from a Gradle project, by providing the location of the Gradle project:

JUnit 4

@Rule
public final @NotNull HiveMQTestContainerRule rule =
    new HiveMQTestContainerRule()
        .withExtension(new GradleHiveMQExtensionSupplier(new File("path/to/extension/")).get());

JUnit 5

@RegisterExtension
public final @NotNull HiveMQTestContainerExtension extension =
  new HiveMQTestContainerExtension()
      .withExtension(new GradleHiveMQExtensionSupplier(new File("path/to/extension/")).get());

If your current project is the HiveMQ Extension you want to load into the HiveMQ Testcontainer, you can simply use:

GradleHiveMQExtensionSupplier.direct()

Remove prepackaged HiveMQ Extensions

Since HiveMQ’s 4.4 release, HiveMQ Docker images come with the HiveMQ Extension for Kafka, the HiveMQ Enterprise Bridge Extension and the HiveMQ Enterprise Security Extension. These Extensions are disabled by default, but sometimes you may need to remove them before the container starts.

JUnit4

Remove all prepackaged extensions:

@Rule
final HiveMQTestContainerRule container = new HiveMQTestContainerRule("hivemq/hivemq4", "4.4.4")
    .withoutPrepackagedExtensions();

Remove specific prepackaged extensions:

@Rule
final HiveMQTestContainerRule container = new HiveMQTestContainerRule("hivemq/hivemq4", "4.4.4")
    .withoutPrepackagedExtensions("hivemq-kafka-extension");

JUnit5

Remove all prepackaged extensions:

@RegisterExtension
final HiveMQTestContainerExtension container = new HiveMQTestContainerExtension("hivemq/hivemq4", "4.4.4")
    .withoutPrepackagedExtensions();

Remove specific prepackaged extensions:

@RegisterExtension
final HiveMQTestContainerExtension container = new HiveMQTestContainerExtension("hivemq/hivemq4", "4.4.4")
    .withoutPrepackagedExtensions("hivemq-kafka-extension");

Yannick Weber

Yannick is a Senior Software Engineer and one of the core members of HiveMQ's product development team. He has a strong interest in messaging technologies and is focusing on quality development of HiveMQ's many tools and extensions. In addition, he is the maintainer of the HiveMQ module in the testcontainers-java project.

  • Contact Yannick Weber via e-mail
HiveMQ logo
Review HiveMQ on G2