Interface SubscribableMessageSource<M extends Message<?>>

Type Parameters:
M - the message type
All Known Subinterfaces:
EventBus, EventStore
All Known Implementing Classes:
AbstractEventBus, AbstractEventStore, AxonServerEventStore, EmbeddedEventStore, EmbeddedEventStore, InboundEventMessageChannelAdapter, PersistentStreamMessageSource, SimpleEventBus

public interface SubscribableMessageSource<M extends Message<?>>
Interface for a source of messages to which message processors can subscribe.
Since:
3.0
Author:
Allard Buijze
  • Method Summary

    Modifier and Type
    Method
    Description
    subscribe(Consumer<List<? extends M>> messageProcessor)
    Subscribe the given messageProcessor to this message source.
  • Method Details

    • subscribe

      Registration subscribe(@Nonnull Consumer<List<? extends M>> messageProcessor)
      Subscribe the given messageProcessor to this message source. When subscribed, it will receive all messages published to this source.

      If the given messageProcessor is already subscribed, nothing happens.

      Parameters:
      messageProcessor - The message processor to subscribe
      Returns:
      a handle to unsubscribe the messageProcessor. When unsubscribed it will no longer receive messages.