v2
This commit is contained in:
23
uboot-common/src/main/resources/META-INF/spring.factories
Normal file
23
uboot-common/src/main/resources/META-INF/spring.factories
Normal file
@ -0,0 +1,23 @@
|
||||
# AutoConfiguration
|
||||
# apollo
|
||||
# attachment-sdk
|
||||
# eureka
|
||||
# feign
|
||||
# jpa com.chinaunicom.mall.ebtp.cloud.jpa.starter.JpaStarterConfiguration,\
|
||||
# kafka com.chinaunicom.mall.ebtp.cloud.kafka.starter.KafkaStarterConfiguration,\
|
||||
# log
|
||||
# redis
|
||||
# seata com.chinaunicom.mall.ebtp.cloud.seata.starter.SeataStarterConfiguration1,\
|
||||
# security
|
||||
# security
|
||||
# swagger
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.chinaunicom.mall.ebtp.cloud.apollo.starter.ApolloStarterConfiguration,\
|
||||
com.chinaunicom.ebtp.mall.cloud.attachment.sdk.config.SDKAutoConfiguration,\
|
||||
com.chinaunicom.mall.ebtp.cloud.eureka.starter.EurekaStarterConfiguration,\
|
||||
com.chinaunicom.mall.ebtp.cloud.feign.starter.FeignStarterConfiguration,\
|
||||
com.chinaunicom.mall.ebtp.cloud.log.starter.LogStarterConfiguration,\
|
||||
com.chinaunicom.mall.ebtp.cloud.redis.starter.RedisStarterConfiguration,\
|
||||
com.chinaunicom.mall.ebtp.cloud.security.starter.SecurityStarterConfiguration,\
|
||||
com.chinaunicom.mall.ebtp.cloud.security.starter.config.BrowserSecurityConfig,\
|
||||
com.chinaunicom.mall.ebtp.cloud.swagger.starter.SwaggerStarterConfiguration
|
152
uboot-common/src/main/resources/application-common.yml
Normal file
152
uboot-common/src/main/resources/application-common.yml
Normal file
@ -0,0 +1,152 @@
|
||||
server:
|
||||
port: 18003
|
||||
servlet:
|
||||
context-path: /
|
||||
|
||||
seata:
|
||||
service:
|
||||
vgroup-mapping:
|
||||
uboot-common-dev-service-group: default
|
||||
grouplist:
|
||||
default: 10.242.37.148:18035
|
||||
|
||||
spring:
|
||||
aop:
|
||||
auto: true #开启spring的aop配置
|
||||
proxy-target-class: true
|
||||
|
||||
application:
|
||||
name: uboot-common-dev
|
||||
|
||||
shardingsphere:
|
||||
datasource:
|
||||
names: ds0
|
||||
ds0:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
username: mall
|
||||
password: unicom
|
||||
jdbc-url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_bid?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_bid?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
|
||||
filters: stat,wall,log4j
|
||||
maxActive: 20
|
||||
initialSize: 1
|
||||
maxWait: 60000
|
||||
minIdle: 1
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: select 'x'
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
poolPreparedStatements: true
|
||||
maxOpenPreparedStatements: 20
|
||||
connection-properties: druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000
|
||||
props:
|
||||
sql:
|
||||
show: false
|
||||
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
serialization:
|
||||
write-dates-as-timestamps: false
|
||||
|
||||
# 天宫Kafka增加了安全认证,需要配置安全属性
|
||||
kafka:
|
||||
bootstrap-servers: 10.125.164.192:32005,10.125.164.193:32005,10.125.164.194:32005
|
||||
template:
|
||||
default-topic: jl_test
|
||||
|
||||
# 生产者配置参数
|
||||
producer:
|
||||
client-id: core-service-ebtp-crypt
|
||||
properties:
|
||||
security.protocol: SASL_PLAINTEXT
|
||||
sasl.mechanism: SCRAM-SHA-256
|
||||
sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123";
|
||||
|
||||
# 消费者配置参数
|
||||
consumer:
|
||||
group-id: core-service-ebtp-crypt-consumer
|
||||
auto-offset-reset: latest
|
||||
properties:
|
||||
security.protocol: SASL_PLAINTEXT
|
||||
sasl.mechanism: SCRAM-SHA-256
|
||||
sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123";
|
||||
|
||||
# 天宫 redis 需要使用哨兵进行访问
|
||||
redis:
|
||||
sentinel:
|
||||
master: eshop-redis
|
||||
nodes: 10.125.164.124:32718, 10.125.164.118:32716, 10.125.164.121:32716
|
||||
password: Unicom#135
|
||||
|
||||
# 天宫Eureka配置
|
||||
eureka:asdf
|
||||
client:
|
||||
service-url:
|
||||
defaultZone: http://10.242.37.148:5001/eureka
|
||||
instance:
|
||||
prefer-ip-address: true
|
||||
ip-address: 125.32.114.204
|
||||
hostname: 125.32.114.204
|
||||
instance-ip: 125.32.114.204:${server.port}
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
# 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射
|
||||
map-underscore-to-camel-case: true
|
||||
auto-mapping-behavior: full
|
||||
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
mapper-locations: classpath*:com/chinaunicom/mall/ebtp/**/mapper/*Mapper.xml
|
||||
global-config:
|
||||
# 逻辑删除配置
|
||||
db-config:
|
||||
# logic-delete-field: flag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2) @TableLogic
|
||||
logic-delete-value: deleted # 逻辑已删除值
|
||||
logic-not-delete-value: normal # 逻辑未删除值
|
||||
|
||||
hystrix:
|
||||
command:
|
||||
default:
|
||||
execution:
|
||||
timeout:
|
||||
enabled: true
|
||||
isolation:
|
||||
strategy: SEMAPHORE
|
||||
thread:
|
||||
timeoutInMilliseconds: 200000 #熔断超时时间
|
||||
circuitBreaker:
|
||||
sleepWindowInMilliseconds: 20000
|
||||
forceClosed: true
|
||||
|
||||
ribbon:
|
||||
ReadTimeout: 20000 #请求处理的超时时间
|
||||
ConnectTimeout: 20000 #请求连接超时时间
|
||||
MaxAutoRetries: 0 #对当前实例的重试次数
|
||||
MaxAutoRetriesNextServer: 1 #切换实例的重试次数 1
|
||||
|
||||
mconfig:
|
||||
workerId: 1
|
||||
datacenterId: 1
|
||||
|
||||
#中国联通电子商城外网接入平台 相关参数
|
||||
token:
|
||||
userName: zbgg
|
||||
password: eip_13579
|
||||
|
||||
|
||||
# 用户暴露给 prometheus 的健康数据
|
||||
management:
|
||||
health:
|
||||
db:
|
||||
enabled: true
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: "*"
|
||||
cors:
|
||||
allowed-origins: "*"
|
||||
allowed-methods: "*"
|
@ -1,2 +1 @@
|
||||
core-service-ebtp-extend.biz.message=http://10.238.25.112:8100/biz-service-ebtp-extend/
|
||||
spring.main.allow-bean-definition-overriding=true
|
@ -1,69 +0,0 @@
|
||||
server:
|
||||
port: 8081
|
||||
servlet:
|
||||
context-path: /
|
||||
|
||||
spring:
|
||||
aop:
|
||||
auto: true #开启spring的aop配置
|
||||
proxy-target-class: true
|
||||
application:
|
||||
name: uboot-common
|
||||
|
||||
kafka:
|
||||
bootstrap-servers: 127.0.0.1:9092
|
||||
producer:
|
||||
# 写入失败时,重试次数。当leader节点失效,一个repli节点会替代成为leader节点,此时可能出现写入失败,
|
||||
# 当retris为0时,produce不会重复。retirs重发,此时repli节点完全成为leader节点,不会产生消息丢失。
|
||||
retries: 0
|
||||
# 每次批量发送消息的数量,produce积累到一定数据,一次发送
|
||||
batch-size: 2
|
||||
# produce积累数据一次发送,缓存大小达到buffer.memory就发送数据
|
||||
buffer-memory: 33554432
|
||||
#procedure要求leader在考虑完成请求之前收到的确认数,用于控制发送记录在服务端的持久化,其值可以为如下:
|
||||
#acks = 0 如果设置为零,则生产者将不会等待来自服务器的任何确认,该记录将立即添加到套接字缓冲区并视为已发送。在这种情况下,无法保证服务器已收到记录,并且重试配置将不会生效(因为客户端通常不会知道任何故障),为每条记录返回的偏移量始终设置为-1。
|
||||
#acks = 1 这意味着leader会将记录写入其本地日志,但无需等待所有副本服务器的完全确认即可做出回应,在这种情况下,如果leader在确认记录后立即失败,但在将数据复制到所有的副本服务器之前,则记录将会丢失。
|
||||
#acks = all 这意味着leader将等待完整的同步副本集以确认记录,这保证了只要至少一个同步副本服务器仍然存活,记录就不会丢失,这是最强有力的保证,这相当于acks = -1的设置。
|
||||
#可以设置的值为:all, -1, 0, 1
|
||||
acks: 1
|
||||
key-serializer: org.apache.kafka.common.serialization.StringSerializer
|
||||
value-serializer: org.apache.kafka.common.serialization.StringSerializer
|
||||
consumer:
|
||||
group-id: user-group
|
||||
auto-offset-reset: earliest
|
||||
enable-auto-commit: true
|
||||
auto-commit-interval: 100
|
||||
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
||||
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
||||
#=========redis基础配置=========
|
||||
redis:
|
||||
lettuce:
|
||||
# jedis:
|
||||
pool:
|
||||
maxTotal: 50
|
||||
minIdle: 1
|
||||
maxWaitMillis: 5000
|
||||
maxIdle: 5
|
||||
testOnBorrow: true
|
||||
testOnReturn: true
|
||||
testWhileIdle: true
|
||||
token:
|
||||
database: 0
|
||||
host: 125.32.114.204
|
||||
port: 16379
|
||||
password: redis@CC1234
|
||||
timeout: 6000
|
||||
uuid:
|
||||
database: 1
|
||||
host: 125.32.114.204
|
||||
port: 16379
|
||||
password: redis@CC1234
|
||||
timeout: 6000
|
||||
cache:
|
||||
database: 2
|
||||
host: 125.32.114.204
|
||||
port: 16379
|
||||
password: redis@CC1234
|
||||
timeout: 6000
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
# Apollo 配置信息
|
||||
apollo.meta=http://106.74.154.90:9228/
|
||||
apollo.bootstrap.namespace=application
|
||||
apollo.bootstrap.enabled=true
|
||||
apollo.bootstrap.eagerLoad.enabled=true
|
@ -0,0 +1,8 @@
|
||||
feign.hystrix.enabled=true
|
||||
feign.client.config.default.retryer=feign.Retryer.Default
|
||||
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=600000
|
||||
server.max-http-header-size=2048576
|
||||
# document center id
|
||||
document.center.service.id=core-service-document-center
|
||||
document.data.service.id=data-service-document-center
|
||||
document.center.ip-address=http://10.242.31.158:8806/doc/
|
@ -0,0 +1,3 @@
|
||||
# 胜智云eureka 统一配置
|
||||
eureka.client.service-url.defaultZone=http://10.242.31.158:5001/eureka,http://10.242.31.158:5002/eureka,http://10.242.31.158:5003/eureka
|
||||
eureka.instance.prefer-ip-address=true
|
@ -0,0 +1,16 @@
|
||||
# 默认开启熔断
|
||||
feign.hystrix.enabled=true
|
||||
feign.client.config.default.connectTimeout=200000
|
||||
feign.client.config.default.readTimeout=200000
|
||||
# 使用线程池模式,允许的并发访问量
|
||||
hystrix.threadpool.default.coreSize=10
|
||||
hystrix.threadpool.default.maximumSize=1000
|
||||
hystrix.threadpool.default.maxQueueSize=1000
|
||||
hystrix.threadpool.default.queueSizeRejectionThreshold=1000
|
||||
hystrix.threadpool.default.allowMaximumSizeToDivergeFromCoreSize=true
|
||||
# 如果使用信号量模式,最大允许并发请求数
|
||||
hystrix.command.default.execution.isolation.semaphore.maxConcurrentRequests=1000
|
||||
hystrix.command.default.fallback.isolation.semaphore.maxConcurrentRequests=1000
|
||||
# 默认使用线程池模式
|
||||
hystrix.command.default.execution.isolation.strategy=THREAD
|
||||
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=20000
|
@ -0,0 +1,20 @@
|
||||
# 默认开启驼峰映射
|
||||
mybatis-plus.configuration.map-undersore-to-camel-case=true
|
||||
# 对所有的 resultMap 都进行自动映射
|
||||
mybatis-plus.configuration.auto-mapping-behavior=full
|
||||
# 实体扫描,多个package用逗号或者分号分隔
|
||||
mybatis-plus.typeAliasesPackage=com.chinaunicom.mall.ebtp
|
||||
# 项目统一mapper存放位置
|
||||
mybatis-plus.mapper-locations=classpath*:com/chinaunicom/mall/ebtp/**/mapper/*Mapper.xml
|
||||
# 主键类型 0: 数据库ID自增, 1: 用户输入ID, 2: 全局唯一ID(数字类型), 3: UUID;
|
||||
mybatis-plus.global-config.id-type=3
|
||||
# 机器 ID 部分
|
||||
mybatis-plus.global-config.workerId=1
|
||||
# 数据中心 ID 部分 (workerId 和 datacenterId 一起配置才能重新初始化 Sequence)
|
||||
mybatis-plus.global-config.datacenterId=20
|
||||
# 字段策略 0: 忽略判断, 1:非 NULL 判断, 2: 非空判断
|
||||
mybatis-plus.global-config.field-strategy=2
|
||||
# 逻辑已删除值
|
||||
mybatis-plus.global-config.db-config.logic-delete-value=0
|
||||
# 逻辑未删除值
|
||||
mybatis-plus.global-config.db-config.logic-not-delete-value=1
|
@ -0,0 +1,4 @@
|
||||
seata.enabled=true
|
||||
seata.application-id=${spring.application.name}
|
||||
seata.tx-service-group=${spring.application.name}-service-group
|
||||
seata.service.grouplist.default=10.242.31.158:18035
|
@ -0,0 +1,2 @@
|
||||
user.auth.csrf.disable=true
|
||||
mall-ebtp.userinfo.id=core-service-ebtp-userinfo
|
Reference in New Issue
Block a user