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
39
40
41
| package cn.iocoder.yudao.module.iot.core.messagebus.core;
|
| /**
| * IoT 消息总线订阅者接口
| *
| * 用于处理从消息总线接收到的消息
| *
| * @author 芋道源码
| */
| public interface IotMessageSubscriber<T> {
|
| /**
| * @return 主题
| */
| String getTopic();
|
| /**
| * @return 分组
| */
| String getGroup();
|
| /**
| * 处理接收到的消息
| *
| * @param message 消息内容
| */
| void onMessage(T message);
|
| /**
| * 启动订阅
| */
| default void start() {
| }
|
| /**
| * 停止订阅
| */
| default void stop() {
| }
|
| }
|
|