package com.lutao.cloud.iot.mqtt.core.client;

import com.lutao.cloud.iot.mqtt.codec.MqttQoS;

import java.nio.ByteBuffer;

/**
 * mqtt 消息处理
 *

 */
@FunctionalInterface
public interface IMqttClientMessageListener {


	/**
	 * 订阅成功之后的事件
	 *
	 * @param topicFilter topicFilter
	 * @param mqttQoS     MqttQoS
	 */
	default void onSubscribed(String topicFilter, MqttQoS mqttQoS) {

	}

	/**
	 * 监听到消息
	 *
	 * @param topic   topic
	 * @param payload payload
	 */
	void onMessage(String topic, ByteBuffer payload);


}
