shenyijian
2023-12-02 8c733c9c51ebcf4fbb6b785bd9afbf11087600e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.dji.sample.component.mqtt.service;
 
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;
 
/**
 *
 * @author sean.zhou
 * @date 2021/11/10
 * @version 0.1
 */
public interface IMqttTopicService {
 
    /**
     * Subscribe to a specific topic.
     * @param topic target
     */
    void subscribe(@Header(MqttHeaders.TOPIC) String topic);
 
    /**
     * Subscribe to a specific topic using a specific qos.
     * @param topic target
     * @param qos   qos
     */
    void subscribe(@Header(MqttHeaders.TOPIC) String topic, int qos);
 
    /**
     * Unsubscribe from a specific topic.
     * @param topic target
     */
    void unsubscribe(@Header(MqttHeaders.TOPIC) String topic);
 
    /**
     * Get all the subscribed topics.
     * @return topics
     */
    String[] getSubscribedTopic();
}