2026-06-24 f4bd1f3c89d906131495a0aca5aaf82966378510
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 cn.iocoder.yudao.module.iot.core.messagebus.core;
 
/**
 * IoT 消息总线接口
 *
 * 用于在 IoT 系统中发布和订阅消息,支持多种消息中间件实现
 *
 * @author 芋道源码
 */
public interface IotMessageBus {
 
    /**
     * 发布消息到消息总线
     *
     * @param topic 主题
     * @param message 消息内容
     */
    void post(String topic, Object message);
 
    /**
     * 注册消息订阅者
     *
     * @param subscriber 订阅者
     */
    void register(IotMessageSubscriber<?> subscriber);
 
    /**
     * 取消注册消息订阅者
     *
     * @param subscriber 订阅者
     */
    default void unregister(IotMessageSubscriber<?> subscriber) {
        // TODO 芋艿:暂时不实现,需求量不大,但是
        // throw new UnsupportedOperationException("取消注册消息订阅者功能,尚未实现");
    }
 
}