diff --git a/Dockerfile b/Dockerfile index b7bf163..f3182c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,5 +10,5 @@ ENV TOKEN ${TOKEN} RUN gradle build -EXPOSE 8080 +EXPOSE 8081 ENTRYPOINT ["java","-jar","/home/gradle/src/build/libs/snippet-manager-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/build.gradle b/build.gradle index 690e5fc..2fe8e00 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ repositories { url = uri("https://maven.pkg.github.com/Snippet-Searcher/spring-mvc-redis-streams%22") credentials { username = System.getenv("USERNAME") - password = System.getenv("TOKEN") + password = System.getenv("TOKEN") } } maven { @@ -60,11 +60,11 @@ dependencies { implementation 'org.ingsis.group6:snippet-events:0.0.5' -// implementation("spring-mvc-redis-streams:lib:0.0.1-SNAPSHOT") + implementation("spring-mvc-redis-streams:lib:0.0.1-SNAPSHOT") implementation("org.springframework.boot:spring-boot-starter-data-redis") - implementation 'org.austral.ingsis:redis-streams:0.1.7' - implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive' +// implementation 'org.austral.ingsis:redis-streams:0.1.7' +// implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-reactor' } diff --git a/src/main/kotlin/ingsis/snippetmanager/redis/consumer/LinterResultEventConsumer.kt b/src/main/kotlin/ingsis/snippetmanager/redis/consumer/LinterResultEventConsumer.kt index 2f4cc41..02e5798 100644 --- a/src/main/kotlin/ingsis/snippetmanager/redis/consumer/LinterResultEventConsumer.kt +++ b/src/main/kotlin/ingsis/snippetmanager/redis/consumer/LinterResultEventConsumer.kt @@ -2,7 +2,6 @@ package ingsis.snippetmanager.redis.consumer import ingsis.snippetmanager.domains.rule.adapter.LintResultStatusToComplianceStateAdapter import ingsis.snippetmanager.domains.snippet.service.SnippetService -import org.austral.ingsis.`class`.redis.RedisStreamConsumer import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Value import org.springframework.data.redis.connection.stream.ObjectRecord @@ -11,12 +10,13 @@ import org.springframework.data.redis.core.RedisTemplate import org.springframework.data.redis.stream.StreamReceiver import org.springframework.stereotype.Component import snippet.events.lint.LintResultEvent +import spring.mvc.redis.streams.RedisStreamConsumer import java.time.Duration import java.util.* @Component class SampleConsumer @Autowired constructor( - redis: ReactiveRedisTemplate, + redis: RedisTemplate, @Value("\${redis.stream.result_key}") streamKey: String, @Value("\${redis.groups.lint}") groupId: String, @Autowired private val snippetService: SnippetService, diff --git a/src/main/kotlin/ingsis/snippetmanager/redis/producer/LintRequestProducer.kt b/src/main/kotlin/ingsis/snippetmanager/redis/producer/LintRequestProducer.kt index 4e27990..4146818 100644 --- a/src/main/kotlin/ingsis/snippetmanager/redis/producer/LintRequestProducer.kt +++ b/src/main/kotlin/ingsis/snippetmanager/redis/producer/LintRequestProducer.kt @@ -3,25 +3,25 @@ package ingsis.snippetmanager.redis.producer import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Value import kotlinx.coroutines.reactor.awaitSingle -import org.austral.ingsis.`class`.redis.RedisStreamProducer import org.springframework.data.redis.core.ReactiveRedisTemplate import org.springframework.data.redis.core.RedisTemplate import org.springframework.stereotype.Component import snippet.events.lint.LintRequestEvent import snippet.events.lint.LintResultEvent import snippet.events.lint.LintResultStatus +import spring.mvc.redis.streams.RedisStreamProducer import java.util.* @Component class LintRequestProducer @Autowired constructor( @Value("\${redis.stream.request_key}") streamKey: String, - redis: ReactiveRedisTemplate + redis: RedisTemplate ) : RedisStreamProducer(streamKey, redis) { suspend fun publishEvent(event: LintRequestEvent){ println("Publishing on stream: $streamKey") - emit(event).awaitSingle() + emit(event) } } \ No newline at end of file