package cn.iocoder.yudao.module.mes.framework.collect.config; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; /** * MES 数采配置 * * @author 超级管理员 */ @Component @ConfigurationProperties(prefix = "yudao.mes.collect") @Data public class MesCollectProperties { private Mqtt mqtt = new Mqtt(); private Retention retention = new Retention(); @Data public static class Mqtt { /** * 是否启用数采 MQTT 订阅 */ private Boolean enabled = false; /** * Broker 地址,例如 tcp://36.213.90.123:1883 */ private String url; private String username; private String password; /** * 客户端 ID 前缀 */ private String clientIdPrefix = "mes-collect"; /** * 主题前缀,例如 /YLCY/IMM */ private String topicPrefix = "/YLCY/IMM"; private Integer qos = 0; private Integer keepAlive = 65; private Integer connectionTimeout = 10; /** * 报警主题后缀,报文 topic 字段或主题末段命中时按报警处理 */ private String alarmTopicSuffix = "wm"; } @Data public static class Retention { /** * 原始报文保留天数 */ private Integer rawDays = 7; /** * 实时历史保留天数 */ private Integer realtimeDays = 30; /** * 单次清理条数 */ private Integer batchSize = 50000; } }