Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Commit

Permalink
fix(redis): Conditionally wire up redis beans (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
robzienert authored Dec 19, 2017
1 parent 606396c commit aa77221
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ open class RedisQueueConfiguration {
@Bean @ConditionalOnMissingBean(GenericObjectPoolConfig::class)
open fun redisPoolConfig() = GenericObjectPoolConfig()

@Bean open fun queueRedisPool(
@Bean @ConditionalOnMissingBean(name = arrayOf("queueRedisPool"))
open fun queueRedisPool(
@Value("\${redis.connection:redis://localhost:6379}") connection: String,
@Value("\${redis.timeout:2000}") timeout: Int,
redisPoolConfig: GenericObjectPoolConfig
Expand All @@ -56,7 +57,8 @@ open class RedisQueueConfiguration {
JedisPool(redisPoolConfig, cx.host, port, timeout, password, db)
}

@Bean open fun queue(
@Bean @ConditionalOnMissingBean(name = arrayOf("queue"))
open fun queue(
@Qualifier("queueRedisPool") redisPool: Pool<Jedis>,
redisQueueProperties: RedisQueueProperties,
clock: Clock,
Expand All @@ -74,7 +76,8 @@ open class RedisQueueConfiguration {
ackTimeout = Duration.ofSeconds(redisQueueProperties.ackTimeoutSeconds.toLong())
)

@Bean open fun redisDeadMessageHandler(
@Bean @ConditionalOnMissingBean(name = arrayOf("redisDeadMessageHandler"))
open fun redisDeadMessageHandler(
@Qualifier("queueRedisPool") redisPool: Pool<Jedis>,
redisQueueProperties: RedisQueueProperties,
clock: Clock
Expand Down

0 comments on commit aa77221

Please sign in to comment.