Skip to content

HiveMQ Testcontainer 1.3.0 Released

by HiveMQ Team
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");

HiveMQ Team

The HiveMQ team loves writing about MQTT, Sparkplug, Industrial IoT, protocols, how to deploy our platform, and more. We focus on industries ranging from energy, to transportation and logistics, to automotive manufacturing. Our experts are here to help, contact us with any questions.

HiveMQ logo
Review HiveMQ on G2