public class PersistentStreamMessageSource extends Object implements SubscribableMessageSource<EventMessage<?>>
SubscribableMessageSource
that receives event from a persistent stream from Axon Server.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 event processor.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 event processor.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)
SubscribableMessageSource
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.
subscribe
in interface SubscribableMessageSource<EventMessage<?>>
consumer
- The message processor to subscribemessageProcessor
. When unsubscribed it will no longer receive
messages.Copyright © 2010–2024. All rights reserved.