i am having quite big issues to configure redis to my application. I have this config file:
@Configurationclass RedisConfig {
@Beanfun redisConnectionFactory(): JedisConnectionFactory? { val config = RedisStandaloneConfiguration("localhost", 6379) return JedisConnectionFactory(config)}@Beanfun redisTemplate(redisConnectionFactory: RedisConnectionFactory?): RedisTemplate<String, Any> { val template = RedisTemplate<String, Any>() template.setConnectionFactory(redisConnectionFactory!!) return template}
}
the gradle file looks like this:
implementation("org.springframework.boot:spring-boot-starter-webflux") implementation("org.springframework.boot:spring-boot-starter-data-r2dbc") implementation("com.fasterxml.jackson.module:jackson-module-kotlin") implementation("io.projectreactor.kotlin:reactor-kotlin-extensions") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor") implementation("org.postgresql:r2dbc-postgresql") implementation("io.github.microutils:kotlin-logging:3.0.2") implementation("org.springframework.boot:spring-boot-starter-actuator") implementation("org.apache.poi:poi-ooxml:5.2.3") implementation("com.mailjet:mailjet-client:5.2.2") implementation("org.springframework.boot:spring-boot-starter-data-redis" runtimeOnly("org.postgresql:postgresql")
Error happens the moment I add the data-redis dependency:
implementation("org.springframework.boot:spring-boot-starter-data-redis")
The actual message of error is:
Parameter 5 of constructor incom.skenarios.microservices.export.services.DataService required abean of type'com.skenarios.microservices.export.repository.MyRepo'that could not be found.
Repository looks like this:
interface RenovationRepository : CoroutineCrudRepository<TypeYearValue, Int> {
@Query("""Here my query""")fun findItemsById(buildingId: Int, start: LocalDateTime, end: LocalDateTime): Flow<TypeYearValue>
I feel like redis somehow conflicts with r2dbc dependency. Atleast from the searches I made that's what people saying. All my entities got also annotation @Table (which was suggested in some places as a fix).