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);
}
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));
}
Aggregations