Interface BoundStreamOperations<K,HK,HV>
@NullUnmarked
public interface BoundStreamOperations<K,HK,HV>
Redis stream specific operations bound to a certain key.
- Since:
- 2.2
- Author:
- Mark Paluch, Christoph Strobl, Dengliming
-
Method Summary
Modifier and TypeMethodDescriptionacknowledge(@NonNull String group, @NonNull String @NonNull ... recordIds) Acknowledge one or more records as processed.Append a record to the streamkey.add(@NonNull Map<@NonNull HK, HV> content, @NonNull RedisStreamCommands.XAddOptions xAddOptions) Append a record to the streamkeywith the specified options.createGroup(@NonNull ReadOffset readOffset, @NonNull String group) Create a consumer group.Removes the specified entries from the stream.deleteConsumer(@NonNull Consumer consumer) Delete a consumer from a consumer group.destroyGroup(@NonNull String group) Destroy a consumer group.Read records from a stream within a specificRange.read(@NonNull Consumer consumer, @NonNull ReadOffset readOffset) Read records starting fromReadOffset. using a consumer group.read(@NonNull Consumer consumer, @NonNull StreamReadOptions readOptions, @NonNull ReadOffset readOffset) Read records starting fromReadOffset. using a consumer group.read(@NonNull ReadOffset readOffset) Read records fromReadOffset.read(@NonNull StreamReadOptions readOptions, @NonNull ReadOffset readOffset) Read records starting fromReadOffset.reverseRange(@NonNull Range<String> range) Read records from a stream within a specificRangein reverse order.reverseRange(@NonNull Range<String> range, @NonNull Limit limit) size()Get the length of a stream.trim(long count) Trims the stream tocountelements.trim(long count, boolean approximateTrimming) Trims the stream tocountelements.
-
Method Details
-
acknowledge
Acknowledge one or more records as processed.- Parameters:
group- name of the consumer group.recordIds- record Id's to acknowledge.- Returns:
- length of acknowledged records. null when used in pipeline / transaction.
- See Also:
-
add
-
add
RecordId add(@NonNull Map<@NonNull HK, HV> content, @NonNull RedisStreamCommands.XAddOptions xAddOptions) Append a record to the streamkeywith the specified options.- Parameters:
content- record content as Map.xAddOptions- additional parameters for the XADD call.- Returns:
- the record Id. null when used in pipeline / transaction.
- Since:
- 3.4
- See Also:
-
delete
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:
recordIds- stream record Id's.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- See Also:
-
createGroup
Create a consumer group.- Parameters:
readOffset-group- name of the consumer group.- Returns:
- true if successful. null when used in pipeline / transaction.
-
deleteConsumer
-
destroyGroup
-
size
Long size()Get the length of a stream.- Returns:
- length of the stream. null when used in pipeline / transaction.
- See Also:
-
range
-
range
- Parameters:
range- must not be null.limit- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
read
Read records fromReadOffset.- Parameters:
readOffset- the offset to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
read
List<@NonNull MapRecord<K,HK, readHV>> (@NonNull StreamReadOptions readOptions, @NonNull ReadOffset readOffset) Read records starting fromReadOffset.- Parameters:
readOptions- read arguments.readOffset- the offset to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
read
default List<@NonNull MapRecord<K,HK, readHV>> (@NonNull Consumer consumer, @NonNull ReadOffset readOffset) Read records starting fromReadOffset. using a consumer group.- Parameters:
consumer- consumer/group.readOffset- the offset to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
read
List<@NonNull MapRecord<K,HK, readHV>> (@NonNull Consumer consumer, @NonNull StreamReadOptions readOptions, @NonNull ReadOffset readOffset) Read records starting fromReadOffset. using a consumer group.- Parameters:
consumer- consumer/group.readOptions- read arguments.readOffset- the offset to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
reverseRange
-
reverseRange
- Parameters:
range- must not be null.limit- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
trim
Trims the stream tocountelements.- Parameters:
count- length of the stream.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- See Also:
-
trim
Trims the stream tocountelements.- Parameters:
count- length of the stream.approximateTrimming- the trimming must be performed in a approximated way in order to maximize performances.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- Since:
- 2.4
- See Also:
-