| | |
| | | @Data |
| | | public class MesCollectProperties { |
| | | |
| | | /** |
| | | * 报文格式:注塑机 /YLCY/IMM 协议(报文带 topic 字段,主题末段为报文类型) |
| | | */ |
| | | public static final String FORMAT_YLCY = "ylcy"; |
| | | /** |
| | | * 报文格式:设备网关协议(主题固定 gateway/xxx,报文首层 key 为设备名,值为属性字典) |
| | | */ |
| | | public static final String FORMAT_GATEWAY = "gateway"; |
| | | |
| | | private Mqtt mqtt = new Mqtt(); |
| | | private Retention retention = new Retention(); |
| | | |
| | |
| | | */ |
| | | private String clientIdPrefix = "mes-collect"; |
| | | /** |
| | | * 主题前缀,例如 /YLCY/IMM |
| | | * 主题前缀,例如 /YLCY/IMM、gateway |
| | | */ |
| | | private String topicPrefix = "/YLCY/IMM"; |
| | | /** |
| | | * 报文格式,见 {@link MesCollectProperties#FORMAT_YLCY}、{@link MesCollectProperties#FORMAT_GATEWAY} |
| | | */ |
| | | private String format = FORMAT_YLCY; |
| | | /** |
| | | * 显式指定订阅主题,多个用逗号分隔;为空时按 format + topicPrefix 自动推导 |
| | | */ |
| | | private String topics; |
| | | private Integer qos = 0; |
| | | private Integer keepAlive = 65; |
| | | private Integer connectionTimeout = 10; |
| | |
| | | */ |
| | | private String alarmTopicSuffix = "wm"; |
| | | |
| | | /** |
| | | * 是否为设备网关格式报文 |
| | | */ |
| | | public boolean isGatewayFormat() { |
| | | return FORMAT_GATEWAY.equalsIgnoreCase(format == null ? "" : format.trim()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Data |