美文网首页SpringBoot配置
Springcloud 中 SpringBoot 配置 ,史上

Springcloud 中 SpringBoot 配置 ,史上

作者: 尼恩_疯狂创客圈 | 来源:发表于2019-10-20 23:44 被阅读0次

    Springcloud 中 SpringBoot 配置全集 (收藏版)

    疯狂创客圈 Java 高并发【 亿级流量聊天室实战】实战系列 【博客园总入口


    前言

    疯狂创客圈(笔者尼恩创建的高并发研习社群)Springcloud 高并发系列文章,将为大家介绍三个版本的 高并发秒杀:

    一、版本1 :springcloud + zookeeper 秒杀 实战

    二、版本2 :springcloud + redis 分布式锁秒杀 实战

    三、版本3 :springcloud + Nginx + Lua 高性能版本秒杀 实战

    以及有关Springcloud 几篇核心、重要的文章

    一、Springcloud 核心配置 ,一文全懂 史上最全

    二、Springcloud 中 SpringBoot 配置全集 , 收藏版

    三、Feign Ribbon Hystrix 三者关系深度解析 , 史上最全

    四、SpringCloud gateway 原理详解 , 史上最全 深度解析

    本文,是《Springcloud 之 SpringBoot 配置全集| 收藏版》篇,为大家解读如果做到Springcloud 中大致所涉及的spring boot 配置,大家可以藏好,一定有用的到时候

    本文说明

    这是《Springcloud 之 SpringBoot 配置全集| 收藏版 》篇,为大家解读如果做到Springcloud 中大致所涉及的spring boot 配置,大家可以藏好,一定有用的到时候

    本文目录如下:

    在这里插入图片描述

    SpringBoot 基础配置

    application 配置

    • spring.application.admin.enabled
      是否启用admin特性,默认为: false

    • spring.application.admin.jmx-name
      指定admin MBean的名称,默认为: org.springframework.boot:type=Admin,name=SpringApplication

    aop 配置

    • spring.aop.auto
      是否支持@EnableAspectJAutoProxy,默认为: true

    • spring.aop.proxy-target-class
      true为使用CGLIB代理,false为JDK代理,默认为false

    autoconfig 配置

    • spring.autoconfigure.exclude
      配置要排除的Auto-configuration classes.

    • jmx 配置
      spring.jmx.default-domain
      指定JMX domain name.

    • spring.jmx.enabled
      是否暴露jmx,默认为true

    • spring.jmx.server
      指定MBeanServer bean name. 默认为: mbeanServer)

    内嵌服务器配置

    tomcat 配置

    • server.tomcat.basedir
      设定Tomcat的base 目录,如果没有指定则使用临时目录.

    • server.tomcat.access-log-enabled
      是否开启access log ,默认: false)

    • server.tomcat.access-log-pattern
      设定access logs的格式,默认: common

    • server.tomcat.accesslog.directory
      设定log的目录,默认: logs

    • server.tomcat.accesslog.enabled
      是否开启access log,默认: false

    • server.tomcat.accesslog.pattern
      设定access logs的格式,默认: common

    • server.tomcat.accesslog.prefix
      设定Log 文件的前缀,默认: access_log

    • server.tomcat.accesslog.suffix
      设定Log 文件的后缀,默认: .log

    • server.tomcat.background-processor-delay
      后台线程方法的Delay大小: 30

    • server.tomcat.internal-proxies
      设定信任的正则表达式,默认:“10.\d{1,3}.\d{1,3}.\d{1,3}| 192.168.\d{1,3}.\d{1,3}| 169.254.\d{1,3}.\d{1,3}| 127.\d{1,3}.\d{1,3}.\d{1,3}| 172.1[6-9]{1}.\d{1,3}.\d{1,3}| 172.2[0-9]{1}.\d{1,3}.\d{1,3}|172.3[0-1]{1}.\d{1,3}.\d{1,3}”

    • server.tomcat.max-http-header-size
      设定http header的最小值,默认: 0

    • server.tomcat.max-threads
      设定tomcat的最大工作线程数,默认为: 0

    • server.tomcat.port-header
      设定http header使用的,用来覆盖原来port的value.

    • server.tomcat.protocol-header
      设定Header包含的协议,通常是 X-Forwarded-Proto,如果remoteIpHeader有值,则将设置为RemoteIpValve.

    • server.tomcat.protocol-header-https-value
      设定使用SSL的header的值,默认https.

    • server.tomcat.remote-ip-header
      设定remote IP的header,如果remoteIpHeader有值,则设置为RemoteIpValve

    • server.tomcat.uri-encoding
      设定URI的解码字符集.

    undertow 配置

    • server.undertow.access-log-dir
      设定Undertow access log 的目录,默认: logs

    • server.undertow.access-log-enabled
      是否开启access log,默认: false

    • server.undertow.access-log-pattern
      设定access logs的格式,默认: common

    • server.undertow.accesslog.dir
      设定access log 的目录.

    • server.undertow.buffer-size
      设定buffer的大小.

    • server.undertow.buffers-per-region
      设定每个region的buffer数

    • server.undertow.direct-buffers
      设定堆外内存

    • server.undertow.io-threads
      设定I/O线程数.

    • server.undertow.worker-threads
      设定工作线程数

    server 通用配置

    • server.port
      设定http监听端口。此配置项最为常见

    • server.servlet-path
      设定dispatcher servlet的监听路径,默认为: /

    • server.address
      指定server绑定的地址

    • server.compression.enabled
      是否开启压缩,默认为false.

    • server.compression.excluded-user-agents
      指定不压缩的user-agent,多个以逗号分隔,默认值为:text/html,text/xml,text/plain,text/css

    • server.compression.mime-types
      指定要压缩的MIME type,多个以逗号分隔.

    • server.compression.min-response-size
      执行压缩的阈值,默认为2048

    • server.context-parameters.[param name]
      设置servlet context 参数

    • server.context-path
      设定应用的context-path.

    • server.display-name
      设定应用的展示名称,默认: application

    • server.jsp-servlet.class-name
      设定编译JSP用的servlet,默认: org.apache.jasper.servlet.JspServlet)

    • server.jsp-servlet.init-parameters.[param name]
      设置JSP servlet 初始化参数.

    • server.jsp-servlet.registered
      设定JSP servlet是否注册到内嵌的servlet容器,默认true

    cookie、session配置

    • server.session.cookie.comment
      指定session cookie的comment

    • server.session.cookie.domain
      指定session cookie的domain

    • server.session.cookie.http-only
      是否开启HttpOnly.

    • server.session.cookie.max-age
      设定session cookie的最大age.

    • server.session.cookie.name
      设定Session cookie 的名称.

    • server.session.cookie.path
      设定session cookie的路径.

    • server.session.cookie.secure
      设定session cookie的“Secure” flag.

    • server.session.persistent
      重启时是否持久化session,默认false

    • server.session.timeout
      session的超时时间

    • server.session.tracking-modes
      设定Session的追踪模式(cookie, url, ssl).

    ssl配置

    • server.ssl.ciphers
      是否支持SSL ciphers.

    • server.ssl.client-auth
      设定client authentication是wanted 还是 needed.

    • server.ssl.enabled
      是否开启ssl,默认: true

    • server.ssl.key-alias
      设定key store中key的别名.

    • server.ssl.key-password
      访问key store中key的密码.

    • server.ssl.key-store
      设定持有SSL certificate的key store的路径,通常是一个.jks文件.

    • server.ssl.key-store-password
      设定访问key store的密码.

    • server.ssl.key-store-provider
      设定key store的提供者.

    • server.ssl.key-store-type
      设定key store的类型.

    • server.ssl.protocol
      使用的SSL协议,默认: TLS

    • server.ssl.trust-store
      持有SSL certificates的Trust store.

    • server.ssl.trust-store-password
      访问trust store的密码.

    • server.ssl.trust-store-provider
      设定trust store的提供者.

    • server.ssl.trust-store-type
      指定trust store的类型.

    datasource 数据源配置

    数据源基础配置

    • spring.dao.exceptiontranslation.enabled
      是否开启PersistenceExceptionTranslationPostProcessor,默认为true
    • spring.datasource.abandon-when-percentage-full
      设定超时被废弃的连接占到多少比例时要被关闭或上报
    • spring.datasource.allow-pool-suspension
      使用Hikari pool时,是否允许连接池暂停,默认为: false
    • spring.datasource.alternate-username-allowed
      是否允许替代的用户名.
    • spring.datasource.auto-commit
      指定updates是否自动提交.
    • spring.datasource.catalog
      指定默认的catalog.
    • spring.datasource.commit-on-return
      设置当连接被归还时,是否要提交所有还未完成的事务
    • spring.datasource.connection-init-sql
      指定连接被创建,再被添加到连接池之前执行的sql.
    • spring.datasource.connection-init-sqls
      使用DBCP connection pool时,指定初始化时要执行的sql
    • spring.datasource.connection-properties.[key]
      在使用DBCP connection pool时指定要配置的属性
    • spring.datasource.connection-test-query
      指定校验连接合法性执行的sql语句
    • spring.datasource.connection-timeout
      指定连接的超时时间,毫秒单位.
    • spring.datasource.continue-on-error
      在初始化数据库时,遇到错误是否继续,默认false
    • spring.datasource.data
      指定Data (DML)脚本
    • spring.datasource.data-source-class-name
      指定数据源的全限定名.
    • spring.datasource.data-source-jndi
      指定jndi的地址
    • spring.datasource.data-source-properties.[key]
      使用Hikari connection pool时,指定要设置的属性
    • spring.datasource.db-properties
      使用Tomcat connection pool,指定要设置的属性
    • spring.datasource.default-auto-commit
      是否自动提交.
    • spring.datasource.default-catalog
      指定连接默认的catalog.
    • spring.datasource.default-read-only
      是否设置默认连接只读.
    • spring.datasource.default-transaction-isolation
      指定连接的事务的默认隔离级别.
    • spring.datasource.driver-class-name
      指定driver的类名,默认从jdbc url中自动探测.
    • spring.datasource.fair-queue
      是否采用FIFO返回连接.
    • spring.datasource.health-check-properties.[key]
      使用Hikari connection pool时,在心跳检查时传递的属性
    • spring.datasource.idle-timeout
      指定连接多久没被使用时,被设置为空闲,默认为10ms
    • spring.datasource.ignore-exception-on-pre-load
      当初始化连接池时,是否忽略异常.
    • spring.datasource.init-sql
      当连接创建时,执行的sql
    • spring.datasource.initial-size
      指定启动连接池时,初始建立的连接数量
    • spring.datasource.initialization-fail-fast
      当创建连接池时,没法创建指定最小连接数量是否抛异常
    • spring.datasource.initialize
      指定初始化数据源,是否用data.sql来初始化,默认: true
    • spring.datasource.isolate-internal-queries
      指定内部查询是否要被隔离,默认为false
    • spring.datasource.jdbc-interceptors
      使用Tomcat connection pool时,指定jdbc拦截器,分号分隔
    • spring.datasource.jdbc-url
      指定JDBC URL.
    • spring.datasource.jmx-enabled
      是否开启JMX,默认为: false
    • spring.datasource.jndi-name
      指定jndi的名称.
    • spring.datasource.leak-detection-threshold
      使用Hikari connection pool时,多少毫秒检测一次连接泄露.
    • spring.datasource.log-abandoned
      使用DBCP connection pool,是否追踪废弃statement或连接,默认为: false
    • spring.datasource.log-validation-errors
      当使用Tomcat connection pool是否打印校验错误.
    • spring.datasource.login-timeout
      指定连接数据库的超时时间.
    • spring.datasource.max-active
      指定连接池中最大的活跃连接数.
    • spring.datasource.max-age
      指定连接池中连接的最大年龄
    • spring.datasource.max-idle
      指定连接池最大的空闲连接数量.
    • spring.datasource.max-lifetime
      指定连接池中连接的最大生存时间,毫秒单位.
    • spring.datasource.max-open-prepared-statements
      指定最大的打开的prepared statements数量.
    • spring.datasource.max-wait
      指定连接池等待连接返回的最大等待时间,毫秒单位.
    • spring.datasource.maximum-pool-size
      指定连接池最大的连接数,包括使用中的和空闲的连接.
    • spring.datasource.min-evictable-idle-time-millis
      指定一个空闲连接最少空闲多久后可被清除.
    • spring.datasource.min-idle
      指定必须保持连接的最小值(For DBCP and Tomcat connection pools)
    • spring.datasource.minimum-idle
      指定连接维护的最小空闲连接数,当使用HikariCP时指定.
    • spring.datasource.name
      指定数据源名.
    • spring.datasource.num-tests-per-eviction-run
      指定运行每个idle object evictor线程时的对象数量
    • spring.datasource.password
      指定数据库密码.
    • spring.datasource.platform
      指定schema要使用的Platform(schema-${platform}.sql),默认为: all
    • spring.datasource.pool-name
      指定连接池名字.
    • spring.datasource.pool-prepared-statements
      指定是否池化statements.
    • spring.datasource.propagate-interrupt-state
      在等待连接时,如果线程被中断,是否传播中断状态.
    • spring.datasource.read-only
      当使用Hikari connection pool时,是否标记数据源只读
    • spring.datasource.register-mbeans
      指定Hikari connection pool是否注册JMX MBeans.
    • spring.datasource.remove-abandoned
      指定当连接超过废弃超时时间时,是否立刻删除该连接.
    • spring.datasource.remove-abandoned-timeout
      指定连接应该被废弃的时间.
    • spring.datasource.rollback-on-return
      在归还连接时,是否回滚等待中的事务.
    • spring.datasource.schema
      指定Schema (DDL)脚本.
    • spring.datasource.separator
      指定初始化脚本的语句分隔符,默认: ;
    • spring.datasource.sql-script-encoding
      指定SQL scripts编码.
    • spring.datasource.suspect-timeout
      指定打印废弃连接前的超时时间.
    • spring.datasource.test-on-borrow
      当从连接池借用连接时,是否测试该连接.
    • spring.datasource.test-on-connect
      创建时,是否测试连接
    • spring.datasource.test-on-return
      在连接归还到连接池时是否测试该连接.
    • spring.datasource.test-while-idle
      当连接空闲时,是否执行连接测试.
    • spring.datasource.time-between-eviction-runs-millis
      指定空闲连接检查、废弃连接清理、空闲连接池大小调整之间的操作时间间隔
    • spring.datasource.transaction-isolation
      指定事务隔离级别,使用Hikari connection pool时指定
    • spring.datasource.url
      指定JDBC URL.
    • spring.datasource.use-disposable-connection-facade
      是否对连接进行包装,防止连接关闭之后被使用.
    • spring.datasource.use-equals
      比较方法名时是否使用String.equals()替换==.
    • spring.datasource.use-lock
      是否对连接操作加锁
    • spring.datasource.username
      *指定数据库名的用户名.
    • spring.datasource.validation-interval
      指定多少ms执行一次连接校验.
    • spring.datasource.validation-query
      指定获取连接时连接校验的sql查询语句.
    • spring.datasource.validation-query-timeout
      指定连接校验查询的超时时间.
    • spring.datasource.validation-timeout
      设定连接校验的超时时间,当使用Hikari connection pool时指定
    • spring.datasource.validator-class-name
      用来测试查询的validator全限定名.
    • spring.datasource.xa.data-source-class-name
      指定数据源的全限定名.
    • spring.datasource.xa.properties
      指定传递给XA data source的属性

    JPA 配置

    • spring.jpa.database
      指定目标数据库.
    • spring.jpa.database-platform
      指定目标数据库的类型.
    • spring.jpa.generate-ddl
      是否在启动时初始化schema,默认为false
    • spring.jpa.hibernate.ddl-auto
      指定DDL mode (none, validate, update, create, create-drop). 当使用内嵌数据库时,默认是create-drop,否则为none.
    • spring.jpa.hibernate.naming-strategy
      指定命名策略.
    • spring.jpa.open-in-view
      是否注册OpenEntityManagerInViewInterceptor,绑定JPA EntityManager到请求线程中,默认为: true
    • spring.jpa.properties
      添加额外的属性到JPA provider.
    • spring.jpa.show-sql
      是否开启sql的log,默认为: false

    h2 设置

    • spring.h2.console.enabled
      是否开启控制台,默认为false
    • spring.h2.console.path
      指定控制台路径,默认为: /h2-console

    spring mvc 配置

    MVC基础配置

    • spring.mvc.async.request-timeout
      设定async请求的超时时间,以毫秒为单位,如果没有设置的话,以具体实现的超时时间为准,比如tomcat的servlet3的话是10秒.

    • spring.mvc.date-format
      设定日期的格式,比如dd/MM/yyyy.

    • spring.mvc.favicon.enabled
      是否支持favicon.ico,默认为: true

    • spring.mvc.ignore-default-model-on-redirect
      在重定向时是否忽略默认model的内容,默认为true

    • spring.mvc.locale
      指定使用的Locale.

    • spring.mvc.message-codes-resolver-format
      指定message codes的格式化策略(PREFIX_ERROR_CODE,POSTFIX_ERROR_CODE).

    • spring.mvc.view.prefix
      指定mvc视图的前缀.

    • spring.mvc.view.suffix
      指定mvc视图的后缀.

    messages 配置

    • spring.messages.basename
      指定message的basename,多个以逗号分隔,如果不加包名的话,默认从classpath路径开始,默认: messages

    • spring.messages.cache-seconds
      设定加载的资源文件缓存失效时间,-1的话为永不过期,默认为-1

    • spring.messages.encoding
      设定Message bundles的编码,默认: UTF-8

    resource 配置

    • spring.resources.add-mappings
      是否开启默认的资源处理,默认为true

    • spring.resources.cache-period
      设定资源的缓存时效,以秒为单位.

    • spring.resources.chain.cache
      是否开启缓存,默认为: true

    • spring.resources.chain.enabled
      是否开启资源 handling chain,默认为false

    • spring.resources.chain.html-application-cache
      是否开启h5应用的cache manifest重写,默认为: false

    • spring.resources.chain.strategy.content.enabled
      是否开启内容版本策略,默认为false

    • spring.resources.chain.strategy.content.paths
      指定要应用的版本的路径,多个以逗号分隔,默认为:[/**]

    • spring.resources.chain.strategy.fixed.enabled
      是否开启固定的版本策略,默认为false

    • spring.resources.chain.strategy.fixed.paths
      指定要应用版本策略的路径,多个以逗号分隔

    • spring.resources.chain.strategy.fixed.version
      指定版本策略使用的版本号

    • spring.resources.static-locations
      指定静态资源路径,默认为classpath:[/META-INF/resources/,/resources/, /static/, /public/]以及context:/

    multipart 文件上传配置

    • multipart.enabled
      是否开启文件上传支持,默认为true

    • multipart.file-size-threshold
      设定文件写入磁盘的阈值,单位为MB或KB,默认为0

    • multipart.location
      指定文件上传路径.

    • multipart.max-file-size
      指定文件大小最大值,默认1MB

    • multipart.max-request-size
      指定每次请求的最大值,默认为10MB

    http 配置

    • spring.hateoas.apply-to-primary-object-mapper
      设定是否对object mapper也支持HATEOAS,默认为: true

    • spring.http.converters.preferred-json-mapper
      是否优先使用JSON mapper来转换.

    • spring.http.encoding.charset
      指定http请求和相应的Charset,默认: UTF-8

    • spring.http.encoding.enabled
      是否开启http的编码支持,默认为true

    • spring.http.encoding.force
      是否强制对http请求和响应进行编码,默认为true

    json 配置

    • spring.jackson.date-format
      指定日期格式,比如yyyy-MM-dd HH:mm:ss,或者具体的格式化类的全限定名
    • spring.jackson.deserialization
      是否开启Jackson的反序列化
    • spring.jackson.generator
      是否开启json的generators.
    • spring.jackson.joda-date-time-format
      指定Joda date/time的格式,比如yyyy-MM-dd HH:mm:ss). 如果没有配置的话,dateformat会作为backup
    • spring.jackson.locale
      指定json使用的Locale.
    • spring.jackson.mapper
      是否开启Jackson通用的特性.
    • spring.jackson.parser
      是否开启jackson的parser特性.
    • spring.jackson.property-naming-strategy
      指定PropertyNamingStrategy (CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES)或者指定PropertyNamingStrategy子类的全限定类名.
    • spring.jackson.serialization
      是否开启jackson的序列化.
    • spring.jackson.serialization-inclusion
      指定序列化时属性的inclusion方式,具体查看JsonInclude.Include枚举.
    • spring.jackson.time-zone
      指定日期格式化时区,比如America/Los_Angeles或者GMT+10.

    springdata NOSQL 配置

    elasticsearch 配置

    spring.data.elasticsearch.cluster-name
    指定es集群名称,默认: elasticsearch

    spring.data.elasticsearch.cluster-nodes
    指定es的集群,逗号分隔,不指定的话,则启动client node.

    spring.data.elasticsearch.properties
    指定要配置的es属性.

    spring.data.elasticsearch.repositories.enabled
    是否开启es存储,默认为: true

    spring.data.jpa.repositories.enabled
    是否开启JPA支持,默认为: true

    mongodb 配置

    spring.mongodb.embedded.features
    指定要开启的特性,逗号分隔.

    spring.mongodb.embedded.version
    指定要使用的版本,默认: 2.6.10

    spring.data.mongodb.authentication-database
    指定鉴权的数据库名

    spring.data.mongodb.database
    指定mongodb数据库名

    spring.data.mongodb.field-naming-strategy
    指定要使用的FieldNamingStrategy.

    spring.data.mongodb.grid-fs-database
    指定GridFS database的名称.

    spring.data.mongodb.host
    指定Mongo server host.

    spring.data.mongodb.password
    指定Mongo server的密码.

    spring.data.mongodb.port
    指定Mongo server port.

    spring.data.mongodb.repositories.enabled
    是否开启mongodb存储,默认为true

    spring.data.mongodb.uri
    指定Mongo database URI.默认:mongodb://localhost/test

    spring.data.mongodb.username
    指定登陆mongodb的用户名.

    RESTful配置

    spring.data.rest.base-path
    指定暴露资源的基准路径.

    spring.data.rest.default-page-size
    指定每页的大小,默认为: 20

    spring.data.rest.limit-param-name
    指定limit的参数名,默认为: size

    spring.data.rest.max-page-size
    指定最大的页数,默认为1000

    spring.data.rest.page-param-name
    指定分页的参数名,默认为: page

    spring.data.rest.return-body-on-create
    当创建完实体之后,是否返回body,默认为false

    spring.data.rest.return-body-on-update
    在更新完实体后,是否返回body,默认为false

    spring.data.rest.sort-param-name
    指定排序使用的key,默认为: sort

    solr配置

    spring.data.solr.host
    指定Solr host,如果有指定了zk的host的话,则忽略。默认为: http://127.0.0.1:8983/solr

    spring.data.solr.repositories.enabled
    是否开启Solr repositories,默认为: true

    spring.data.solr.zk-host
    指定zk的地址,格式为HOST:PORT.

    cache 缓存配置

    缓存通用配置

    spring.cache.cache-names
    指定要创建的缓存的名称,逗号分隔(若该缓存实现支持的话)

    spring.cache.ehcache.config
    指定初始化EhCache时使用的配置文件的位置指定.

    spring.cache.guava.spec
    指定创建缓存要使用的spec,具体详见CacheBuilderSpec.

    spring.cache.hazelcast.config
    指定初始化Hazelcast时的配置文件位置

    spring.cache.infinispan.config
    指定初始化Infinispan时的配置文件位置.

    spring.cache.jcache.config
    指定jcache的配置文件.

    spring.cache.jcache.provider
    指定CachingProvider实现类的全限定名.

    spring.cache.type
    指定缓存类型

    redis 配置

    spring.redis.database
    指定连接工厂使用的Database index,默认为: 0

    spring.redis.host
    指定Redis server host,默认为: localhost

    spring.redis.password
    指定Redis server的密码

    spring.redis.pool.max-active
    指定连接池最大的活跃连接数,-1表示无限,默认为8

    spring.redis.pool.max-idle
    指定连接池最大的空闲连接数,-1表示无限,默认为8

    spring.redis.pool.max-wait
    指定当连接池耗尽时,新获取连接需要等待的最大时间,以毫秒单位,-1表示无限等待

    spring.redis.pool.min-idle
    指定连接池中空闲连接的最小数量,默认为0

    spring.redis.port
    指定redis服务端端口,默认: 6379

    spring.redis.sentinel.master
    指定redis server的名称

    spring.redis.sentinel.nodes
    指定sentinel节点,逗号分隔,格式为host:port.

    spring.redis.timeout
    指定连接超时时间,毫秒单位,默认为0

    spring security 配置

    spring security是springboot支持的权限控制系统。

    security.basic.authorize-mode
    要使用权限控制模式.

    security.basic.enabled
    是否开启基本的鉴权,默认为true

    security.basic.path
    需要鉴权的path,多个的话以逗号分隔,默认为[/**]

    security.basic.realm
    HTTP basic realm 的名字,默认为Spring

    security.enable-csrf
    是否开启cross-site request forgery校验,默认为false.

    security.filter-order
    Security filter chain的order,默认为0

    security.headers.cache
    是否开启http头部的cache控制,默认为false.

    security.headers.content-type
    是否开启X-Content-Type-Options头部,默认为false.

    security.headers.frame
    是否开启X-Frame-Options头部,默认为false.

    security.headers.hsts
    指定HTTP Strict Transport Security (HSTS)模式(none, domain, all).

    security.headers.xss
    是否开启cross-site scripting (XSS) 保护,默认为false.

    security.ignored
    指定不鉴权的路径,多个的话以逗号分隔.

    security.oauth2.client.access-token-uri
    指定获取access token的URI.

    security.oauth2.client.access-token-validity-seconds
    指定access token失效时长.

    security.oauth2.client.additional-information.[key]
    设定要添加的额外信息.

    security.oauth2.client.authentication-scheme
    指定传输不记名令牌(bearer token)的方式(form, header, none,query),默认为header

    security.oauth2.client.authorities
    指定授予客户端的权限.

    security.oauth2.client.authorized-grant-types
    指定客户端允许的grant types.

    security.oauth2.client.auto-approve-scopes
    对客户端自动授权的scope.

    security.oauth2.client.client-authentication-scheme
    传输authentication credentials的方式(form, header, none, query),默认为header方式

    security.oauth2.client.client-id
    指定OAuth2 client ID.

    security.oauth2.client.client-secret
    指定OAuth2 client secret. 默认是一个随机的secret.

    security.oauth2.client.grant-type
    指定获取资源的access token的授权类型.

    security.oauth2.client.id
    指定应用的client ID.

    security.oauth2.client.pre-established-redirect-uri
    服务端pre-established的跳转URI.

    security.oauth2.client.refresh-token-validity-seconds
    指定refresh token的有效期.

    security.oauth2.client.registered-redirect-uri
    指定客户端跳转URI,多个以逗号分隔.

    security.oauth2.client.resource-ids
    指定客户端相关的资源id,多个以逗号分隔.

    security.oauth2.client.scope
    client的scope

    security.oauth2.client.token-name
    指定token的名称

    security.oauth2.client.use-current-uri
    是否优先使用请求中URI,再使用pre-established的跳转URI. 默认为true

    security.oauth2.client.user-authorization-uri
    用户跳转去获取access token的URI.

    security.oauth2.resource.id
    指定resource的唯一标识.

    security.oauth2.resource.jwt.key-uri
    JWT token的URI. 当key为公钥时,或者value不指定时指定.

    security.oauth2.resource.jwt.key-value
    JWT token验证的value. 可以是对称加密或者PEMencoded RSA公钥. 可以使用URI作为value.

    security.oauth2.resource.prefer-token-info
    是否使用token info,默认为true

    security.oauth2.resource.service-id
    指定service ID,默认为resource.

    security.oauth2.resource.token-info-uri
    token解码的URI.

    security.oauth2.resource.token-type
    指定当使用userInfoUri时,发送的token类型.

    security.oauth2.resource.user-info-uri
    指定user info的URI

    security.oauth2.sso.filter-order
    如果没有显示提供WebSecurityConfigurerAdapter时指定的Filter order.

    security.oauth2.sso.login-path
    跳转到SSO的登录路径默认为/login.

    security.require-ssl
    是否对所有请求开启SSL,默认为false.

    security.sessions
    指定Session的创建策略(always, never, if_required, stateless).

    security.user.name
    指定默认的用户名,默认为user.

    security.user.password
    默认的用户密码.

    security.user.role
    默认用户的授权角色.

    消息中间件的配置

    activemq 配置

    spring.activemq.broker-url
    指定ActiveMQ broker的URL,默认自动生成.

    spring.activemq.in-memory
    是否是内存模式,默认为true.

    spring.activemq.password
    指定broker的密码.

    spring.activemq.pooled
    是否创建PooledConnectionFactory,而非ConnectionFactory,默认false

    spring.activemq.user
    指定broker的用户.

    rabbitmq 配置

    spring.rabbitmq.addresses
    指定client连接到的server的地址,多个以逗号分隔.

    spring.rabbitmq.dynamic
    是否创建AmqpAdmin bean. 默认为: true)

    spring.rabbitmq.host
    指定RabbitMQ host.默认为: localhost)

    spring.rabbitmq.listener.acknowledge-mode
    指定Acknowledge的模式.

    spring.rabbitmq.listener.auto-startup
    是否在启动时就启动mq,默认: true)

    spring.rabbitmq.listener.concurrency
    指定最小的消费者数量.

    spring.rabbitmq.listener.max-concurrency
    指定最大的消费者数量.

    spring.rabbitmq.listener.prefetch
    指定一个请求能处理多少个消息,如果有事务的话,必须大于等于transaction数量.

    spring.rabbitmq.listener.transaction-size
    指定一个事务处理的消息数量,最好是小于等于prefetch的数量.

    spring.rabbitmq.password
    指定broker的密码.

    spring.rabbitmq.port
    指定RabbitMQ 的端口,默认: 5672)

    spring.rabbitmq.requested-heartbeat
    指定心跳超时,0为不指定.

    spring.rabbitmq.ssl.enabled
    是否开始SSL,默认: false)

    spring.rabbitmq.ssl.key-store
    指定持有SSL certificate的key store的路径

    spring.rabbitmq.ssl.key-store-password
    指定访问key store的密码.

    spring.rabbitmq.ssl.trust-store
    指定持有SSL certificates的Trust store.

    spring.rabbitmq.ssl.trust-store-password
    指定访问trust store的密码.

    spring.rabbitmq.username
    指定登陆broker的用户名.

    spring.rabbitmq.virtual-host
    指定连接到broker的Virtual host.

    jms 配置

    spring.jms.jndi-name
    指定Connection factory JNDI 名称.

    spring.jms.listener.acknowledge-mode
    指定ack模式,默认自动ack.

    spring.jms.listener.auto-startup
    是否启动时自动启动jms,默认为: true

    spring.jms.listener.concurrency
    指定最小的并发消费者数量.

    spring.jms.listener.max-concurrency
    指定最大的并发消费者数量.

    spring.jms.pub-sub-domain
    是否使用默认的destination type来支持 publish/subscribe,默认: false

    最后,介绍一下疯狂创客圈:疯狂创客圈,一个Java 高并发研习社群博客园 总入口

    疯狂创客圈,倾力推出:面试必备 + 面试必备 + 面试必备 的基础原理+实战 书籍 《Netty Zookeeper Redis 高并发实战

    img

    疯狂创客圈 Java 死磕系列

    • Java (Netty) 聊天程序【 亿级流量】实战 开源项目实战

    相关文章

      网友评论

        本文标题:Springcloud 中 SpringBoot 配置 ,史上

        本文链接:https://www.haomeiwen.com/subject/lmlzmctx.html