disable redis
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.configuration.business
|
package eventDemo.configuration.business
|
||||||
|
|
||||||
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInRedis
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInMemory
|
||||||
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInRedis
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInMemory
|
||||||
import eventDemo.business.event.projection.projectionListener.ReactionListener
|
import eventDemo.business.event.projection.projectionListener.ReactionListener
|
||||||
import org.koin.core.Koin
|
import org.koin.core.Koin
|
||||||
|
|
||||||
@@ -9,9 +9,9 @@ fun Koin.configureGameListener() {
|
|||||||
ReactionListener(get())
|
ReactionListener(get())
|
||||||
.subscribeToBus(get())
|
.subscribeToBus(get())
|
||||||
|
|
||||||
get<GameStateRepositoryInRedis>()
|
get<GameStateRepositoryInMemory>()
|
||||||
.subscribeToBus(get(), get())
|
.subscribeToBus(get(), get())
|
||||||
|
|
||||||
get<GameListRepositoryInRedis>()
|
get<GameListRepositoryInMemory>()
|
||||||
.subscribeToBus(get(), get())
|
.subscribeToBus(get(), get())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import com.zaxxer.hikari.HikariConfig
|
|||||||
import com.zaxxer.hikari.HikariDataSource
|
import com.zaxxer.hikari.HikariDataSource
|
||||||
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInRabbinMQ
|
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInRabbinMQ
|
||||||
import eventDemo.adapter.infrastructureLayer.event.GameEventStoreInPostgresql
|
import eventDemo.adapter.infrastructureLayer.event.GameEventStoreInPostgresql
|
||||||
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInRedis
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInMemory
|
||||||
import eventDemo.adapter.infrastructureLayer.event.projection.GameProjectionBusInMemory
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameProjectionBusInMemory
|
||||||
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInRedis
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInMemory
|
||||||
import eventDemo.business.event.GameEventBus
|
import eventDemo.business.event.GameEventBus
|
||||||
import eventDemo.business.event.GameEventStore
|
import eventDemo.business.event.GameEventStore
|
||||||
import eventDemo.business.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
@@ -17,15 +17,9 @@ import eventDemo.libs.event.projection.SnapshotConfig
|
|||||||
import org.koin.core.module.Module
|
import org.koin.core.module.Module
|
||||||
import org.koin.core.module.dsl.singleOf
|
import org.koin.core.module.dsl.singleOf
|
||||||
import org.koin.dsl.bind
|
import org.koin.dsl.bind
|
||||||
import redis.clients.jedis.JedisPooled
|
|
||||||
import redis.clients.jedis.UnifiedJedis
|
|
||||||
import javax.sql.DataSource
|
import javax.sql.DataSource
|
||||||
|
|
||||||
fun Module.configureDIInfrastructure(config: Configuration) {
|
fun Module.configureDIInfrastructure(config: Configuration) {
|
||||||
single {
|
|
||||||
JedisPooled(config.redisUrl)
|
|
||||||
} bind UnifiedJedis::class
|
|
||||||
|
|
||||||
single {
|
single {
|
||||||
HikariConfig()
|
HikariConfig()
|
||||||
.apply {
|
.apply {
|
||||||
@@ -53,10 +47,10 @@ fun Module.configureDIInfrastructure(config: Configuration) {
|
|||||||
singleOf(::GameProjectionBusInMemory) bind GameProjectionBus::class
|
singleOf(::GameProjectionBusInMemory) bind GameProjectionBus::class
|
||||||
|
|
||||||
single {
|
single {
|
||||||
GameStateRepositoryInRedis(get(), get(), snapshotConfig = SnapshotConfig())
|
GameStateRepositoryInMemory(get(), snapshotConfig = SnapshotConfig())
|
||||||
} bind GameStateRepository::class
|
} bind GameStateRepository::class
|
||||||
|
|
||||||
single {
|
single {
|
||||||
GameListRepositoryInRedis(get(), get(), snapshotConfig = SnapshotConfig())
|
GameListRepositoryInMemory(get(), snapshotConfig = SnapshotConfig())
|
||||||
} bind GameListRepository::class
|
} bind GameListRepository::class
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,5 +60,4 @@ fun UnifiedJedis.cleanProjections() {
|
|||||||
|
|
||||||
fun Koin.cleanDataTest() {
|
fun Koin.cleanDataTest() {
|
||||||
get<DataSource>().cleanEventSource()
|
get<DataSource>().cleanEventSource()
|
||||||
get<UnifiedJedis>().cleanProjections()
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class RedisTest :
|
|||||||
FunSpec({
|
FunSpec({
|
||||||
tags(NamedTag("redis"))
|
tags(NamedTag("redis"))
|
||||||
|
|
||||||
test("test connection with jedis") {
|
xtest("test connection with jedis") {
|
||||||
JedisPooled(redisUrl).also {
|
JedisPooled(redisUrl).also {
|
||||||
it.set("test", "test")
|
it.set("test", "test")
|
||||||
it.get("test") shouldBeEqual "test"
|
it.get("test") shouldBeEqual "test"
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ class ProjectionSnapshotRepositoryTest :
|
|||||||
val projectionRepo =
|
val projectionRepo =
|
||||||
listOf(
|
listOf(
|
||||||
::getSnapshotRepoInMemoryTest,
|
::getSnapshotRepoInMemoryTest,
|
||||||
::getSnapshotRepoInRedisTest,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
val list =
|
val list =
|
||||||
|
|||||||
Reference in New Issue
Block a user