use of io.netty.handler.codec.mqtt.MqttConnectVariableHeader in project rocketmq-externals by apache.
the class PubSubIntegrationTest method getConnectMessage.
private MqttConnectMessage getConnectMessage(String clientId) {
MqttFixedHeader fixedHeader = new MqttFixedHeader(MqttMessageType.CONNECT, false, MqttQoS.AT_MOST_ONCE, false, 0);
MqttConnectVariableHeader variableHeader = new MqttConnectVariableHeader("MQTT", 4, false, false, false, MqttQoS.AT_MOST_ONCE.value(), true, true, 60);
MqttConnectPayload payload = new MqttConnectPayload(clientId, "test-will-topic", "the test client is down".getBytes(), null, null);
return new MqttConnectMessage(fixedHeader, variableHeader, payload);
}
use of io.netty.handler.codec.mqtt.MqttConnectVariableHeader in project thingsboard by thingsboard.
the class MqttTransportHandlerTest method getMqttConnectMessage.
MqttConnectMessage getMqttConnectMessage() {
MqttFixedHeader mqttFixedHeader = new MqttFixedHeader(MqttMessageType.CONNECT, true, MqttQoS.AT_LEAST_ONCE, false, 123);
MqttConnectVariableHeader variableHeader = new MqttConnectVariableHeader("device", packedId.incrementAndGet(), true, true, true, 1, true, false, 60);
MqttConnectPayload payload = new MqttConnectPayload("clientId", "topic", "message".getBytes(StandardCharsets.UTF_8), "username", "password".getBytes(StandardCharsets.UTF_8));
return new MqttConnectMessage(mqttFixedHeader, variableHeader, payload);
}
Aggregations