Class BufferedEventStream
- java.lang.Object
-
- io.axoniq.axonserver.connector.impl.FlowControlledStream<T,R>
-
- io.axoniq.axonserver.connector.impl.FlowControlledBuffer<T,R>
-
- io.axoniq.axonserver.connector.impl.AbstractBufferedStream<EventWithToken,GetEventsRequest>
-
- io.axoniq.axonserver.connector.event.impl.BufferedEventStream
-
- All Implemented Interfaces:
EventStream,ResultStream<EventWithToken>,io.grpc.stub.ClientResponseObserver<GetEventsRequest,EventWithToken>,io.grpc.stub.StreamObserver<EventWithToken>,AutoCloseable
public class BufferedEventStream extends AbstractBufferedStream<EventWithToken,GetEventsRequest> implements EventStream
Buffering implementation of theEventStreamused for Event processing.
-
-
Constructor Summary
Constructors Constructor Description BufferedEventStream(ClientIdentification clientId, long trackingToken, int bufferSize, int refillBatch, boolean forceReadFromLeader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GetEventsRequestbuildFlowControlMessage(FlowControl flowControl)Build a flow control message of typeOUTbased on the givenflowControl.protected GetEventsRequestbuildInitialFlowControlMessage(FlowControl flowControl)Builds the initial flow control message of typeOUTbased on the givenflowControl.voidexcludePayloadType(String payloadType, String revision)Instructs AxonServer to not send messages with the givenpayloadTypeandrevision.protected EventWithTokenterminalMessage()Builds a terminal message of typeTspecifying when the this stream is closed.-
Methods inherited from class io.axoniq.axonserver.connector.impl.AbstractBufferedStream
close, getError, isClosed, next, nextIfAvailable, nextIfAvailable, onAvailable, onCloseRequested, onCompleted, onError, onNext, peek
-
Methods inherited from class io.axoniq.axonserver.connector.impl.FlowControlledBuffer
beforeStart, getErrorResult, take, tryTake, tryTake, tryTake, tryTakeNow
-
Methods inherited from class io.axoniq.axonserver.connector.impl.FlowControlledStream
enableFlowControl, markConsumed, outboundStream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.axoniq.axonserver.connector.ResultStream
close, getError, isClosed, next, nextIfAvailable, nextIfAvailable, onAvailable, peek
-
-
-
-
Constructor Detail
-
BufferedEventStream
public BufferedEventStream(ClientIdentification clientId, long trackingToken, int bufferSize, int refillBatch, boolean forceReadFromLeader)
- Parameters:
clientId- The client identifier starting this stream.trackingToken- The position to start thisBufferedEventStreamat.bufferSize- The buffer size of this event stream.refillBatch- The number of Events to consume prior refilling the buffer.forceReadFromLeader- Abooleandefining whether Events must be read from the leader.
-
-
Method Detail
-
buildFlowControlMessage
protected GetEventsRequest buildFlowControlMessage(FlowControl flowControl)
Description copied from class:FlowControlledStreamBuild a flow control message of typeOUTbased on the givenflowControl.- Specified by:
buildFlowControlMessagein classFlowControlledStream<EventWithToken,GetEventsRequest>- Parameters:
flowControl- theFlowControlmessage used to base this implementation's flow control message on- Returns:
- the message used by this implementation to request new entries of type
IN
-
buildInitialFlowControlMessage
protected GetEventsRequest buildInitialFlowControlMessage(FlowControl flowControl)
Description copied from class:FlowControlledStreamBuilds the initial flow control message of typeOUTbased on the givenflowControl.- Overrides:
buildInitialFlowControlMessagein classFlowControlledStream<EventWithToken,GetEventsRequest>- Parameters:
flowControl- theFlowControlmessage used to base this implementation's flow control message on- Returns:
- the initial message used by this implementation to request new entries of type
IN
-
terminalMessage
protected EventWithToken terminalMessage()
Description copied from class:FlowControlledBufferBuilds a terminal message of typeTspecifying when the this stream is closed.- Specified by:
terminalMessagein classFlowControlledBuffer<EventWithToken,GetEventsRequest>- Returns:
- a terminal message of type
Tspecifying when the this stream is closed
-
excludePayloadType
public void excludePayloadType(String payloadType, String revision)
Description copied from interface:EventStreamInstructs AxonServer to not send messages with the givenpayloadTypeandrevision. This method is in no way a guarantee that these message will no longer be sent at all. Some messages may already have been en-route, and AxonServer may decide to send messages every once in a while as a "beacon" to relay progress of the tracking token. It may choose, however, to omit the actual payload, in that case.- Specified by:
excludePayloadTypein interfaceEventStream- Parameters:
payloadType- the type of payload to exclude from the streamrevision- the revision of the payload to exclude from the stream
-
-