feat: 所有服务统一配置多租户负载均衡,清理无效配置
1. 业务服务配置(fund-cust/proj/req/exp/receipt)
- 添加 Nacos metadata.tenant-id 配置
- 添加 tenant.routing 配置
- 移除无效的 feign.fund-sys.url 配置
2. 共享服务配置(fund-report/file)
- 添加 tenant.routing.enabled: false
- 共享服务不需要租户路由
3. Gateway 配置清理
- 移除过时的 tenant-group-header 配置
- 移除过时的 group-separator 配置
4. 删除 Docker 配置文件
- 删除 fund-sys/application-docker.yml
- 删除 fund-gateway/application-docker.yml
配置规范:
业务服务: tenant.routing.enabled=true, metadata.tenant-id=${TENANT_ID:}
共享服务: tenant.routing.enabled=false
This commit is contained in:
parent
8233ff8040
commit
15e7ed6f1b
@ -13,6 +13,10 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
# tenant-id: 空值=共享实例,单值=单租户专属,多值(逗号分隔)=多租户专属
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -37,14 +41,17 @@ mybatis-plus:
|
||||
logic-delete-value: 1
|
||||
logic-not-delete-value: 0
|
||||
|
||||
# Feign配置
|
||||
feign:
|
||||
fund-sys:
|
||||
url: http://localhost:8100
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.cust: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
|
||||
@ -13,6 +13,10 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
# tenant-id: 空值=共享实例,单值=单租户专属,多值(逗号分隔)=多租户专属
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -37,14 +41,17 @@ mybatis-plus:
|
||||
logic-delete-value: 1
|
||||
logic-not-delete-value: 0
|
||||
|
||||
# Feign配置
|
||||
feign:
|
||||
fund-sys:
|
||||
url: http://localhost:8100
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.cust: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
|
||||
@ -13,6 +13,9 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -40,3 +43,13 @@ mybatis-plus:
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.exp: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
@ -13,6 +13,9 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -40,3 +43,13 @@ mybatis-plus:
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.exp: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
@ -5,12 +5,6 @@ spring:
|
||||
application:
|
||||
name: fund-file
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/fund_file?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: zjf@123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
@ -19,6 +13,13 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 共享服务,无需租户路由
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/fund_file?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: ${DB_PASSWORD:zjf@123456}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# 文件上传配置
|
||||
servlet:
|
||||
@ -40,3 +41,14 @@ file:
|
||||
upload:
|
||||
path: ./uploads
|
||||
max-size: 52428800
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.file: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 共享服务,禁用租户路由
|
||||
tenant:
|
||||
routing:
|
||||
enabled: false
|
||||
|
||||
@ -5,12 +5,6 @@ spring:
|
||||
application:
|
||||
name: fund-file
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/fund_file?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: zjf@123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
@ -19,6 +13,13 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 共享服务,无需租户路由
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/fund_file?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: ${DB_PASSWORD:zjf@123456}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# 文件上传配置
|
||||
servlet:
|
||||
@ -40,3 +41,14 @@ file:
|
||||
upload:
|
||||
path: ./uploads
|
||||
max-size: 52428800
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.file: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 共享服务,禁用租户路由
|
||||
tenant:
|
||||
routing:
|
||||
enabled: false
|
||||
|
||||
@ -1,166 +0,0 @@
|
||||
# Docker 环境配置 - Gateway
|
||||
server:
|
||||
port: ${SERVER_PORT:8000}
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: fund-gateway
|
||||
profiles:
|
||||
active: ${SPRING_PROFILES_ACTIVE:docker}
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:nacos}
|
||||
discovery:
|
||||
namespace: ${NACOS_NAMESPACE:}
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
metadata:
|
||||
service-type: gateway
|
||||
|
||||
gateway:
|
||||
discovery:
|
||||
locator:
|
||||
enabled: true
|
||||
lower-case-service-id: true
|
||||
# 全局跨域配置
|
||||
globalcors:
|
||||
cors-configurations:
|
||||
'[/**]':
|
||||
allowed-origins: "*"
|
||||
allowed-methods: "*"
|
||||
allowed-headers: "*"
|
||||
allow-credentials: true
|
||||
routes:
|
||||
- id: fund-sys
|
||||
uri: lb://fund-sys
|
||||
predicates:
|
||||
- Path=/api/sys/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# 租户感知负载均衡(自动添加 tenant-group 请求头)
|
||||
- id: fund-cust
|
||||
uri: lb://fund-cust
|
||||
predicates:
|
||||
- Path=/api/cust/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-proj
|
||||
uri: lb://fund-proj
|
||||
predicates:
|
||||
- Path=/api/proj/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-req
|
||||
uri: lb://fund-req
|
||||
predicates:
|
||||
- Path=/api/req/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-exp
|
||||
uri: lb://fund-exp
|
||||
predicates:
|
||||
- Path=/api/exp/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-receipt
|
||||
uri: lb://fund-receipt
|
||||
predicates:
|
||||
- Path=/api/receipt/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-report
|
||||
uri: lb://fund-report
|
||||
predicates:
|
||||
- Path=/api/report/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-file
|
||||
uri: lb://fund-file
|
||||
predicates:
|
||||
- Path=/api/file/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
|
||||
# JWT 配置
|
||||
jwt:
|
||||
secret: ${JWT_SECRET:YourSecretKeyForJWTTokenGenerationMustBeAtLeast256BitsLong}
|
||||
expiration: ${JWT_EXPIRATION:86400000}
|
||||
|
||||
# ==================== 多租户混合模式配置 ====================
|
||||
tenant:
|
||||
routing:
|
||||
# 启用租户感知负载均衡
|
||||
enabled: true
|
||||
# 默认租户ID
|
||||
default-tenant-id: 1
|
||||
# 租户服务配置(定义每个服务的VIP租户)
|
||||
services:
|
||||
fund-sys:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
- TENANT_VIP_002
|
||||
fallback-to-shared: true
|
||||
fund-cust:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
fallback-to-shared: true
|
||||
fund-proj:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
fallback-to-shared: true
|
||||
fund-req:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
fund-exp:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
fund-receipt:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
fund-report:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
fund-file:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
|
||||
# Actuator 监控端点配置
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus
|
||||
base-path: /actuator
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
probes:
|
||||
enabled: true
|
||||
health:
|
||||
livenessstate:
|
||||
enabled: true
|
||||
readinessstate:
|
||||
enabled: true
|
||||
metrics:
|
||||
tags:
|
||||
application: ${spring.application.name}
|
||||
service-type: gateway
|
||||
distribution:
|
||||
percentiles-histogram:
|
||||
http.server.requests: true
|
||||
percentiles:
|
||||
http.server.requests: 0.5,0.95,0.99
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.fundplatform: DEBUG
|
||||
# 多租户负载均衡日志
|
||||
com.fundplatform.common.loadbalancer: DEBUG
|
||||
com.fundplatform.gateway.filter: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%X{tenantId}] %-5level %logger{36} - %msg%n"
|
||||
@ -133,8 +133,6 @@ tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
tenant-group-header: X-Tenant-Group
|
||||
group-separator: TENANT_
|
||||
default-tenant-id: "1"
|
||||
# 共享服务列表(不需要租户路由的服务)
|
||||
shared-services:
|
||||
|
||||
@ -1,166 +0,0 @@
|
||||
# Docker 环境配置 - Gateway
|
||||
server:
|
||||
port: ${SERVER_PORT:8000}
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: fund-gateway
|
||||
profiles:
|
||||
active: ${SPRING_PROFILES_ACTIVE:docker}
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:nacos}
|
||||
discovery:
|
||||
namespace: ${NACOS_NAMESPACE:}
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
metadata:
|
||||
service-type: gateway
|
||||
|
||||
gateway:
|
||||
discovery:
|
||||
locator:
|
||||
enabled: true
|
||||
lower-case-service-id: true
|
||||
# 全局跨域配置
|
||||
globalcors:
|
||||
cors-configurations:
|
||||
'[/**]':
|
||||
allowed-origins: "*"
|
||||
allowed-methods: "*"
|
||||
allowed-headers: "*"
|
||||
allow-credentials: true
|
||||
routes:
|
||||
- id: fund-sys
|
||||
uri: lb://fund-sys
|
||||
predicates:
|
||||
- Path=/api/sys/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# 租户感知负载均衡(自动添加 tenant-group 请求头)
|
||||
- id: fund-cust
|
||||
uri: lb://fund-cust
|
||||
predicates:
|
||||
- Path=/api/cust/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-proj
|
||||
uri: lb://fund-proj
|
||||
predicates:
|
||||
- Path=/api/proj/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-req
|
||||
uri: lb://fund-req
|
||||
predicates:
|
||||
- Path=/api/req/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-exp
|
||||
uri: lb://fund-exp
|
||||
predicates:
|
||||
- Path=/api/exp/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-receipt
|
||||
uri: lb://fund-receipt
|
||||
predicates:
|
||||
- Path=/api/receipt/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-report
|
||||
uri: lb://fund-report
|
||||
predicates:
|
||||
- Path=/api/report/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: fund-file
|
||||
uri: lb://fund-file
|
||||
predicates:
|
||||
- Path=/api/file/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
|
||||
# JWT 配置
|
||||
jwt:
|
||||
secret: ${JWT_SECRET:YourSecretKeyForJWTTokenGenerationMustBeAtLeast256BitsLong}
|
||||
expiration: ${JWT_EXPIRATION:86400000}
|
||||
|
||||
# ==================== 多租户混合模式配置 ====================
|
||||
tenant:
|
||||
routing:
|
||||
# 启用租户感知负载均衡
|
||||
enabled: true
|
||||
# 默认租户ID
|
||||
default-tenant-id: 1
|
||||
# 租户服务配置(定义每个服务的VIP租户)
|
||||
services:
|
||||
fund-sys:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
- TENANT_VIP_002
|
||||
fallback-to-shared: true
|
||||
fund-cust:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
fallback-to-shared: true
|
||||
fund-proj:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
fallback-to-shared: true
|
||||
fund-req:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
fund-exp:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
fund-receipt:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
fund-report:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
fund-file:
|
||||
vip-tenants: []
|
||||
fallback-to-shared: true
|
||||
|
||||
# Actuator 监控端点配置
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus
|
||||
base-path: /actuator
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
probes:
|
||||
enabled: true
|
||||
health:
|
||||
livenessstate:
|
||||
enabled: true
|
||||
readinessstate:
|
||||
enabled: true
|
||||
metrics:
|
||||
tags:
|
||||
application: ${spring.application.name}
|
||||
service-type: gateway
|
||||
distribution:
|
||||
percentiles-histogram:
|
||||
http.server.requests: true
|
||||
percentiles:
|
||||
http.server.requests: 0.5,0.95,0.99
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.fundplatform: DEBUG
|
||||
# 多租户负载均衡日志
|
||||
com.fundplatform.common.loadbalancer: DEBUG
|
||||
com.fundplatform.gateway.filter: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%X{tenantId}] %-5level %logger{36} - %msg%n"
|
||||
@ -133,8 +133,6 @@ tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
tenant-group-header: X-Tenant-Group
|
||||
group-separator: TENANT_
|
||||
default-tenant-id: "1"
|
||||
# 共享服务列表(不需要租户路由的服务)
|
||||
shared-services:
|
||||
|
||||
@ -13,6 +13,9 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -43,3 +46,11 @@ logging:
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
|
||||
@ -13,6 +13,9 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -43,3 +46,11 @@ logging:
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
|
||||
@ -13,6 +13,9 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -40,3 +43,13 @@ mybatis-plus:
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.receipt: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
@ -13,6 +13,9 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -40,3 +43,13 @@ mybatis-plus:
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.receipt: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
@ -5,12 +5,6 @@ spring:
|
||||
application:
|
||||
name: fund-report
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/fund_report?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: zjf@123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
@ -19,3 +13,21 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 共享服务,无需租户路由
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/fund_report?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: ${DB_PASSWORD:zjf@123456}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.report: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 共享服务,禁用租户路由
|
||||
tenant:
|
||||
routing:
|
||||
enabled: false
|
||||
|
||||
@ -5,12 +5,6 @@ spring:
|
||||
application:
|
||||
name: fund-report
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/fund_report?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: zjf@123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
@ -19,3 +13,21 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 共享服务,无需租户路由
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/fund_report?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: ${DB_PASSWORD:zjf@123456}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.report: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 共享服务,禁用租户路由
|
||||
tenant:
|
||||
routing:
|
||||
enabled: false
|
||||
|
||||
@ -13,6 +13,9 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -40,3 +43,13 @@ mybatis-plus:
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.req: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
@ -13,6 +13,9 @@ spring:
|
||||
group: DEFAULT_GROUP
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 租户路由元数据
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:}
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@ -40,3 +43,13 @@ mybatis-plus:
|
||||
logging:
|
||||
level:
|
||||
com.fundplatform.req: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
|
||||
# 多租户路由配置
|
||||
tenant:
|
||||
routing:
|
||||
enabled: true
|
||||
tenant-header: X-Tenant-Id
|
||||
default-tenant-id: "1"
|
||||
fallback-to-shared: true
|
||||
|
||||
@ -1,122 +0,0 @@
|
||||
# Docker 环境配置
|
||||
server:
|
||||
port: ${SERVER_PORT:8100}
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: fund-sys
|
||||
profiles:
|
||||
active: ${SPRING_PROFILES_ACTIVE:docker}
|
||||
|
||||
# 数据源配置
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:fund_platform}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: ${MYSQL_USER:root}
|
||||
password: ${MYSQL_PASSWORD:root123}
|
||||
hikari:
|
||||
pool-name: FundSysHikariPool
|
||||
minimum-idle: 5
|
||||
maximum-pool-size: 20
|
||||
idle-timeout: 30000
|
||||
max-lifetime: 1800000
|
||||
connection-timeout: 30000
|
||||
|
||||
# Redis 配置
|
||||
data:
|
||||
redis:
|
||||
host: ${REDIS_HOST:redis}
|
||||
port: ${REDIS_PORT:6379}
|
||||
|
||||
# Nacos 配置
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:nacos}
|
||||
discovery:
|
||||
namespace: ${NACOS_NAMESPACE:}
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
# 多租户元数据配置(支持混合模式负载均衡)
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:1}
|
||||
tenant-group: ${TENANT_GROUP:}
|
||||
# 服务实例权重(VIP实例可配置更高权重)
|
||||
weight: ${NACOS_WEIGHT:1}
|
||||
|
||||
# MyBatis Plus 配置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:/mapper/**/*.xml
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: ASSIGN_ID
|
||||
logic-delete-field: deleted
|
||||
logic-delete-value: 1
|
||||
logic-not-delete-value: 0
|
||||
|
||||
# ==================== 多租户混合模式配置 ====================
|
||||
tenant:
|
||||
routing:
|
||||
# 启用租户感知负载均衡
|
||||
enabled: true
|
||||
# 默认租户ID
|
||||
default-tenant-id: 1
|
||||
# 租户服务配置
|
||||
services:
|
||||
fund-sys:
|
||||
# VIP租户列表(优先路由到专属实例)
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
- TENANT_VIP_002
|
||||
# 共享实例回退策略:当无专属实例时回退到共享实例
|
||||
fallback-to-shared: true
|
||||
fund-cust:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
fallback-to-shared: true
|
||||
fund-proj:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
fallback-to-shared: true
|
||||
|
||||
# Actuator 监控端点配置
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus
|
||||
base-path: /actuator
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
probes:
|
||||
enabled: true
|
||||
health:
|
||||
livenessstate:
|
||||
enabled: true
|
||||
readinessstate:
|
||||
enabled: true
|
||||
metrics:
|
||||
tags:
|
||||
application: ${spring.application.name}
|
||||
# 多租户监控标签
|
||||
tenant_id: ${TENANT_ID:1}
|
||||
tenant_group: ${TENANT_GROUP:shared}
|
||||
instance_type: ${TENANT_GROUP:shared}
|
||||
distribution:
|
||||
percentiles-histogram:
|
||||
http.server.requests: true
|
||||
percentiles:
|
||||
http.server.requests: 0.5,0.95,0.99
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.fundplatform: DEBUG
|
||||
# 多租户负载均衡日志
|
||||
com.fundplatform.common.loadbalancer: DEBUG
|
||||
com.fundplatform.common.nacos: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%X{tenantId}] %-5level %logger{36} - %msg%n"
|
||||
@ -1,122 +0,0 @@
|
||||
# Docker 环境配置
|
||||
server:
|
||||
port: ${SERVER_PORT:8100}
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: fund-sys
|
||||
profiles:
|
||||
active: ${SPRING_PROFILES_ACTIVE:docker}
|
||||
|
||||
# 数据源配置
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:fund_platform}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: ${MYSQL_USER:root}
|
||||
password: ${MYSQL_PASSWORD:root123}
|
||||
hikari:
|
||||
pool-name: FundSysHikariPool
|
||||
minimum-idle: 5
|
||||
maximum-pool-size: 20
|
||||
idle-timeout: 30000
|
||||
max-lifetime: 1800000
|
||||
connection-timeout: 30000
|
||||
|
||||
# Redis 配置
|
||||
data:
|
||||
redis:
|
||||
host: ${REDIS_HOST:redis}
|
||||
port: ${REDIS_PORT:6379}
|
||||
|
||||
# Nacos 配置
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:nacos}
|
||||
discovery:
|
||||
namespace: ${NACOS_NAMESPACE:}
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
# 多租户元数据配置(支持混合模式负载均衡)
|
||||
metadata:
|
||||
tenant-id: ${TENANT_ID:1}
|
||||
tenant-group: ${TENANT_GROUP:}
|
||||
# 服务实例权重(VIP实例可配置更高权重)
|
||||
weight: ${NACOS_WEIGHT:1}
|
||||
|
||||
# MyBatis Plus 配置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:/mapper/**/*.xml
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: ASSIGN_ID
|
||||
logic-delete-field: deleted
|
||||
logic-delete-value: 1
|
||||
logic-not-delete-value: 0
|
||||
|
||||
# ==================== 多租户混合模式配置 ====================
|
||||
tenant:
|
||||
routing:
|
||||
# 启用租户感知负载均衡
|
||||
enabled: true
|
||||
# 默认租户ID
|
||||
default-tenant-id: 1
|
||||
# 租户服务配置
|
||||
services:
|
||||
fund-sys:
|
||||
# VIP租户列表(优先路由到专属实例)
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
- TENANT_VIP_002
|
||||
# 共享实例回退策略:当无专属实例时回退到共享实例
|
||||
fallback-to-shared: true
|
||||
fund-cust:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
fallback-to-shared: true
|
||||
fund-proj:
|
||||
vip-tenants:
|
||||
- TENANT_VIP_001
|
||||
fallback-to-shared: true
|
||||
|
||||
# Actuator 监控端点配置
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus
|
||||
base-path: /actuator
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
probes:
|
||||
enabled: true
|
||||
health:
|
||||
livenessstate:
|
||||
enabled: true
|
||||
readinessstate:
|
||||
enabled: true
|
||||
metrics:
|
||||
tags:
|
||||
application: ${spring.application.name}
|
||||
# 多租户监控标签
|
||||
tenant_id: ${TENANT_ID:1}
|
||||
tenant_group: ${TENANT_GROUP:shared}
|
||||
instance_type: ${TENANT_GROUP:shared}
|
||||
distribution:
|
||||
percentiles-histogram:
|
||||
http.server.requests: true
|
||||
percentiles:
|
||||
http.server.requests: 0.5,0.95,0.99
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.fundplatform: DEBUG
|
||||
# 多租户负载均衡日志
|
||||
com.fundplatform.common.loadbalancer: DEBUG
|
||||
com.fundplatform.common.nacos: DEBUG
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%X{tenantId}] %-5level %logger{36} - %msg%n"
|
||||
@ -1192,3 +1192,39 @@ java.lang.NullPointerException: Cannot invoke "com.zaxxer.hikari.HikariPoolMXBea
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
|
||||
at java.base/java.lang.Thread.run(Thread.java:1583)
|
||||
2026-02-19 21:41:06.988 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - === HikariCP 连接池状态 ===
|
||||
2026-02-19 21:41:06.988 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - 连接池名称: FundSysHikariPool
|
||||
2026-02-19 21:41:06.988 [scheduling-1] [] ERROR o.s.s.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task
|
||||
java.lang.NullPointerException: Cannot invoke "com.zaxxer.hikari.HikariPoolMXBean.getActiveConnections()" because the return value of "com.zaxxer.hikari.HikariDataSource.getHikariPoolMXBean()" is null
|
||||
at com.fundplatform.sys.config.HikariMonitorConfig.monitorHikariPool(HikariMonitorConfig.java:38)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
|
||||
at io.micrometer.observation.Observation.observe(Observation.java:499)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
|
||||
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
|
||||
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
|
||||
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
|
||||
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
|
||||
at java.base/java.lang.Thread.run(Thread.java:1583)
|
||||
2026-02-19 21:46:06.988 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - === HikariCP 连接池状态 ===
|
||||
2026-02-19 21:46:06.996 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - 连接池名称: FundSysHikariPool
|
||||
2026-02-19 21:46:06.996 [scheduling-1] [] ERROR o.s.s.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task
|
||||
java.lang.NullPointerException: Cannot invoke "com.zaxxer.hikari.HikariPoolMXBean.getActiveConnections()" because the return value of "com.zaxxer.hikari.HikariDataSource.getHikariPoolMXBean()" is null
|
||||
at com.fundplatform.sys.config.HikariMonitorConfig.monitorHikariPool(HikariMonitorConfig.java:38)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
|
||||
at io.micrometer.observation.Observation.observe(Observation.java:499)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
|
||||
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
|
||||
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
|
||||
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
|
||||
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
|
||||
at java.base/java.lang.Thread.run(Thread.java:1583)
|
||||
|
||||
@ -1174,3 +1174,21 @@ java.lang.NullPointerException: Cannot invoke "com.zaxxer.hikari.HikariPoolMXBea
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
|
||||
at java.base/java.lang.Thread.run(Thread.java:1583)
|
||||
2026-02-19 21:44:07.541 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - === HikariCP 连接池状态 ===
|
||||
2026-02-19 21:44:07.546 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - 连接池名称: FundSysHikariPool
|
||||
2026-02-19 21:44:07.546 [scheduling-1] [] ERROR o.s.s.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task
|
||||
java.lang.NullPointerException: Cannot invoke "com.zaxxer.hikari.HikariPoolMXBean.getActiveConnections()" because the return value of "com.zaxxer.hikari.HikariDataSource.getHikariPoolMXBean()" is null
|
||||
at com.fundplatform.sys.config.HikariMonitorConfig.monitorHikariPool(HikariMonitorConfig.java:38)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
|
||||
at io.micrometer.observation.Observation.observe(Observation.java:499)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
|
||||
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
|
||||
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
|
||||
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
|
||||
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
|
||||
at java.base/java.lang.Thread.run(Thread.java:1583)
|
||||
|
||||
@ -1614,3 +1614,51 @@ java.lang.NullPointerException: Cannot invoke "com.zaxxer.hikari.HikariPoolMXBea
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
|
||||
at java.base/java.lang.Thread.run(Thread.java:1583)
|
||||
2026-02-19 21:41:06.988 [scheduling-1] [] ERROR o.s.s.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task
|
||||
java.lang.NullPointerException: Cannot invoke "com.zaxxer.hikari.HikariPoolMXBean.getActiveConnections()" because the return value of "com.zaxxer.hikari.HikariDataSource.getHikariPoolMXBean()" is null
|
||||
at com.fundplatform.sys.config.HikariMonitorConfig.monitorHikariPool(HikariMonitorConfig.java:38)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
|
||||
at io.micrometer.observation.Observation.observe(Observation.java:499)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
|
||||
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
|
||||
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
|
||||
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
|
||||
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
|
||||
at java.base/java.lang.Thread.run(Thread.java:1583)
|
||||
2026-02-19 21:44:07.546 [scheduling-1] [] ERROR o.s.s.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task
|
||||
java.lang.NullPointerException: Cannot invoke "com.zaxxer.hikari.HikariPoolMXBean.getActiveConnections()" because the return value of "com.zaxxer.hikari.HikariDataSource.getHikariPoolMXBean()" is null
|
||||
at com.fundplatform.sys.config.HikariMonitorConfig.monitorHikariPool(HikariMonitorConfig.java:38)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
|
||||
at io.micrometer.observation.Observation.observe(Observation.java:499)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
|
||||
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
|
||||
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
|
||||
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
|
||||
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
|
||||
at java.base/java.lang.Thread.run(Thread.java:1583)
|
||||
2026-02-19 21:46:06.996 [scheduling-1] [] ERROR o.s.s.support.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task
|
||||
java.lang.NullPointerException: Cannot invoke "com.zaxxer.hikari.HikariPoolMXBean.getActiveConnections()" because the return value of "com.zaxxer.hikari.HikariDataSource.getHikariPoolMXBean()" is null
|
||||
at com.fundplatform.sys.config.HikariMonitorConfig.monitorHikariPool(HikariMonitorConfig.java:38)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
|
||||
at io.micrometer.observation.Observation.observe(Observation.java:499)
|
||||
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
|
||||
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
|
||||
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
|
||||
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
|
||||
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
|
||||
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
|
||||
at java.base/java.lang.Thread.run(Thread.java:1583)
|
||||
|
||||
@ -346,3 +346,9 @@
|
||||
2026-02-19 21:36:06.988 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - 连接池名称: FundSysHikariPool
|
||||
2026-02-19 21:39:07.541 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - === HikariCP 连接池状态 ===
|
||||
2026-02-19 21:39:07.541 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - 连接池名称: FundSysHikariPool
|
||||
2026-02-19 21:41:06.988 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - === HikariCP 连接池状态 ===
|
||||
2026-02-19 21:41:06.988 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - 连接池名称: FundSysHikariPool
|
||||
2026-02-19 21:44:07.541 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - === HikariCP 连接池状态 ===
|
||||
2026-02-19 21:44:07.546 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - 连接池名称: FundSysHikariPool
|
||||
2026-02-19 21:46:06.988 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - === HikariCP 连接池状态 ===
|
||||
2026-02-19 21:46:06.996 [scheduling-1] [] INFO com.fundplatform.sys.config.HikariMonitorConfig - 连接池名称: FundSysHikariPool
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user