TransactionalOutboxBuilder

Builder for TransactionalOutbox.

Example on Spring Boot:

fun transactionalOutbox(): TransactionalOutbox {
return TransactionalOutboxBuilder
.make(clock)
.withHandlers(outboxHandlers)
.withMonitorLocksProvider(monitorLocksProvider)
.withCleanupLocksProvider(cleanupLocksProvider)
.withStore(outboxStore)
.withInstantOutboxPublisher(instantOutboxPublisher)
.withThreadPoolSize(threadPoolSize)
.withThreadPriority(threadPriority)
.withThreadPoolTimeOut(threadPoolTimeOut)
.addProcessorDecorator(outboxItemProcessorDecorator)
.withGroupIdProvider(outboxGroupIdProvider)
.withGroupingConfiguration(outboxGroupingConfiguration)
.build()
}

Constructors

TransactionalOutboxBuilder
Link copied to clipboard
fun TransactionalOutboxBuilder(clock: Clock, rerunAfterDuration: Duration = DEFAULT_RERUN_AFTER_DURATION)

Types

Companion
Link copied to clipboard
object Companion

Functions

addProcessorDecorator
Link copied to clipboard
open override fun addProcessorDecorator(decorator: OutboxItemProcessorDecorator): BuildStep

Adds a decorator to be applied before asynchronously invoking Outbox Item Processors which, in turn, invokes the corresponding OutboxHandler.

build
Link copied to clipboard
open override fun build(): TransactionalOutbox

Builds the outbox.

withCleanupLocksProvider
Link copied to clipboard
open override fun withCleanupLocksProvider(locksProvider: OutboxLocksProvider): StoreStep

Sets the locks provider for the outbox cleanup runs.

withGroupIdProvider
Link copied to clipboard
open override fun withGroupIdProvider(groupIdProvider: OutboxGroupIdProvider): BuildStep

Sets the group id provider for the outbox that will be used to set corresponding field when an item is added.

withGrouping
Link copied to clipboard
open fun withGrouping(): BuildStep
withGroupingConfiguration
Link copied to clipboard
open override fun withGroupingConfiguration(outboxGroupingConfiguration: OutboxGroupingConfiguration): BuildStep

Sets the grouping configuration for the outbox.

withHandlers
Link copied to clipboard
open override fun withHandlers(handlers: Set<OutboxHandler>): MonitorLocksProviderStep

Sets the handlers for the outbox.

withInstantOrderingEnabled
Link copied to clipboard
open override fun withInstantOrderingEnabled(instantOrderingEnabled: Boolean): BuildStep

Flag which indicates whether new instant processing mechanism should be used or not.

withInstantOutboxPublisher
Link copied to clipboard
open override fun withInstantOutboxPublisher(instantOutboxPublisher: InstantOutboxPublisher): BuildStep

Sets the publisher for instant outboxes.

withMonitorLocksProvider
Link copied to clipboard
open override fun withMonitorLocksProvider(locksProvider: OutboxLocksProvider): CleanupLocksProviderStep

Sets the locks provider for the outbox monitor runs.

withoutGrouping
Link copied to clipboard
open fun withoutGrouping(): BuildStep
withStore
Link copied to clipboard
open override fun withStore(store: OutboxStore): InstantOutboxPublisherStep

Sets the store for the outbox.

withThreadPoolSize
Link copied to clipboard
open override fun withThreadPoolSize(threadPoolSize: Int): BuildStep

Sets the thread pool size for the outbox.

withThreadPoolTimeOut
Link copied to clipboard
open override fun withThreadPoolTimeOut(threadPoolTimeOut: Duration): BuildStep

Sets the thread pool timeout upon shutdown for the outbox.

withThreadPriority
Link copied to clipboard
open override fun withThreadPriority(threadPriority: Int): BuildStep

Sets the priority for the threads in the thread pool.