올바르게 Bean이 설정되었는지 출력하는 코드 추가
This commit is contained in:
parent
ee0c99bec9
commit
2ba798b606
|
@ -0,0 +1,21 @@
|
||||||
|
package kr.co.vividnext.sodalive
|
||||||
|
|
||||||
|
import org.springframework.boot.ApplicationArguments
|
||||||
|
import org.springframework.boot.ApplicationRunner
|
||||||
|
import org.springframework.context.ApplicationContext
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate
|
||||||
|
import org.springframework.data.repository.CrudRepository
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
|
||||||
|
@Component
|
||||||
|
class RedisBeanInspector(val ctx: ApplicationContext) : ApplicationRunner {
|
||||||
|
override fun run(args: ApplicationArguments?) {
|
||||||
|
ctx.getBeansOfType(RedisTemplate::class.java).forEach { (name, bean) ->
|
||||||
|
println("RedisTemplate Bean: $name -> $bean")
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.getBeansOfType(CrudRepository::class.java).forEach { (name, bean) ->
|
||||||
|
println("CrudRepository Bean: $name -> ${bean.javaClass}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue