com.feingto.iot.common.config.properties.NettyProperties Maven / Gradle / Ivy
package com.feingto.iot.common.config.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* Netty 配置
*
* @author longfei
*/
@Data
@Configuration
@ConfigurationProperties(prefix = "netty")
public class NettyProperties {
private String host;
private int port;
private int wsPort;
private int bossThread;
private int workThread;
/**
* 缓冲区队列大小
*/
private int backlog = 50;
/**
* 长连接
*/
private boolean keepalive = true;
private boolean ssl = false;
private String keyStore;
private String keyStorePassword;
private Mqtt mqtt;
@Data
public static class Mqtt {
private String host;
/**
* 连接TCP端口
*/
private int port;
/**
* 连接WebSocket端口
*/
private int wsPort;
/**
* 连接设备ID
*/
private String clientId;
/**
* 连接用户名
*/
private String username;
/**
* 连接密码
*/
private String password;
/**
* 清除会话
*/
private boolean cleanSession = false;
/**
* 连接超时时间, 单位秒
*/
private int timeout = 30;
/**
* 心跳频率, 单位秒
*/
private int keepAliveInterval = 60;
/**
* 遗言标志
*/
private boolean willFlag = false;
/**
* 遗言推送主题
*/
private String willTopic;
/**
* 遗言是否保留
*/
private boolean willRetain;
/**
* 遗言Qos Level
*/
private int willQos;
/**
* 遗言消息
*/
private String willMessage;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy