这里以web service为example:
<!--注:可动态config-->
application.properties
#############SERVER CONFIG############ server.port=9096 #server.tomcat.min-spare-threads=20 #server.tomcat.max-threads=1000 #server.compression.enabled=true #server.compression.mime-types=application/json spring.application.name=app.web.service spring.profiles.active=@profileActive@ logging.config=classpath:logback-spring.xml allow.list=192.168,localhost redis.cache.enable=true
application_dev.properties(开发环境config)
# Redis数据库索引(默认为0) redis.database=0 # Redis服务器地址 redis.host=xxx.xx.xx.xxx # Redis服务器连接端口 redis.port=7000 # Redis服务器连接密码(默认为空) redis.password= # 连接池最大连接数(使用负值表示没有限制) redis.pool.max-active=8 # 连接池最大阻塞等待时间(使用负值表示没有限制) reids.pool.max-wait=-1 # 连接池中的最大空闲连接 redis.pool.max-idle=80 # 连接池中的最小空闲连接 redis.pool.min-idle=10 # 连接超时时间(毫秒) redis.timeout=10000 ## Dubbo 消费者 zookeeper.connect=zookeeper://xxx.xx.xx.xxx:2181 ##广播方式 #zookeeper.connect=multicast://xxx.x.x.x:1235?unicast=false dubbo.name=app-web dubbo.timeout=3000 ##图片代理地址 image.proxy.url=http://xxx.xx.xx.xxx:9097
application_prod.properties(线上环境config)
...........................................................................................................................................................................................................
..................................................................................................................................
.........................................................
application_test.properties(测试环境config)
...........................................................................................................................................................................................................
..................................................................................................................................
.........................................................