spring boot cloud dubbo 常用配置
Posted by 2025/5/8 19:30:21 • Author:JK.Li
# server:
# shutdown: graceful
#开启management管理端口
management:
endpoints:
web:
base-path: /xxxx
exposure:
include: "info,health,metrics,logfile,beans,mappings,conditions,loggers,restart"
endpoint:
restart:
enabled: true
shutdown:
enabled: true
health:
show-details: ALWAYS
logfile:
external-file: ../logs/app/${spring.application.name}/spring.log
#接口文档控制
springdoc:
swagger-ui:
enabled: false
api-docs:
enabled: true
#日志相关配置
logging:
level:
root: INFO
com.netflix.discovery.shared.resolver.aws.ConfigClusterResolver: WARN
com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder: INFO
com.alibaba.nacos.client.config.impl: WARN
com.alibaba.cloud.sentinel.datasource.converter.SentinelConverter: WARN
logback:
filemaxday: 3
#dubbo配置
dubbo:
# service:
# shutdown:
# wait: 30000
application:
# check-serializable: false
# serialize-check-status: WARN
check-serializable: true
serialize-check-status: STRICT
qos-enable: false
reference:
timeout: 60000
loadbalance: cust
# scan:
# base-packages: com.*.*.*.*.provider
protocol:
host: 0.0.0.0
# serialization: fastjson
serialization: hessian2
# serialization: fastjson2
name: tri
# name: dubbo
# ext-protocol: tri
# preferred-protocol: tri
port: -1
parameters:
prefer-ip: true
payload: 104857600
consumer:
filter: consumerFilter
reconnect: false
check: false
retries: 0
timeout: 60000
group: ${spring.profiles.active}
provider:
token: true
filter: providerFilter
validation: jvalidationNew
retries: 0
timeout: 60000
group: ${spring.profiles.active}
threads: 500
registry:
check: false
address: nacos://10.10.10.234:8848
group: ${spring.profiles.active}
parameters:
preserved:
ip:
delete:
timeout: 5000
# metadata-report:
# address: nacos://10.10.10.234:8848
# protocol: nacos
# group: ${spring.profiles.active}
# config-center:
# address: nacos://10.10.10.234:8848
# protocol: nacos
# group: ${spring.profiles.active}
spring:
# lifecycle:
# # 优雅下线超时时间
# timeout-per-shutdown-phase: 5m
# kafka:
# bootstrap-servers: 10.10.10.234:9092
# consumer:
# group-id: ${spring.profiles.active}
# auto-offset-reset: earliest
# properties:
# max.partition.fetch.bytes: 3145728
# fetch.max.bytes: 3145728
# producer:
# acks: 1
# compression-type: gzip
# value-serializer: org.apache.kafka.common.serialization.StringSerializer
# key-serializer: org.apache.kafka.common.serialization.StringSerializer
# properties:
# max.request.size: 3145728
cloud:
nacos:
discovery:
heart-beat:
enabled: true
# inetutils:
# preferredNetworks:
# - 172.27.232
# - 10.10.10
# sentinel:
# transport:
# dashboard: 10.10.10.234:8858
# port: 8719
# datasource:
# ds1:
# nacos:
# server-addr: 10.10.10.234:8848
# dataId: sentinel-${spring.application.name}
# groupId: ${spring.profiles.active}
# data-type: json
# rule-type: flow
data:
redis:
host: 10.10.10.234
port: 3320
password: ***********
database: 1
common-database: 0
jedis:
pool:
max-active: 8
max-wait: 1
min-idle: 1
max-idle: 8
timeout: 50000
datasource:
driverClassName: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
initialSize: 10
minIdle: 10
maxActive: 50
maxIdle: 20
maxWait: 60000
username: ${system.rds-username}
password: ${system.rds-password}
# rabbitmq:
# host: 123.57.28.111
# port: 5672
# username: mq_admin
# password: ****************
# publisher-confirms: true
mvc:
pathmatch:
matching-strategy: ant_path_matcher
cache:
type: redis
redis:
keyPrefix: "${spring.profiles.active}:${spring.data.redis.prefix}:"
time-to-live: 5s
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# mapper-locations: classpath:/mapper/*.xml,classpath:/mapper/*/*.xml
Tagged: spring boot cloud dubbo
0 评论列表
发表评论
Wise Words
We can let circumstances rule us, or we can take charge and rule our lives from
within .
Earl Nightingale