Hi to everyone,
currently I try to incorporate EmbeddedHiveMQ into another application.
What I want to use is in-memory persistence. So, according to the Community Edition Github README I excluded rocksdb (I use gradle’s ShadowJar
plugin to get a shaded version of HiveMQ-CE as a single JAR archive):
plugins {
id 'java-library'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
// https://imperceptiblethoughts.com/shadow/
shadowJar {
archiveBaseName.set('hivemq-ce-embedded-shaded' + '-no-rocksdb')
archiveClassifier.set('')
dependencies {
exclude(dependency('org.rocksdb:rocksdbjni'))
exclude(dependency('ch.qos.logback:logback-classic'))
}
}
Consistently I start my embedded broker as recommended by the README:
try (final EmbeddedHiveMQ hiveMQ = embeddedHiveMQBuilder.build()) {
InternalConfigurations.PAYLOAD_PERSISTENCE_TYPE.set(PersistenceType.FILE);
InternalConfigurations.RETAINED_MESSAGE_PERSISTENCE_TYPE.set(PersistenceType.FILE);
hiveMQ.start().join();
...
} catch (final Exception ex) {
ex.printStackTrace();
}
Nevertheless I get an exception thrown during startup:
!STACK 0
java.lang.NoClassDefFoundError: org/rocksdb/CompressionType
at com.hivemq.configuration.service.InternalConfigurations.<clinit>(InternalConfigurations.java:296)
...
Caused by: java.lang.ClassNotFoundException: org.rocksdb.CompressionType cannot be found by ...
...
Did I miss something?
Best regards,
janosch