public class PersistentStreamMessageSource extends Object implements SubscribableMessageSource<EventMessage<?>>
SubscribableMessageSource that receives event from a persistent stream from Axon Server. The persistent
stream is identified by a unique name, which serves as an identifier for the PersistentStream connection with
Axon Server. Using the same name for different instances will overwrite the existing connection.| Constructor and Description |
|---|
PersistentStreamMessageSource(String name,
Configuration configuration,
io.axoniq.axonserver.connector.event.PersistentStreamProperties persistentStreamProperties,
ScheduledExecutorService scheduler,
int batchSize)
Instantiates a
PersistentStreamMessageSource. |
PersistentStreamMessageSource(String name,
Configuration configuration,
io.axoniq.axonserver.connector.event.PersistentStreamProperties persistentStreamProperties,
ScheduledExecutorService scheduler,
int batchSize,
String context)
Instantiates a
PersistentStreamMessageSource. |
| Modifier and Type | Method and Description |
|---|---|
Registration |
subscribe(Consumer<List<? extends EventMessage<?>>> consumer)
Subscribe the given
messageProcessor to this message source. |
public PersistentStreamMessageSource(String name, Configuration configuration, io.axoniq.axonserver.connector.event.PersistentStreamProperties persistentStreamProperties, ScheduledExecutorService scheduler, int batchSize)
PersistentStreamMessageSource.name - The name of the persistent stream. It's a unique identifier of the
PersistentStream connection with Axon Sever. Usage of the same name
will overwrite the existing connection.configuration - Global configuration of Axon components.persistentStreamProperties - Properties for the persistent stream.scheduler - Scheduler thread pool to schedule tasks.batchSize - The batch size for collecting events.public PersistentStreamMessageSource(String name, Configuration configuration, io.axoniq.axonserver.connector.event.PersistentStreamProperties persistentStreamProperties, ScheduledExecutorService scheduler, int batchSize, String context)
PersistentStreamMessageSource.name - The name of the persistent stream. It's a unique identifier of the
PersistentStream connection with Axon Sever. Usage of the same name
will overwrite the existing connection.configuration - Global configuration of Axon components.persistentStreamProperties - Properties for the persistent stream.scheduler - Scheduler thread pool to schedule tasks.batchSize - The batch size for collecting events.context - The context in which this persistent stream exists (or needs to be created).public Registration subscribe(@Nonnull Consumer<List<? extends EventMessage<?>>> consumer)
SubscribableMessageSourcemessageProcessor to this message source. When subscribed, it will receive all
messages published to this source.
If the given messageProcessor is already subscribed, nothing happens.
subscribe in interface SubscribableMessageSource<EventMessage<?>>consumer - The message processor to subscribemessageProcessor. When unsubscribed it will no longer receive
messages.Copyright © 2010–2026. All rights reserved.