use of io.netty.handler.codec.mqtt.MqttUnsubAckMessage in project rocketmq-externals by apache.
the class MessageUtil method getMqttUnsubackMessage.
public static MqttUnsubAckMessage getMqttUnsubackMessage(MqttUnsubscribeMessage message) {
MqttFixedHeader fixedHeader = new MqttFixedHeader(MqttMessageType.UNSUBACK, message.fixedHeader().isDup(), message.fixedHeader().qosLevel(), message.fixedHeader().isRetain(), 0);
MqttMessageIdVariableHeader variableHeader = MqttMessageIdVariableHeader.from(message.variableHeader().messageId());
return new MqttUnsubAckMessage(fixedHeader, variableHeader);
}
use of io.netty.handler.codec.mqtt.MqttUnsubAckMessage in project rocketmq-externals by apache.
the class MqttUnsubscribeMessageHandlerTest method assertConditions.
@Override
public void assertConditions() {
MqttUnsubscribeMessage unsubscribeMessage = (MqttUnsubscribeMessage) message.getPayload();
MqttUnsubAckMessage ackMessage = embeddedChannel.readOutbound();
Assert.assertEquals(unsubscribeMessage.variableHeader().messageId(), ackMessage.variableHeader().messageId());
}
use of io.netty.handler.codec.mqtt.MqttUnsubAckMessage in project activemq-artemis by apache.
the class MQTTProtocolHandler method handleUnsubscribe.
void handleUnsubscribe(MqttUnsubscribeMessage message) throws Exception {
session.getSubscriptionManager().removeSubscriptions(message.payload().topics());
MqttFixedHeader header = new MqttFixedHeader(MqttMessageType.UNSUBACK, false, MqttQoS.AT_MOST_ONCE, false, 0);
MqttUnsubAckMessage m = new MqttUnsubAckMessage(header, message.variableHeader());
sendToClient(m);
}
Aggregations