package cn.iocoder.yudao.module.iot.framework.mqtt.consumer;

import org.eclipse.paho.client.mqttv3.MqttException;

public interface IMqttservice {

    /**
     * 一次性定时器
     * 程序启动后去数据库找到所有需要订阅的topic 添加进client订阅
     */
    public void subscribeMysqlTopic() throws Exception;

    /**
     * 需要订阅的topic 添加进client订阅
     */
    public int subscribeTopic(String topic) throws MqttException;

    /**
     * 关闭订阅topic 从client中关闭topic
     */
    public int unsubscribeTopic(String topic) throws MqttException;

}
