public class PersistentStreamConnection extends Object
Constructor and Description |
---|
PersistentStreamConnection(String streamId,
Configuration configuration,
io.axoniq.axonserver.connector.event.PersistentStreamProperties persistentStreamProperties,
ScheduledExecutorService scheduler,
int batchSize)
Instantiates a connection for a persistent stream.
|
PersistentStreamConnection(String streamId,
Configuration configuration,
io.axoniq.axonserver.connector.event.PersistentStreamProperties persistentStreamProperties,
ScheduledExecutorService scheduler,
int batchSize,
String defaultContext)
Instantiates a connection for a persistent stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the persistent stream connection to Axon Server.
|
void |
open(Consumer<List<? extends EventMessage<?>>> consumer)
Initiates the connection to Axon Server to read events from the persistent stream.
|
public PersistentStreamConnection(String streamId, Configuration configuration, io.axoniq.axonserver.connector.event.PersistentStreamProperties persistentStreamProperties, ScheduledExecutorService scheduler, int batchSize)
streamId
- The identifier of the persistent stream.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 PersistentStreamConnection(String streamId, Configuration configuration, io.axoniq.axonserver.connector.event.PersistentStreamProperties persistentStreamProperties, ScheduledExecutorService scheduler, int batchSize, String defaultContext)
streamId
- The identifier of the persistent stream.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.defaultContext
- The default context to use for the connection.public void open(Consumer<List<? extends EventMessage<?>>> consumer)
consumer
- The consumer of batches of event messages.public void close()
Copyright © 2010–2024. All rights reserved.