开发中经常会用到Redis,RabbitMQ等组件,有时候需要查询还有哪些可配置项进行学习和参考。
目前官方提供一个比较全的配置参考,进入页面Ctrl+F
搜索即可
目前收集如下
1. Redis
在官网上没有找到,因此是在下载好的spring-boot-starter-autoconfigure
相关依赖里面找的,版本号为2.1.1.RELEASE
配置类为RedisProperties.java
,包名为org.springframework.boot.autoconfigure.data.redis
- 基础配置参考为
spring.redis.database=0
spring.redis.password=123
spring.redis.port=6379
spring.redis.host=192.168.66.128
spring.redis.lettuce.pool.min-idle=5
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.max-active=8
spring.redis.lettuce.pool.max-wait=1ms
spring.redis.lettuce.shutdown-timeout=100ms
RedisProperties.java
可见如下
/*
* 部分代码示例如下
*/
package org.springframework.boot.autoconfigure.data.redis;
import java.time.Duration;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "spring.redis")
public class RedisProperties {
/**
* Database index used by the connection factory.
*/
private int database = 0;
/**
* Connection URL. Overrides host, port, and password. User is ignored. Example:
* redis://user:password@example.com:6379
*/
private String url;
/**
* Redis server host.
*/
private String host = "localhost";
/**
* Login password of the redis server.
*/
private String password;
/**
* Redis server port.
*/
private int port = 6379;
/**
* Whether to enable SSL support.
*/
private boolean ssl;
/**
* Connection timeout.
*/
private Duration timeout;
private Sentinel sentinel;
private Cluster cluster;
private final Jedis jedis = new Jedis();
private final Lettuce lettuce = new Lettuce();
// 部分代码示例。。。
}