rain
2024-06-25 d2581c92721f90245378bdc48a0e3be7f2b88d54
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();
}