All Downloads are FREE. Search and download functionalities are using the official Maven repository.

memento.mn.jdbc.MicroEventStoreFactory.groovy Maven / Gradle / Ivy

Go to download

Memento tries to provide a high level abstraction for different EventStore implementations

The newest version!
package memento.mn.jdbc

import memento.EventBusPort
import memento.EventStoragePort
import memento.EventStore
import memento.Memento
import memento.EventSerdePort
import io.micronaut.context.annotation.Factory
import io.micronaut.context.annotation.Value

import jakarta.inject.Singleton

@Factory
class MicroEventStoreFactory {

    @Singleton
    EventStore createConfig(
            EventStoragePort storage,
            EventBusPort eventBus,
            EventSerdePort serdePort,
            @Value('${memento.snapshot.threshold:10}') Integer snapshotThreshold
    ) {
        return Memento.builder()
            .eventStorage(storage)
            .eventBus(eventBus)
            .serde(serdePort)
            .snapshotThreshold(snapshotThreshold)
            .build()
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy