| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- package com.ruoyi.device.config;
- import org.springframework.boot.context.properties.ConfigurationProperties;
- import org.springframework.context.annotation.Configuration;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * MQTT配置信息
- *
- * @author lwm
- */
- @Configuration
- @ConfigurationProperties(prefix = "emqx")
- public class MqttConfig
- {
- /**
- * emqx服务器地址
- */
- private String broker;
- /**
- * 用户名
- */
- private String userName;
- /**
- * 密码
- */
- private String password;
- /**
- * 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,这里设置为true表示每次连接到服务器都以新的身份连接
- */
- private Boolean cleanSession = true;
- /**
- * 是否断线重连
- */
- private Boolean reconnect = true;
- /**
- * 连接超时时间
- */
- private Integer timeout = 20;
- /**
- * 心跳间隔
- */
- private Integer keepAlive = 10;
- /**
- * 接口调用登陆名
- */
- private String apiUserName;
- /**
- * 接口调用登陆密码
- */
- private String apiPassword;
- /**
- * 接口调用地址
- */
- private String apiPath;
- /**
- * topic对应消息监听器
- */
- private List<MessageRouter> messageRouters = new ArrayList<>();
- public String getBroker()
- {
- return broker;
- }
- public void setBroker(String broker)
- {
- this.broker = broker;
- }
- public String getUserName()
- {
- return userName;
- }
- public void setUserName(String userName)
- {
- this.userName = userName;
- }
- public String getPassword()
- {
- return password;
- }
- public void setPassword(String password)
- {
- this.password = password;
- }
- public Boolean getCleanSession()
- {
- return cleanSession;
- }
- public void setCleanSession(Boolean cleanSession)
- {
- this.cleanSession = cleanSession;
- }
- public Boolean getReconnect()
- {
- return reconnect;
- }
- public void setReconnect(Boolean reconnect)
- {
- this.reconnect = reconnect;
- }
- public Integer getTimeout()
- {
- return timeout;
- }
- public void setTimeout(Integer timeout)
- {
- this.timeout = timeout;
- }
- public Integer getKeepAlive()
- {
- return keepAlive;
- }
- public void setKeepAlive(Integer keepAlive)
- {
- this.keepAlive = keepAlive;
- }
- public String getApiUserName()
- {
- return apiUserName;
- }
- public void setApiUserName(String apiUserName)
- {
- this.apiUserName = apiUserName;
- }
- public String getApiPassword()
- {
- return apiPassword;
- }
- public void setApiPassword(String apiPassword)
- {
- this.apiPassword = apiPassword;
- }
- public String getApiPath()
- {
- return apiPath;
- }
- public void setApiPath(String apiPath)
- {
- this.apiPath = apiPath;
- }
- public List<MessageRouter> getMessageRouters()
- {
- return messageRouters;
- }
- public void setMessageRouters(List<MessageRouter> messageRouters)
- {
- this.messageRouters = messageRouters;
- }
- }
|