Interface PersistentStreamEventSourceFactory
- All Known Implementing Classes:
DefaultPersistentStreamEventSourceFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Factory for creating
PersistentStreamEventSource instances.
Provides a customization point for PersistentStreamEventSource construction. The default implementation is
DefaultPersistentStreamEventSourceFactory, which additionally tracks stream names and emits a warning when
the same Axon Server stream name is used more than once.
In a Spring Boot application the factory is registered as a @ConditionalOnMissingBean, so advanced use cases
(e.g. multi-tenancy) can replace it by declaring their own bean of this type.
- Since:
- 5.2.0
- Author:
- Jakob Hatzl
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild(String name, io.axoniq.axonserver.connector.event.PersistentStreamProperties properties, ScheduledExecutorService scheduler, int batchSize, Configuration configuration) Builds aPersistentStreamEventSourcefor the given stream parameters.The defaultPersistentStreamEventSourceFactory(aDefaultPersistentStreamEventSourceFactory) to be used to createPersistentStreamEventSourceinstances.
-
Method Details
-
build
PersistentStreamEventSource build(String name, io.axoniq.axonserver.connector.event.PersistentStreamProperties properties, ScheduledExecutorService scheduler, int batchSize, Configuration configuration) Builds aPersistentStreamEventSourcefor the given stream parameters.The supplied
Configurationprovides access to all registered framework components, such as theAxonServerConnectionManagerandEventConverter, so implementations do not need to receive those as constructor arguments.- Parameters:
name- the unique stream name on Axon Serverproperties- the persistent stream properties (segment count, sequencing policy, filter, etc.)scheduler- the scheduled executor to use for this stream's background tasksbatchSize- the maximum number of events to deliver per batchconfiguration- the framework configuration from which additional components can be retrieved- Returns:
- a new
PersistentStreamEventSource
-
defaultFactory
The defaultPersistentStreamEventSourceFactory(aDefaultPersistentStreamEventSourceFactory) to be used to createPersistentStreamEventSourceinstances.- Returns:
- the default
PersistentStreamEventSourceFactory
-