chore: remove unused redis
This commit is contained in:
@@ -30,7 +30,6 @@ Framework
|
||||
Database
|
||||
- Postgresql
|
||||
- with Flyway
|
||||
- Redis
|
||||
- RabbitMQ
|
||||
|
||||
Infra
|
||||
|
||||
@@ -81,7 +81,6 @@ dependencies {
|
||||
implementation("io.github.oshai:kotlin-logging-jvm:${kotlinLoggingVersion.get()}")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:${kotlinSerializationVersion.get()}")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
|
||||
implementation("redis.clients:jedis:5.2.0")
|
||||
implementation("org.postgresql:postgresql:42.7.13")
|
||||
implementation("com.zaxxer:HikariCP:6.3.0")
|
||||
implementation("com.rabbitmq:amqp-client:5.25.0")
|
||||
|
||||
@@ -25,11 +25,9 @@ Api url:
|
||||
|
||||
Exposed url on dev env:
|
||||
- [PostgreSql](http://localhost:5432/)
|
||||
- [Redis](http://localhost:6379/)
|
||||
- [RabbitMQ](http://localhost:15672/)
|
||||
|
||||
Admin service URL:
|
||||
- [Træfik dashboard](http://traefik.traefik.me/)
|
||||
- [Redis insight](http://insight.redis.traefik.me/)
|
||||
- [pgAdmin](http://pgadmin.postgresql.traefik.me/)
|
||||
- [RabbitMQ management](http://management.rabbitmq.traefik.me/)
|
||||
@@ -1,3 +1,2 @@
|
||||
REDIS_URL=redis://redis:6379
|
||||
POSTGRESQL_URL=jdbc:postgresql://postgresql/event-demo
|
||||
RABBITMQ_URL=rabbitmq
|
||||
|
||||
@@ -10,8 +10,6 @@ services:
|
||||
condition: service_healthy
|
||||
rabbitmq:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- ../.env.docker
|
||||
labels:
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
services:
|
||||
redis:
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
postgresql:
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
services:
|
||||
redis:
|
||||
image: redis/redis-stack:7.4.0-v8
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
- redisinsight_data:/redisinsight
|
||||
|
||||
flyway:
|
||||
image: flyway/flyway
|
||||
command: migrate
|
||||
@@ -45,7 +37,5 @@ services:
|
||||
- rabbitmq_data:/var/lib/rabbitmq/
|
||||
|
||||
volumes:
|
||||
redis_data:
|
||||
redisinsight_data:
|
||||
postgresql_data:
|
||||
rabbitmq_data:
|
||||
@@ -13,8 +13,6 @@ services:
|
||||
condition: service_healthy
|
||||
rabbitmq:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- ../.env.docker
|
||||
|
||||
|
||||
@@ -12,12 +12,6 @@ services:
|
||||
- "traefik.http.routers.pgadmin.rule=Host(`pgadmin.postgresql.traefik.me`)"
|
||||
- "traefik.http.services.pgadmin.loadbalancer.server.port=80"
|
||||
|
||||
redis:
|
||||
labels:
|
||||
- "traefik.http.routers.redisinsight.rule=Host(`insight.redis.traefik.me`)"
|
||||
- "traefik.http.routers.redisinsight.service=redisinsight"
|
||||
- "traefik.http.services.redisinsight.loadbalancer.server.port=8001"
|
||||
|
||||
rabbitmq:
|
||||
labels:
|
||||
- "traefik.http.routers.rabbitmq-management.rule=Host(`management.rabbitmq.traefik.me`)"
|
||||
|
||||
@@ -3,7 +3,6 @@ package eventDemo.configuration
|
||||
import io.ktor.server.config.ApplicationConfig
|
||||
|
||||
data class Configuration(
|
||||
val redisUrl: String,
|
||||
val jwtSecret: String,
|
||||
val postgresql: Postgresql,
|
||||
val rabbitmq: RabbitMQ,
|
||||
@@ -25,7 +24,6 @@ data class Configuration(
|
||||
val ApplicationConfig.configuration
|
||||
get() =
|
||||
Configuration(
|
||||
redisUrl = getProperty("redis.url"),
|
||||
jwtSecret = getProperty("jwt.secret"),
|
||||
postgresql =
|
||||
Configuration.Postgresql(
|
||||
|
||||
@@ -7,8 +7,6 @@ import org.koin.core.module.Module
|
||||
import org.koin.core.scope.Scope
|
||||
import org.koin.core.scope.ScopeCallback
|
||||
import org.koin.dsl.bind
|
||||
import redis.clients.jedis.JedisPooled
|
||||
import redis.clients.jedis.UnifiedJedis
|
||||
import javax.sql.DataSource
|
||||
|
||||
fun Module.configureDIDataSource(config: Configuration) {
|
||||
@@ -26,11 +24,6 @@ fun Module.configureDIDataSource(config: Configuration) {
|
||||
}
|
||||
} bind DataSource::class
|
||||
|
||||
// Redis (for Projections)
|
||||
single {
|
||||
JedisPooled(config.redisUrl)
|
||||
} bind UnifiedJedis::class
|
||||
|
||||
// RabbitMQ (for EventBus)
|
||||
factory {
|
||||
ConnectionFactory().apply {
|
||||
|
||||
@@ -12,11 +12,6 @@ jwt {
|
||||
secret = ${?JWT_SECRET}
|
||||
}
|
||||
|
||||
redis {
|
||||
url = "redis://localhost:6379"
|
||||
url = ${?REDIS_URL}
|
||||
}
|
||||
|
||||
postgresql {
|
||||
url = "jdbc:postgresql://localhost:5432/event-demo"
|
||||
url = ${?POSTGRESQL_URL}
|
||||
|
||||
@@ -7,7 +7,5 @@ object Tag {
|
||||
|
||||
object RabbitMQ : Tag()
|
||||
|
||||
object Redis : Tag()
|
||||
|
||||
object Concurrence : Tag()
|
||||
}
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package eventDemo.contexts.game.intrastructure.persistence.connectors
|
||||
|
||||
import eventDemo.Tag
|
||||
import eventDemo.testHelpers.testKoinApplicationWithConfig
|
||||
import io.kotest.core.spec.style.FunSpec
|
||||
import io.kotest.matchers.equals.shouldBeEqual
|
||||
import redis.clients.jedis.UnifiedJedis
|
||||
|
||||
class RedisTest :
|
||||
FunSpec({
|
||||
tags(Tag.Redis)
|
||||
|
||||
test("test connection with jedis") {
|
||||
testKoinApplicationWithConfig {
|
||||
get<UnifiedJedis>().also {
|
||||
it.set("test", "test")
|
||||
it.get("test") shouldBeEqual "test"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,7 +1,6 @@
|
||||
package eventDemo.testHelpers
|
||||
|
||||
import org.koin.core.Koin
|
||||
import redis.clients.jedis.UnifiedJedis
|
||||
import javax.sql.DataSource
|
||||
|
||||
fun DataSource.cleanEventSource() {
|
||||
@@ -17,11 +16,6 @@ fun DataSource.cleanEventSource() {
|
||||
}
|
||||
}
|
||||
|
||||
fun UnifiedJedis.cleanProjections() {
|
||||
flushAll()
|
||||
}
|
||||
|
||||
fun Koin.cleanDataTest() {
|
||||
get<DataSource>().cleanEventSource()
|
||||
get<UnifiedJedis>().cleanProjections()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user