use of io.netty.handler.codec.mqtt.MqttFixedHeader in project activemq-artemis by apache.
the class MQTTProtocolHandler method sendPublishProtocolControlMessage.
void sendPublishProtocolControlMessage(int messageId, MqttMessageType messageType) {
MqttQoS qos = (messageType == MqttMessageType.PUBREL) ? MqttQoS.AT_LEAST_ONCE : MqttQoS.AT_MOST_ONCE;
MqttFixedHeader fixedHeader = new // Spec requires 01 in header for rel
MqttFixedHeader(// Spec requires 01 in header for rel
messageType, // Spec requires 01 in header for rel
false, // Spec requires 01 in header for rel
qos, false, 0);
MqttPubAckMessage rel = new MqttPubAckMessage(fixedHeader, MqttMessageIdVariableHeader.from(messageId));
sendToClient(rel);
}
use of io.netty.handler.codec.mqtt.MqttFixedHeader 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