Class DefaultPersistentStreamEventSourceFactory
java.lang.Object
io.axoniq.framework.axonserver.connector.event.DefaultPersistentStreamEventSourceFactory
- All Implemented Interfaces:
PersistentStreamEventSourceFactory
public class DefaultPersistentStreamEventSourceFactory
extends Object
implements PersistentStreamEventSourceFactory
Default implementation of
PersistentStreamEventSourceFactory.
Tracks all stream names that have been used to create a PersistentStreamEventSource and logs a warning when
the same Axon Server stream name is used more than once. Two sources sharing the same server-side stream name will
join the same stream, which is typically a misconfiguration.
- Since:
- 5.2.0
- Author:
- Jakob Hatzl
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PersistentStreamEventSourceFactoryDefault singleton instance for theDefaultPersistentStreamEventSourceFactory. -
Constructor Summary
Constructors -
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.
-
Field Details
-
INSTANCE
Default singleton instance for theDefaultPersistentStreamEventSourceFactory. Use this to ensure stream name duplication warnings across all streams constructed with this.
-
-
Constructor Details
-
DefaultPersistentStreamEventSourceFactory
public DefaultPersistentStreamEventSourceFactory()
-
-
Method Details
-
build
public PersistentStreamEventSource build(String name, io.axoniq.axonserver.connector.event.PersistentStreamProperties properties, ScheduledExecutorService scheduler, int batchSize, Configuration configuration) Description copied from interface:PersistentStreamEventSourceFactoryBuilds 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.- Specified by:
buildin interfacePersistentStreamEventSourceFactory- 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
-