configure rabbitMQ ConnectionFactory

This commit is contained in:
2025-03-31 01:39:57 +02:00
parent e8fb80b646
commit 650e964e48
4 changed files with 40 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package eventDemo.configuration.injection
import com.rabbitmq.client.ConnectionFactory
import com.zaxxer.hikari.HikariConfig
import com.zaxxer.hikari.HikariDataSource
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInMemory
@@ -38,6 +39,16 @@ fun Module.configureDIInfrastructure(config: Configuration) {
}
} bind DataSource::class
single {
ConnectionFactory().apply {
host = config.rabbitmq.url
port = config.rabbitmq.port
virtualHost = virtualHost
username = config.rabbitmq.username
password = config.rabbitmq.password
}
}
singleOf(::GameEventBusInMemory) bind GameEventBus::class
singleOf(::GameEventStoreInPostgresql) bind GameEventStore::class
singleOf(::GameProjectionBusInMemory) bind GameProjectionBus::class