Hello,
I have strange problem while starting embedded MQTT broker by my application, when all dependencies are packed inside a fat jar created by gradle.
2024-06-11 10:16:06,707 INFO - Starting EmbeddedHiveMQ.
2024-06-11 10:16:06,713 INFO - HiveMQ version: Development Snapshot
[2024-06-11 10:16:09] [SEVERE] | (log.LogManager debugLog) | java.util.concurrent.CompletionException -> java.nio.file.InvalidPathException: Illegal char <:> at index 4: file:\C:\Program Files\Server\Server.jar!\BOOT-INF\lib\hivemq-community-edition-embedded-2024.5.jar!\extensions
Stack Trace:
at java.util.concurrent.CompletableFuture.reportJoin(null:-1)
at java.util.concurrent.CompletableFuture.join(null:-1)
at com.client_server.server.launcher.MqttBroker.start(MqttBroker.java:71)
at com.client_server.server.launcher.Launcher.startServer(Launcher.java:8685)
at com.client_server.server.launcher.Launcher$51$1.run(Launcher.java:2565)
at java.lang.Thread.run(null:-1)
|
my code to configure and start broker looks like this:
EmbeddedExtension mqttMessageInterceptorExtension = EmbeddedExtension.builder().withId("MqttMessageInterceptor").withName("Mqtt Message Interceptor").withVersion("1.0.0").withPriority(0).withStartPriority(1000)
.withAuthor("author").withExtensionMain(new MqttMessageInterceptorExtension()).build();
EmbeddedHiveMQBuilder embeddedHiveMQBuilder = EmbeddedHiveMQ.builder().withConfigurationFolder(Path.of(conf)).withDataFolder(Path.of(data))
.withEmbeddedExtension(mqttMessageInterceptorExtension);
EmbeddedHiveMQ broker = embeddedHiveMQBuilder.build();
broker.start().join();
The same works without issues, when hivemq libraries are outside the fat jar and they are listed with Class-Path at the jar MANIFEST.
I will appreciate any tip, how to solve the problem.
Thank you in advance!
Marcin