You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ,Is there something wrong? The is no reaction when I send message data to MQTT broker.But the client did connect to the Broker. It seems there are bugs. The code connect Server in asynchronous way with netty. So when I send message with the method publish(String topic, ByteBuf payload),the parameter of channel is null.
The text was updated successfully, but these errors were encountered:
publish是发布消息,你要接收消息,需要用on来订阅这个topic,其中的参数MqttHandler hanler是一个接口实现,在这个接口实现中写自己的onMessage方法。 /** * Subscribe on the given topic, with the given qos. When a message is received, MqttClient will invoke the {@link MqttHandler#onMessage(String, ByteBuf)} function of the given handler * This subscribtion is only once. If the MqttClient has received 1 message, the subscribtion will be removed * * @param topic The topic filter to subscribe to * @param handler The handler to invoke when we receive a message * @param qos The qos to request to the server * @return A future which will be completed when the server acknowledges our subscribe request */ @Override public Future<Void> once(String topic, MqttHandler handler, MqttQoS qos) { return createSubscribtion(topic, handler, true, qos); }
Hi ,Is there something wrong? The is no reaction when I send message data to MQTT broker.But the client did connect to the Broker. It seems there are bugs. The code connect Server in asynchronous way with netty. So when I send message with the method publish(String topic, ByteBuf payload),the parameter of channel is null.
The text was updated successfully, but these errors were encountered: