Interface ReactiveStreamCommands
- All Known Subinterfaces:
ReactiveClusterStreamCommands
public interface ReactiveStreamCommands
Stream-specific Redis commands executed using reactive infrastructure.
- Since:
- 2.2
- Author:
- Mark Paluch, Christoph Strobl, Tugdual Grall, Dengliming, Mark John Moreno, jinkshower
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classXACKcommand parameters.static classXADDcommand parameters.static classXDELcommand parameters.static classstatic classValue Object holding parameters for obtaining pending messages.static classXRANGE/XREVRANGEcommand parameters.static classXRANGE/XREVRANGEcommand parameters.static classXTRIMcommand parameters.static classXCLAIMcommand parameters.static class -
Method Summary
Modifier and TypeMethodDescriptionFlux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.ReadCommand,Flux<ByteBufferRecord>>> read(Publisher<ReactiveStreamCommands.ReadCommand> commands) Read records from one or moreStreamOffsets.xAck(ByteBuffer key, String group, String... recordIds) Acknowledge one or more records as processed.xAck(ByteBuffer key, String group, RecordId... recordIds) Acknowledge one or more records as processed.Acknowledge one or more records as processed.xAdd(ByteBuffer key, Map<ByteBuffer, ByteBuffer> body) Add stream record with given body to key.xAdd(Publisher<ReactiveStreamCommands.AddStreamRecord> commands) Add stream record with given body to key.xAdd(ByteBufferRecord record) Add stream record with given body to key.xAdd(ByteBufferRecord record, RedisStreamCommands.XAddOptions xAddOptions) Add stream record with the specified options.default Flux<ByteBufferRecord>Change the ownership of a pending message to the given new consumer.default Flux<ByteBufferRecord>xClaim(ByteBuffer key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer.Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.XClaimCommand,Flux<ByteBufferRecord>>> xClaim(Publisher<ReactiveStreamCommands.XClaimCommand> commands) Change the ownership of a pending message to the given new consumer.xClaimJustId(ByteBuffer key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer without increasing the delivered count.Change the ownership of a pending message to the given new consumer without increasing the delivered count.xDel(ByteBuffer key, String... recordIds) Removes the specified entries from the stream.xDel(ByteBuffer key, RecordId... recordIds) Removes the specified entries from the stream.xDel(Publisher<ReactiveStreamCommands.DeleteCommand> commands) Removes the specified entries from the stream.xGroup(Publisher<ReactiveStreamCommands.GroupCommand> commands) Execute the givenReactiveStreamCommands.GroupCommandto create, destroy,... groups.Execute the givenReactiveStreamCommands.GroupCommandto create, destroy,... groups.xGroupCreate(ByteBuffer key, String groupName, ReadOffset readOffset) Create a consumer group.xGroupCreate(ByteBuffer key, String groupName, ReadOffset readOffset, boolean mkStream) Create a consumer group.xGroupDelConsumer(ByteBuffer key, String groupName, String consumerName) Delete a consumer from a consumer group.xGroupDelConsumer(ByteBuffer key, Consumer consumer) Delete a consumer from a consumer group.xGroupDestroy(ByteBuffer key, String groupName) Destroy a consumer group.default Mono<StreamInfo.XInfoStream>xInfo(ByteBuffer key) Obtain general information about the stream stored at the specified key.Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.XInfoCommand,StreamInfo.XInfoStream>> xInfo(Publisher<ReactiveStreamCommands.XInfoCommand> commands) Obtain general information about the stream stored at the specified key.default Flux<StreamInfo.XInfoConsumer>xInfoConsumers(ByteBuffer key, String groupName) Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.XInfoCommand,Flux<StreamInfo.XInfoConsumer>>> Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.default Flux<StreamInfo.XInfoGroup>xInfoGroups(ByteBuffer key) Obtain general information about the stream stored at the specified key.Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.XInfoCommand,Flux<StreamInfo.XInfoGroup>>> Obtain general information about the stream stored at the specified key.xLen(ByteBuffer key) Get the size of the stream stored at key.xLen(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get the size of the stream stored atReactiveRedisConnection.KeyCommand.getKey()default Mono<PendingMessagesSummary>xPending(ByteBuffer key, String groupName) Obtain thePendingMessagesSummaryfor a given consumer group.default Mono<PendingMessages>xPending(ByteBuffer key, String groupName, String consumerName) Obtained detailed information about all pending messages for a given consumer.default Mono<PendingMessages>default Mono<PendingMessages>xPending(ByteBuffer key, String groupName, Range<?> range, Long count) default Mono<PendingMessages>xPending(ByteBuffer key, Consumer consumer) Obtained detailed information about all pending messages for a givenConsumer.default Mono<PendingMessages>xPending(ByteBuffer key, Consumer consumer, Range<?> range, Long count) Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.PendingRecordsCommand,PendingMessages>> Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.PendingRecordsCommand,PendingMessagesSummary>> Obtain thePendingMessagesSummaryfor a given consumer group.default Flux<ByteBufferRecord>xRange(ByteBuffer key, Range<String> range) Read records from a stream within a specificRange.default Flux<ByteBufferRecord>xRange(ByteBuffer key, Range<String> range, Limit limit) Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.RangeCommand,Flux<ByteBufferRecord>>> xRange(Publisher<ReactiveStreamCommands.RangeCommand> commands) default Flux<ByteBufferRecord>xRead(StreamOffset<ByteBuffer>... streams) Read records from one or moreStreamOffsets.default Flux<ByteBufferRecord>xRead(StreamReadOptions readOptions, StreamOffset<ByteBuffer>... streams) Read records from one or moreStreamOffsets.default Flux<ByteBufferRecord>xReadGroup(Consumer consumer, StreamOffset<ByteBuffer>... streams) Read records from one or moreStreamOffsets using a consumer group.default Flux<ByteBufferRecord>xReadGroup(Consumer consumer, StreamReadOptions readOptions, StreamOffset<ByteBuffer>... streams) Read records from one or moreStreamOffsets using a consumer group.default Flux<ByteBufferRecord>xRevRange(ByteBuffer key, Range<String> range) Read records from a stream within a specificRangein reverse order.default Flux<ByteBufferRecord>xRevRange(ByteBuffer key, Range<String> range, Limit limit) Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.RangeCommand,Flux<ByteBufferRecord>>> xTrim(ByteBuffer key, long count) Trims the stream tocountelements.xTrim(ByteBuffer key, long count, boolean approximateTrimming) Trims the stream tocountelements.xTrim(Publisher<ReactiveStreamCommands.TrimCommand> commands) Trims the stream tocountelements.
-
Method Details
-
xAck
Acknowledge one or more records as processed.- Parameters:
key- the stream key.group- name of the consumer group.recordIds- record Id's to acknowledge.- Returns:
Monoemitting the nr of acknowledged messages.- See Also:
-
xAck
Acknowledge one or more records as processed.- Parameters:
key- the stream key.group- name of the consumer group.recordIds- record Id's to acknowledge.- Returns:
Monoemitting the nr of acknowledged messages.- See Also:
-
xAck
Flux<ReactiveRedisConnection.NumericResponse<ReactiveStreamCommands.AcknowledgeCommand,Long>> xAck(Publisher<ReactiveStreamCommands.AcknowledgeCommand> commands) Acknowledge one or more records as processed.- Parameters:
commands- must not be null.- Returns:
Fluxemitting the nr of acknowledged messages perReactiveStreamCommands.AcknowledgeCommand.- See Also:
-
xAdd
Add stream record with given body to key. -
xAdd
Add stream record with given body to key. -
xAdd
Add stream record with the specified options. -
xAdd
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.AddStreamRecord,RecordId>> xAdd(Publisher<ReactiveStreamCommands.AddStreamRecord> commands) Add stream record with given body to key.- Parameters:
commands- must not be null.- Returns:
Fluxemitting theRecordIdon by for the givenReactiveStreamCommands.AddStreamRecordcommands.- See Also:
-
xClaimJustId
default Flux<RecordId> xClaimJustId(ByteBuffer key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer without increasing the delivered count. -
xClaimJustId
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.XClaimCommand,Flux<RecordId>>> xClaimJustId(Publisher<ReactiveStreamCommands.XClaimCommand> commands) Change the ownership of a pending message to the given new consumer without increasing the delivered count. -
xClaim
default Flux<ByteBufferRecord> xClaim(ByteBuffer key, String group, String newOwner, Duration minIdleTime, RecordId... recordIds) Change the ownership of a pending message to the given new consumer.- Parameters:
key- the key the stream is stored at.group- the name of the consumer group.newOwner- the name of the new consumer.minIdleTime- must not be null.recordIds- must not be null.- Returns:
- a
FluxemittingByteBufferRecordthat changed user. - Since:
- 2.3
- See Also:
-
xClaim
default Flux<ByteBufferRecord> xClaim(ByteBuffer key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer.- Parameters:
key- the key the stream is stored at.group- the name of the consumer group.newOwner- the name of the new consumer.options- must not be null.- Returns:
- a
FluxemittingByteBufferRecordthat changed user. - Since:
- 2.3
- See Also:
-
xClaim
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.XClaimCommand,Flux<ByteBufferRecord>>> xClaim(Publisher<ReactiveStreamCommands.XClaimCommand> commands) Change the ownership of a pending message to the given new consumer.- Parameters:
commands- must not be null.- Returns:
- Since:
- 2.3
- See Also:
-
xDel
Removes the specified entries from the stream. Returns the number of items deleted, that may be different from the number of IDs passed in case certain IDs do not exist.- Parameters:
key- the stream key.recordIds- stream record Id's.- Returns:
Monoemitting the number of removed entries.- See Also:
-
xDel
Removes the specified entries from the stream. Returns the number of items deleted, that may be different from the number of IDs passed in case certain IDs do not exist.- Parameters:
key- the stream key.recordIds- stream record Id's.- Returns:
Monoemitting the number of removed entries.- See Also:
-
xDel
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.DeleteCommand,Long>> xDel(Publisher<ReactiveStreamCommands.DeleteCommand> commands) Removes the specified entries from the stream. Returns the number of items deleted, that may be different from the number of IDs passed in case certain IDs do not exist.- Parameters:
commands- must not be null.- Returns:
Monoemitting the number of removed entries.- See Also:
-
xLen
Get the size of the stream stored at key.- Parameters:
key- must not be null.- Returns:
Monoemitting the length of the stream.- See Also:
-
xLen
Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,Long>> xLen(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get the size of the stream stored atReactiveRedisConnection.KeyCommand.getKey()- Parameters:
commands- must not be null.- Returns:
Fluxemitting the length of the stream perReactiveRedisConnection.KeyCommand.- See Also:
-
xPending
Obtain thePendingMessagesSummaryfor a given consumer group.- Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.- Returns:
Monoemitting a summary of pending messages within the given consumer group.- Since:
- 2.3
- See Also:
-
xPendingSummary
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.PendingRecordsCommand,PendingMessagesSummary>> xPendingSummary(Publisher<ReactiveStreamCommands.PendingRecordsCommand> commands) Obtain thePendingMessagesSummaryfor a given consumer group.- Parameters:
commands- must not be null..- Returns:
Fluxemitting a summary of pending messages within the given consumer group one by one.- Since:
- 2.3
- See Also:
-
xPending
Obtained detailed information about all pending messages for a givenConsumer.- Parameters:
key- the key the stream is stored at. Must not be null.consumer- the consumer to fetchPendingMessagesfor. Must not be null.- Returns:
Monoemitting pending messages for the givenConsumer.- Since:
- 2.3
- See Also:
-
xPending
@Nullable default Mono<PendingMessages> xPending(ByteBuffer key, String groupName, String consumerName) Obtained detailed information about all pending messages for a given consumer.- Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.consumerName- the consumer to fetchPendingMessagesfor. Must not be null.- Returns:
Monoemitting pending messages for the givenConsumer.- Since:
- 2.3
- See Also:
-
xPending
default Mono<PendingMessages> xPending(ByteBuffer key, String groupName, Range<?> range, Long count) - Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.range- the range of messages ids to search within. Must not be null.count- limit the number of results. Must not be null.- Returns:
Monoemitting pending messages for the given consumer group. transaction.- Since:
- 2.3
- See Also:
-
xPending
default Mono<PendingMessages> xPending(ByteBuffer key, Consumer consumer, Range<?> range, Long count) Obtain detailed information about pendingmessagesfor a givenRangeandConsumerwithin a consumer group.- Parameters:
key- the key the stream is stored at. Must not be null.consumer- the name of theConsumer. Must not be null.range- the range of messages ids to search within. Must not be null.count- limit the number of results. Must not be null.- Returns:
Monoemitting pending messages for the givenConsumer.- Since:
- 2.3
- See Also:
-
xPending
default Mono<PendingMessages> xPending(ByteBuffer key, String groupName, String consumerName, Range<?> range, Long count) Obtain detailed information about pendingmessagesfor a givenRangeand consumer within a consumer group.- Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.consumerName- the name of the consumer. Must not be null.range- the range of messages ids to search within. Must not be null.count- limit the number of results. Must not be null.- Returns:
Monoemitting pending messages for the given consumer in given consumer group.- Since:
- 2.3
- See Also:
-
xPending
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.PendingRecordsCommand,PendingMessages>> xPending(Publisher<ReactiveStreamCommands.PendingRecordsCommand> commands) - Parameters:
commands- must not be null.- Returns:
Fluxemitting pending messages matching given criteria.- Since:
- 2.3
- See Also:
-
xRange
Read records from a stream within a specificRange.- Parameters:
key- the stream key.range- must not be null.- Returns:
Fluxemitting with members of the stream.- See Also:
-
xRange
- Parameters:
key- the stream key.range- must not be null.limit- must not be null.- Returns:
Fluxemitting with members of the stream.- See Also:
-
xRange
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.RangeCommand,Flux<ByteBufferRecord>>> xRange(Publisher<ReactiveStreamCommands.RangeCommand> commands) - Parameters:
commands- must not be null.- Returns:
Fluxemitting with members of the stream perReactiveStreamCommands.RangeCommand.- See Also:
-
xRead
Read records from one or moreStreamOffsets.- Parameters:
streams- the streams to read from.- Returns:
Fluxemitting with members of the stream.- See Also:
-
xRead
default Flux<ByteBufferRecord> xRead(StreamReadOptions readOptions, StreamOffset<ByteBuffer>... streams) Read records from one or moreStreamOffsets.- Parameters:
readOptions- read arguments.streams- the streams to read from.- Returns:
Fluxemitting with members of the stream.- See Also:
-
read
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.ReadCommand,Flux<ByteBufferRecord>>> read(Publisher<ReactiveStreamCommands.ReadCommand> commands) Read records from one or moreStreamOffsets.- Parameters:
commands- must not be null.- Returns:
Fluxemitting the members of the stream perReactiveStreamCommands.ReadCommand.- See Also:
-
xInfo
Obtain general information about the stream stored at the specified key.- Parameters:
key- the key the stream is stored at.- Returns:
- a
MonoemittingStreamInfo.XInfoStreamwhen ready. - Since:
- 2.3
-
xInfo
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.XInfoCommand,StreamInfo.XInfoStream>> xInfo(Publisher<ReactiveStreamCommands.XInfoCommand> commands) Obtain general information about the stream stored at the specified key.- Parameters:
commands- must not be null.- Returns:
- never null.
- Since:
- 2.3
-
xInfoGroups
Obtain general information about the stream stored at the specified key.- Parameters:
key- the key the stream is stored at.- Returns:
- a
Fluxemitting consumer group info one by one. - Since:
- 2.3
-
xInfoGroups
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.XInfoCommand,Flux<StreamInfo.XInfoGroup>>> xInfoGroups(Publisher<ReactiveStreamCommands.XInfoCommand> commands) Obtain general information about the stream stored at the specified key.- Parameters:
commands- must not be null.- Returns:
- never null.
- Since:
- 2.3
-
xInfoConsumers
Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.- Parameters:
key- the key the stream is stored at.groupName- name of the consumer group.- Returns:
- a
Fluxemitting consumer info one by one. - Since:
- 2.3
-
xInfoConsumers
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.XInfoCommand,Flux<StreamInfo.XInfoConsumer>>> xInfoConsumers(Publisher<ReactiveStreamCommands.XInfoCommand> commands) Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.- Parameters:
commands- must not be null.- Returns:
- never null.
- Since:
- 2.3
-
xGroupCreate
Create a consumer group.- Parameters:
key- key the key the stream is stored at.groupName- name of the consumer group to create.readOffset- the offset to start at.- Returns:
- the
Monoemitting ok if successful.
-
xGroupCreate
default Mono<String> xGroupCreate(ByteBuffer key, String groupName, ReadOffset readOffset, boolean mkStream) Create a consumer group.- Parameters:
key- key the key the stream is stored at.groupName- name of the consumer group to create.readOffset- the offset to start at.mkStream- if true the group will create the stream if needed (MKSTREAM)- Returns:
- the
Monoemitting ok if successful. - Since:
- 2.3
-
xGroupDelConsumer
@Nullable default Mono<String> xGroupDelConsumer(ByteBuffer key, String groupName, String consumerName) Delete a consumer from a consumer group.- Parameters:
key- the key the stream is stored at.groupName- the name of the group to remove the consumer from.consumerName- the name of the consumer to remove from the group.- Returns:
- the
Monoemitting ok if successful.
-
xGroupDelConsumer
Delete a consumer from a consumer group. -
xGroupDestroy
Destroy a consumer group.- Parameters:
key- the key the stream is stored at.groupName- name of the consumer group.- Returns:
- the
Monoemitting ok if successful.
-
xGroup
Execute the givenReactiveStreamCommands.GroupCommandto create, destroy,... groups.- Parameters:
command- theReactiveStreamCommands.GroupCommandto run.- Returns:
- the
Monoemitting the command result.
-
xGroup
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.GroupCommand,String>> xGroup(Publisher<ReactiveStreamCommands.GroupCommand> commands) Execute the givenReactiveStreamCommands.GroupCommandto create, destroy,... groups.- Parameters:
commands-- Returns:
Fluxemitting the results of theReactiveStreamCommands.GroupCommandone by one.
-
xReadGroup
Read records from one or moreStreamOffsets using a consumer group.- Parameters:
consumer- consumer/group.streams- the streams to read from.- Returns:
Fluxemitting the members of the stream- See Also:
-
xReadGroup
default Flux<ByteBufferRecord> xReadGroup(Consumer consumer, StreamReadOptions readOptions, StreamOffset<ByteBuffer>... streams) Read records from one or moreStreamOffsets using a consumer group.- Parameters:
consumer- consumer/group.readOptions- read arguments.streams- the streams to read from.- Returns:
Fluxemitting the members of the stream.- See Also:
-
xRevRange
Read records from a stream within a specificRangein reverse order.- Parameters:
key- the stream key.range- must not be null.- Returns:
Fluxemitting the members of the stream in reverse.- See Also:
-
xRevRange
- Parameters:
key- the stream key.range- must not be null.limit- must not be null.- Returns:
Fluxemitting the members of the stream in reverse.- See Also:
-
xRevRange
Flux<ReactiveRedisConnection.CommandResponse<ReactiveStreamCommands.RangeCommand,Flux<ByteBufferRecord>>> xRevRange(Publisher<ReactiveStreamCommands.RangeCommand> commands) - Parameters:
commands- must not be null.- Returns:
Fluxemitting the members of the stream in reverse.- See Also:
-
xTrim
Trims the stream tocountelements.- Parameters:
key- the stream key.count- length of the stream.- Returns:
Monoemitting the number of removed entries.- See Also:
-
xTrim
Trims the stream tocountelements.- Parameters:
key- the stream key.count- length of the stream.approximateTrimming- the trimming must be performed in a approximated way in order to maximize performances.- Returns:
Monoemitting the number of removed entries.- Since:
- 2.4
- See Also:
-
xTrim
Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,Long>> xTrim(Publisher<ReactiveStreamCommands.TrimCommand> commands) Trims the stream tocountelements.- Parameters:
commands- must not be null.- Returns:
Fluxemitting the number of removed entries perReactiveStreamCommands.TrimCommand.- See Also:
-