0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

SpringBootでRedisの設定を外から与えても動かない時

Posted at

事象

SpringBootの公式手順に則って

@Configuration
class AppConfig {

  @Bean
  public JedisConnectionFactory redisConnectionFactory() {
    return new JedisConnectionFactory();
  }
}

と書いて、外から設定を

export SPRING_REDIS_HOST="xxx.xxx.xxx.xxx"

と与えてみたものの、localhostを参照しているような挙動になってしまう。

※ spring.redis.host を環境変数で設定している

解決

  @Bean
  public JedisConnectionFactory redisConnectionFactory() {
    return new JedisConnectionFactory();
  }

を削除したら動いた。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?