Search in sources :

Example 1 with MqttSubAckPayload

use of io.netty.handler.codec.mqtt.MqttSubAckPayload in project activemq-artemis by apache.

the class MQTTProtocolHandler method handleSubscribe.

void handleSubscribe(MqttSubscribeMessage message) throws Exception {
    MQTTSubscriptionManager subscriptionManager = session.getSubscriptionManager();
    int[] qos = subscriptionManager.addSubscriptions(message.payload().topicSubscriptions());
    MqttFixedHeader header = new MqttFixedHeader(MqttMessageType.SUBACK, false, MqttQoS.AT_MOST_ONCE, false, 0);
    MqttSubAckMessage ack = new MqttSubAckMessage(header, message.variableHeader(), new MqttSubAckPayload(qos));
    sendToClient(ack);
}
Also used : MqttFixedHeader(io.netty.handler.codec.mqtt.MqttFixedHeader) MqttSubAckMessage(io.netty.handler.codec.mqtt.MqttSubAckMessage) MqttSubAckPayload(io.netty.handler.codec.mqtt.MqttSubAckPayload)

Aggregations

MqttFixedHeader (io.netty.handler.codec.mqtt.MqttFixedHeader)1 MqttSubAckMessage (io.netty.handler.codec.mqtt.MqttSubAckMessage)1 MqttSubAckPayload (io.netty.handler.codec.mqtt.MqttSubAckPayload)1