Home > Back-end >  Springboot integration dangdang is a problem with the config - toolkit, there is a problem
Springboot integration dangdang is a problem with the config - toolkit, there is a problem

Time:10-16

Springboot integration dangdang config - toolkit, configuration is no problem,
But such as Redis, can appear the following questions,



Configuration no problem, can prove this:



Suspected to be connected with springboot start order, but don't know where to start, please give advice or comments!

CodePudding user response:

Some online posts, are basic springboot integration, don't all have encountered such a problem?

CodePudding user response:

You the # {coldConfigGroup [' redis. Host]} expression from which to see, is not to identify, this is the problem of redis connection, normal server configuration of the machine address or 127.0.0.1

CodePudding user response:

Variable is not identify

Put the actual value directly

CodePudding user response:

Configuration is wrong, you change the
# redis server address (the default is loaclhost)
Host: 127.0.0.1
# redis port (default is 6379)
Post: 6379

CodePudding user response:

@ tianfang @ night also my aim is to put the configuration and application isolation, not the database connection string, database password, IP port production environment and other sensitive information in the spring configuration file, you can know about the config-toolkit:https://github.com/dangdangdotcom/config-toolkit/wiki

CodePudding user response:

Under debugging RedisProperties. GetHost () the value of the
Value and should be @ @ ConfigurationProperties two external data processing method is different, the config - toolkit can only change the Spring's handling of the @ Value
Can use @ the Value in the configuration class into config - toolkit processing after the host, and then reference manual registration LettuceConnectionFactory springboot code

CodePudding user response:

refer to 6th floor waste seven years response:
RedisProperties under debugging. The getHost () the value of the
Value and should be @ @ ConfigurationProperties two external data processing method is different, the config - toolkit can only change the Spring's handling of the @ Value
Can use @ the Value in the configuration class into config - toolkit after processing of the host, and then reference springboot code manually register LettuceConnectionFactory

Correction, the reason should be ConfigurationProperties does not support SPEL
  • Related