Class ReactiveFeederBuilder
java.lang.Object
software.spool.publisher.api.builder.ReactiveFeederBuilder
Fluent builder that configures and assembles a reactive
Feeder.
The resulting feeder listens for InboxItemStored events on the
event bus and publishes each item immediately. All ports are automatically
wrapped in their corresponding Safe* decorators.
Feeder feeder = FeederBuilderFactory.reactive()
.from(eventBusListener)
.with(inboxUpdater)
.on(eventBusEmitter)
.withErrorRouter(errorRouter)
.create();
-
Method Summary
Modifier and TypeMethodDescriptioncreate()Builds and returns the configured reactiveFeeder.from(software.spool.core.port.EventBusListener listener) Sets the event bus listener the feeder subscribes to.on(software.spool.core.port.EventBusEmitter emitter) Sets the event bus emitter for publishingItemPublishedevents.with(software.spool.core.port.InboxUpdater updater) Sets the inbox updater used to change inbox item statuses.withErrorRouter(software.spool.core.utils.ErrorRouter errorRouter) Sets the error router for handling exceptions during publishing.
-
Method Details
-
from
Sets the event bus listener the feeder subscribes to.- Parameters:
listener- the event bus listener; must not benull- Returns:
- this builder for chaining
-
with
Sets the inbox updater used to change inbox item statuses.- Parameters:
updater- the inbox updater; must not benull- Returns:
- this builder for chaining
-
on
Sets the event bus emitter for publishingItemPublishedevents.- Parameters:
emitter- the event bus emitter; must not benull- Returns:
- this builder for chaining
-
withErrorRouter
Sets the error router for handling exceptions during publishing.- Parameters:
errorRouter- the error router; must not benull- Returns:
- this builder for chaining
-
create
Builds and returns the configured reactiveFeeder.- Returns:
- a new
Feederready to start publishing - Throws:
NullPointerException- if any required port has not been set
-