Skip to content

Commit

Permalink
fix nacosConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaonannet committed Mar 27, 2023
1 parent 1d1fd3b commit 28550ef
Show file tree
Hide file tree
Showing 13 changed files with 513 additions and 0 deletions.
59 changes: 59 additions & 0 deletions doc/nacos-config/DEFAULT_GROUP/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
spring:
main:
allow-circular-references: true
allow-bean-definition-overriding: true
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
mvc:
pathmatch:
matching-strategy: ant_path_matcher

#请求处理的超时时间
ribbon:
ReadTimeout: 10000
ConnectTimeout: 10000

# feign 配置
feign:
hystrix:
enabled: true
sentinel:
enabled: true
okhttp:
enabled: true
httpclient:
enabled: false
client:
config:
default:
connectTimeout: 10000
readTimeout: 10000
compression:
request:
enabled: true
response:
enabled: true

# 暴露监控端点
management:
metrics:
export:
influx:
enabled: false
endpoints:
web:
exposure:
include: '*'
#线程池总线资源配置
threadBus:
pool:
#核心线程数(默认线程数)
core-pool-size: 8
#最大线程数
max-pool-size: 16
#允许线程空闲时间(单位:默认为秒)
keep-alive-time: 60
#缓冲队列大小
queue-capacity: 1000
#线程池名前缀
thread-name-prefix: thinglinksAsync-
3 changes: 3 additions & 0 deletions doc/nacos-config/DEFAULT_GROUP/thinglinks-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Tomcat
server:
port: 19200
113 changes: 113 additions & 0 deletions doc/nacos-config/DEFAULT_GROUP/thinglinks-gateway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Tomcat
server:
port: 19100

spring:
cloud:
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
routes:
# 认证中心
- id: thinglinks-auth
uri: lb://thinglinks-auth
predicates:
- Path=/auth/**
filters:
# 验证码处理
- CacheRequestFilter
- ValidateCodeFilter
- StripPrefix=1
# 代码生成
- id: thinglinks-modules-gen
uri: lb://thinglinks-modules-gen
predicates:
- Path=/code/**
filters:
- StripPrefix=1
# 定时任务
- id: thinglinks-modules-job
uri: lb://thinglinks-modules-job
predicates:
- Path=/schedule/**
filters:
- StripPrefix=1
# 系统模块
- id: thinglinks-modules-system
uri: lb://thinglinks-modules-system
predicates:
- Path=/system/**
filters:
- StripPrefix=1
# 文件服务
- id: thinglinks-modules-file
uri: lb://thinglinks-modules-file
predicates:
- Path=/file/**
filters:
- StripPrefix=1
# TDengine服务
- id: thinglinks-modules-tdengine
uri: lb://thinglinks-modules-tdengine
predicates:
- Path=/tdengine/**
filters:
- StripPrefix=1
# Link服务
- id: thinglinks-modules-link
uri: lb://thinglinks-modules-link
predicates:
- Path=/link/**
filters:
- StripPrefix=1
# Broker服务
- id: thinglinks-modules-broker
uri: lb://thinglinks-modules-broker
predicates:
- Path=/broker/**
filters:
- StripPrefix=1
- RemoveRequestHeader=Sec-WebSocket-Protocol #移除请求头
# ProtocolAnalysis服务
- id: thinglinks-modules-protocolAnalysis
uri: lb://thinglinks-modules-protocolAnalysis
predicates:
- Path=/protocolAnalysis/**
filters:
- StripPrefix=1
# rule服务
- id: thinglinks-modules-rule
uri: lb://thinglinks-modules-rule
predicates:
- Path=/rule/**
filters:
- StripPrefix=1

# 安全配置
security:
# 验证码
captcha:
enabled: true
type: char
# 防止XSS攻击
xss:
enabled: true
excludeUrls:
- /system/notice
# 不校验白名单
ignore:
whites:
- /auth/logout
- /auth/login
- /auth/register
- /*/v2/api-docs
- /csrf
#MQTT消息推送接口
- /broker/publish/sendMessage
#Broker WebSocket推送日志
- /broker/websocket/logging
#客户端身份认证接口
- /link/device/clientAuthentication
- /tdengine/**
117 changes: 117 additions & 0 deletions doc/nacos-config/DEFAULT_GROUP/thinglinks-modules-broker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Tomcat
server:
port: 19306

#smqtt配置文件V2.0
smqtt:
logLevel: INFO # 系统日志
tcp: # tcp配置
port: 11883 # mqtt端口号
notKickSecond: 30 # KICK互踢模式生效, 单位秒, 指定时间内客户端不互踢, 避免客户端自动连接持续互踢
wiretap: false # 二进制日志 前提是 smqtt.logLevel = DEBUG
bossThreadSize: 1 # boss线程 默认=1
workThreadSize: 9 # work线程 默认=cpu核心数+1
businessThreadSize: 8 # 业务线程数 默认=cpu核心数
businessQueueSize: 100000 #业务队列 默认=100000
messageMaxSize: 4194304 # 接收消息的最大限制 默认4194304(4M)
lowWaterMark: 4000000 # 不建议配置 默认 32768
highWaterMark: 80000000 # 不建议配置 默认 65536
# globalReadWriteSize: 10000000,100000000 全局读写大小限制
# channelReadWriteSize: 10000000,100000000 单个channel读写大小限制
options: # netty option设置
SO_BACKLOG: 2000
childOptions: #netty child option设置
SO_REUSEADDR: true
ssl: # ssl配置
enable: false # 开关
key: classpath:ssl/server.key # 指定ssl文件 默认系统生成
crt: classpath:ssl/server.crt # 指定ssl文件 默认系统生成
ca: classpath:ssl/server.ca # ca证书 双向加密配置
acl:
aclPolicy: JDBC # NONE or FILE or JDBC
filePath: # FILE时配置filePath
jdbcAclConfig:
driver: com.mysql.jdbc.Driver
url: ${spring.datasource.dynamic.datasource.master.url}
username: ${spring.datasource.dynamic.datasource.master.username}
password: ${spring.datasource.dynamic.datasource.master.password}
http: # http相关配置 端口固定60000
enable: true # 开关
accessLog: false # http访问日志
ssl: # ssl配置
enable: false
admin: # Broker后台管理配置
enable: true # 开关
username: thinglinks # 访问用户名
password: thinglinks # 访问密码
auth:
http: #设备鉴权模式(请求方式固定 POST body 格式为: {"clientIdentifier":"","username":"","password":""} 返回状态码 200 即可 如果检验失败返回400)
host: 127.0.0.1 #网关服务器IP
port: 19100 #网关服务端口
path: /link/device/clientAuthentication
params: {"deviceStatus":"ENABLE","protocolType":"MQTT"}
ws: # websocket配置
enable: true # 开关
port: 18999 # 端口
path: /mqtt # ws 的访问path mqtt.js请设置此选项
cluster: # 集群配置
#本地IP,多网卡时候指定
localAddress: 127.0.0.1
#集群IP集合
addresses: ["127.0.0.1"]
#集群持久化目录,默认启动目录
#workDirectory: /soft/dir
meter:
meterType: PROMETHEUS # INFLUXDB , PROMETHEUS
rules:
- ruleName: ROCKET_MQ
chain:
- ruleType: PREDICATE
script: $.event.equals("ping")
- ruleType: ROCKET_MQ
script: "{'event':'ping','clientId':clientId,'messageId':messageId,'time':time}"
- ruleName: ROCKET_MQ
chain:
- ruleType: PREDICATE
script: $.event.equals("connect")
- ruleType: ROCKET_MQ
script: "{'event':'connect','clientId':clientId,'auth':auth,'clientAddress':clientAddress,'keepalive':keepalive,'nodeIp':nodeIp,'version':version,'time':time,'will':will}"
- ruleName: ROCKET_MQ
chain:
- ruleType: PREDICATE
script: $.event.equals("publish")
- ruleType: ROCKET_MQ
script: "{'event':'publish','topic':topic,'body':body,'qos':qos,'clientId':clientId,'messageId':messageId,'time':time}"
- ruleName: ROCKET_MQ
chain:
- ruleType: PREDICATE
script: $.event.equals("disconnect")
- ruleType: ROCKET_MQ
script: "{'event':'disconnect','clientId':clientId,'time':time}"
- ruleName: ROCKET_MQ
chain:
- ruleType: PREDICATE
script: $.event.equals("clone")
- ruleType: ROCKET_MQ
script: "{'event':'disconnect','clientId':clientId,'time':time}"
- ruleName: ROCKET_MQ
chain:
- ruleType: PREDICATE
script: $.event.equals("subscribe")
- ruleType: ROCKET_MQ
script: "{'event':'subscribe','clientId':clientId,'subscribeTopics':subscribeTopics,'time':time}"
- ruleName: ROCKET_MQ
chain:
- ruleType: PREDICATE
script: $.event.equals("unsubscribe")
- ruleType: ROCKET_MQ
script: "{'event':'unsubscribe','clientId':clientId,'topics':topics,'time':time}"
sources: # 配置数据源sources
- source: ROCKET_MQ # rocketmq配置
sourceName: rocket_mq
sourceAttributes:
topic: thinglinks-link-mqttMsg
tags: thinglinks
namesrvAddr: 127.0.0.1:19876
instanceName: broker-a
producerGroup: thinglinks
23 changes: 23 additions & 0 deletions doc/nacos-config/DEFAULT_GROUP/thinglinks-modules-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Tomcat
server:
port: 19300

# 本地文件上传
file:
domain: http://127.0.0.1:19300
path: /Users/xiaonan/Documents/data/uploadPath
prefix: /statics

# FastDFS配置
fdfs:
domain: http://8.129.231.12
soTimeout: 3000
connectTimeout: 2000
trackerList: 8.129.231.12:22122

# Minio配置
minio:
url: http://127.0.0.1:16001
accessKey: minioadmin
secretKey: minioadmin
bucketName: thinglinks
27 changes: 27 additions & 0 deletions doc/nacos-config/DEFAULT_GROUP/thinglinks-modules-gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Tomcat
server:
port: 19301

# mybatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.mqttsnet.thinglinks.gen.domain
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath:mapper/**/*.xml

# swagger配置
swagger:
title: 代码生成接口文档
license: Powered By thinglinks
licenseUrl: https://doc.thinglinks.mqttsnet.com

# 代码生成
gen:
# 作者
author: thinglinks
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.mqttsnet.thinglinks.link
# 自动去除表前缀,默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
tablePrefix: thinglinks_
16 changes: 16 additions & 0 deletions doc/nacos-config/DEFAULT_GROUP/thinglinks-modules-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Tomcat
server:
port: 19302

# mybatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.mqttsnet.thinglinks.job
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath:mapper/**/*.xml

# swagger配置
swagger:
title: 定时任务接口文档
license: Powered By thinglinks
licenseUrl: https://doc.thinglinks.mqttsnet.com
16 changes: 16 additions & 0 deletions doc/nacos-config/DEFAULT_GROUP/thinglinks-modules-link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Tomcat
server:
port: 19305

# mybatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.mqttsnet.thinglinks.link
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath:mapper/**/*.xml

# swagger配置
swagger:
title: Link模块接口文档
license: Powered By thinglinks
licenseUrl: https://showdoc.thinglinks.mqttsnet.com
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Tomcat
server:
port: 19307

protocol:
tcp-ip:
port: 18901
udp-ip:
port: 18902
Loading

0 comments on commit 28550ef

Please sign in to comment.