The problem is inside the HiveMQMqttSink class where there is an if expecting a custom Smalrye SendingMqttMessage object:
if (msg instanceof SendingMqttMessage) {
MqttMessage<?> mm = ((SendingMqttMessage<?>) msg);
We need to use the standard Eclipse Microprofile org.eclipse.microprofile.reactive.messaging.Message, this way:
Optional<SendingMqttMessageMetadata> sendingMqttMessageMetadata = msg.getMetadata()
.get(SendingMqttMessageMetadata.class);
if (sendingMqttMessageMetadata.isPresent()) {
var mm = sendingMqttMessageMetadata.get();
Upgrading to Quarkus 3.8 and the new SmallRye version we have a regression.
Using MQTT metadata inside a message
messaggi.send(MqttMessage.of(topicNameSpace, objectMapper.writeValueAsBytes(messaggio)));
is now ignored.
The problem is inside the HiveMQMqttSink class where there is an if expecting a custom Smalrye SendingMqttMessage object:
We need to use the standard Eclipse Microprofile org.eclipse.microprofile.reactive.messaging.Message, this way:
from here the code is unchanged.