Skip to content

Commit

Permalink
fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardolopezb committed Jul 9, 2023
1 parent eaed1a2 commit 3a4be99
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<String, String>,
redis: RedisTemplate<String, String>,
@Value("\${redis.stream.result_key}") streamKey: String,
@Value("\${redis.groups.lint}") groupId: String,
@Autowired private val snippetService: SnippetService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String>
redis: RedisTemplate<String, String>
) : RedisStreamProducer(streamKey, redis) {

suspend fun publishEvent(event: LintRequestEvent){
println("Publishing on stream: $streamKey")
emit(event).awaitSingle()
emit(event)
}

}

0 comments on commit 3a4be99

Please sign in to comment.