Class ReactiveFeederBuilder

java.lang.Object
software.spool.publisher.api.builder.ReactiveFeederBuilder

public class ReactiveFeederBuilder extends Object
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 Details

    • from

      public ReactiveFeederBuilder from(software.spool.core.port.EventBusListener listener)
      Sets the event bus listener the feeder subscribes to.
      Parameters:
      listener - the event bus listener; must not be null
      Returns:
      this builder for chaining
    • with

      public ReactiveFeederBuilder with(software.spool.core.port.InboxUpdater updater)
      Sets the inbox updater used to change inbox item statuses.
      Parameters:
      updater - the inbox updater; must not be null
      Returns:
      this builder for chaining
    • on

      public ReactiveFeederBuilder on(software.spool.core.port.EventBusEmitter emitter)
      Sets the event bus emitter for publishing ItemPublished events.
      Parameters:
      emitter - the event bus emitter; must not be null
      Returns:
      this builder for chaining
    • withErrorRouter

      public ReactiveFeederBuilder withErrorRouter(software.spool.core.utils.ErrorRouter errorRouter)
      Sets the error router for handling exceptions during publishing.
      Parameters:
      errorRouter - the error router; must not be null
      Returns:
      this builder for chaining
    • create

      public Feeder create()
      Builds and returns the configured reactive Feeder.
      Returns:
      a new Feeder ready to start publishing
      Throws:
      NullPointerException - if any required port has not been set