Spring Redis - Read configuration from application.properties file

后端 未结 9 981
渐次进展
渐次进展 2020-12-25 13:46

I have Spring Redis working using spring-data-redis with all default configuration likes localhost default port and so on.

Now

9条回答
  •  猫巷女王i
    2020-12-25 14:18

    You can use the ResourcePropertySource to generate a PropertySource object.

    PropertySource propertySource = new ResourcePropertySource("path/to/your/application.properties");
    

    Then pass it to the constructor of the RedisSentinelConfiguration.

提交回复
热议问题