sean.zhou
2022-07-25 ea1df99ee3ab248cb72277f64a2e0011da663bb7
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
package com.dji.sample.component.mqtt.service;
 
import com.dji.sample.component.mqtt.model.CommonTopicResponse;
import com.dji.sample.component.mqtt.model.ServiceReply;
 
import java.util.Optional;
 
/**
 * @author sean.zhou
 * @version 0.1
 * @date 2021/11/25
 */
public interface IMessageSenderService {
 
    /**
     * Publish a message to a specific topic.
     * @param topic target
     * @param response message
     */
    void publish(String topic, CommonTopicResponse response);
 
    /**
     * Use a specific qos to push messages to a specific topic.
     * @param topic target
     * @param qos   qos
     * @param response  message
     */
    void publish(String topic, int qos, CommonTopicResponse response);
 
    /**
     * Send live streaming start message and receive a response at the same time
     * @param topic
     * @param response  notification of whether the start is successful.
     * @return
     */
    Optional<ServiceReply> publishWithReply(String topic, CommonTopicResponse response);
}