Search in sources :

Example 1 with MqttPingreqMessageHandler

use of org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttPingreqMessageHandler in project rocketmq-externals by apache.

the class MqttPingreqMessageHandlerTest method setup.

@Before
public void setup() {
    clientManager = Mockito.mock(ClientManager.class);
    ctx = Mockito.mock(ChannelHandlerContext.class);
    client = Mockito.spy(new MqttClient());
    client.setConnected(true);
    handler = new MqttPingreqMessageHandler();
    Mockito.when(client.getCtx()).thenReturn(ctx);
}
Also used : MqttClient(org.apache.rocketmq.iot.protocol.mqtt.data.MqttClient) ClientManager(org.apache.rocketmq.iot.connection.client.ClientManager) MqttPingreqMessageHandler(org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttPingreqMessageHandler) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) Before(org.junit.Before)

Example 2 with MqttPingreqMessageHandler

use of org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttPingreqMessageHandler in project rocketmq-externals by apache.

the class MQTTBridge method registerMessageHandlers.

private void registerMessageHandlers() {
    messageDispatcher.registerHandler(Message.Type.MQTT_CONNECT, new MqttConnectMessageHandler(clientManager));
    messageDispatcher.registerHandler(Message.Type.MQTT_DISCONNECT, new MqttDisconnectMessageHandler(clientManager));
    messageDispatcher.registerHandler(Message.Type.MQTT_PUBLISH, new MqttMessageForwarder(subscriptionStore));
    // TODO qos 1/2 PUBLISH
    // TODO qos 1: PUBACK
    // TODO qos 2: PUBREC
    // TODO qos 2: PUBREL
    // TODO qos 2: PUBCOMP
    messageDispatcher.registerHandler(Message.Type.MQTT_PINGREQ, new MqttPingreqMessageHandler());
    messageDispatcher.registerHandler(Message.Type.MQTT_SUBSCRIBE, new MqttSubscribeMessageHandler(subscriptionStore));
    messageDispatcher.registerHandler(Message.Type.MQTT_UNSUBSCRIBE, new MqttUnsubscribeMessagHandler(subscriptionStore));
}
Also used : MqttDisconnectMessageHandler(org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttDisconnectMessageHandler) MqttMessageForwarder(org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttMessageForwarder) MqttUnsubscribeMessagHandler(org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttUnsubscribeMessagHandler) MqttSubscribeMessageHandler(org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttSubscribeMessageHandler) MqttPingreqMessageHandler(org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttPingreqMessageHandler) MqttConnectMessageHandler(org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttConnectMessageHandler)

Aggregations

MqttPingreqMessageHandler (org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttPingreqMessageHandler)2 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1 ClientManager (org.apache.rocketmq.iot.connection.client.ClientManager)1 MqttClient (org.apache.rocketmq.iot.protocol.mqtt.data.MqttClient)1 MqttConnectMessageHandler (org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttConnectMessageHandler)1 MqttDisconnectMessageHandler (org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttDisconnectMessageHandler)1 MqttMessageForwarder (org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttMessageForwarder)1 MqttSubscribeMessageHandler (org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttSubscribeMessageHandler)1 MqttUnsubscribeMessagHandler (org.apache.rocketmq.iot.protocol.mqtt.handler.downstream.impl.MqttUnsubscribeMessagHandler)1 Before (org.junit.Before)1