Package org.axonframework.messaging.core
Interface SubscribableEventSource
- All Known Subinterfaces:
EventBus,EventStore
- All Known Implementing Classes:
DelegatingEventBus,InboundEventMessageChannelAdapter,InterceptingEventBus,InterceptingEventStore,RecordingEventBus,RecordingEventStore,SimpleEventBus,StorageEngineBackedEventStore
public interface SubscribableEventSource
Interface for a source of
EventMessages to which event processors can subscribe.
Provides functionality to subscribe event batch consumers to receive
events published to this source. When subscribed, consumers will receive all events published to
this source since the subscription.
This interface is the replacement for the deprecated SubscribableEventSource,
focusing specifically on event message handling.
- Since:
- 5.0.0
- Author:
- Allard Buijze, Mateusz Nowak, Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptionsubscribe(BiFunction<List<? extends EventMessage>, ProcessingContext, CompletableFuture<?>> eventsBatchConsumer) Subscribe the giveneventsBatchConsumerto this event source.
-
Method Details
-
subscribe
Registration subscribe(@Nonnull BiFunction<List<? extends EventMessage>, ProcessingContext, CompletableFuture<?>> eventsBatchConsumer) Subscribe the giveneventsBatchConsumerto this event source. When subscribed, it will receive all events published to this source since the subscription.If the given
eventsBatchConsumeris already subscribed, nothing happens.Note on
ProcessingContext: TheProcessingContextparameter passed to the consumer may benull. Whennull, it is the responsibility of the registeredeventsBatchConsumerto create an appropriateProcessingContextas needed for processing the events.- Parameters:
eventsBatchConsumer- The event batches consumer to subscribe.- Returns:
- A
Registrationhandle to unsubscribe theeventsBatchConsumer. When unsubscribed, it will no longer receive events.
-