4.3.2 to 4.3.3 Upgrade Guide
HiveMQ Extensions
Multiple HiveMQ extensions must be upgraded to the latest version when used with HiveMQ 4.3.3.
The affected extensions and their new minimum versions are:
Enterprise Extensions
-
HiveMQ Enterprise Extension for Kafka to version 1.2.1
-
HiveMQ Enterprise Security Extension to version 1.5.2
Open Source Extensions
-
HiveMQ File RBAC Extension to version 4.0.1
-
HiveMQ Heartbeat Extension to version 1.0.2
Custom Extensions
It can be required to adapt custom HiveMQ extensions.
The needed adaptions are:
-
A dependency on the
javax.xml.bind:jaxb-api
package must be changed to thejakarta.xml.bind:jakarta.xml.bind-api
package version2.3.3
or higher. -
A dependency on the
com.sun.xml.bind:jaxb-impl
package must be updated to version2.3.3
or higher. -
A dependency on the
javax.activation:javax.activation-api
package must be changed to thejakarta.activation:jakarta.activation-api
package version1.2.2
or higher. -
A dependency on the
com.sun.activation:javax.activation
must be changed to thecom.sun.activation:jakarta.activation
package version `1.2.2`or higher.
Usage of ByteBuffer in the Extension SDK
The HiveMQ Extension System provides ByteBuffer objects in multiple input parameters. To improve the isolation between extensions, the ByteBuffers are now consistently read-only. Your extensions cannot rely on write access to the ByteBuffer. For example, it is no longer possible to directly access the array inside the ByteBuffer.
public class MySimpleAuthenticator implements SimpleAuthenticator {
@Override
public void onConnect(SimpleAuthInput input, SimpleAuthOutput output) {
...
final ConnectPacket connectPacket = input.getConnectPacket();
if (connectPacket.getPassword().isPresent()) {
ByteBuffer readonlyPassword = connectPacket.getPassword().get();
// If you want to change the password, copy the password to a new modifiable byte array.
byte[] modifiablePassword = getBytesFromBuffer(password);
}
...
}
private byte[] getBytesFromBuffer(ByteBuffer byteBuffer) {
byte[] bytes = new byte[byteBuffer.remaining()];
byteBuffer.get(bytes);
return bytes;
}
}