K
- Stream key and Stream field type.public static class StreamReceiver.StreamReceiverOptionsBuilder<K,V extends Record<K,?>> extends Object
StreamReceiver.StreamReceiverOptions
.public StreamReceiver.StreamReceiverOptionsBuilder<K,V> pollTimeout(Duration pollTimeout)
BLOCK
option during reading.pollTimeout
- must not be null or negative.this
StreamReceiver.StreamReceiverOptionsBuilder
.public StreamReceiver.StreamReceiverOptionsBuilder<K,V> batchSize(int recordsPerPoll)
COUNT
option during reading.recordsPerPoll
- must be greater zero.this
StreamReceiver.StreamReceiverOptionsBuilder
.public StreamReceiver.StreamReceiverOptionsBuilder<K,V> onErrorResume(Function<? super Throwable,? extends org.reactivestreams.Publisher<Void>> resumeFunction)
Function
to resume the main sequence when polling the stream fails. The function can
either resume by suppressing the error or fail the main sequence by emitting the error to stop receiving. Receive
errors (Redis errors, Serialization failures) stop receiving by default.resumeFunction
- must not be null.this
StreamReceiver.StreamReceiverOptionsBuilder
.Flux.onErrorResume(Function)
public <T> StreamReceiver.StreamReceiverOptionsBuilder<T,MapRecord<T,T,T>> serializer(RedisSerializationContext.SerializationPair<T> pair)
pair
- must not be null.this
StreamReceiver.StreamReceiverOptionsBuilder
.public <T> StreamReceiver.StreamReceiverOptionsBuilder<T,MapRecord<T,T,T>> serializer(RedisSerializationContext<T,?> serializationContext)
serializationContext
- must not be null.this
StreamReceiver.StreamReceiverOptionsBuilder
.public <NK,NV extends Record<NK,?>> StreamReceiver.StreamReceiverOptionsBuilder<NK,NV> keySerializer(RedisSerializationContext.SerializationPair<NK> pair)
pair
- must not be null.this
StreamReceiver.StreamReceiverOptionsBuilder
.public <HK,HV> StreamReceiver.StreamReceiverOptionsBuilder<K,MapRecord<K,HK,HV>> hashKeySerializer(RedisSerializationContext.SerializationPair<HK> pair)
pair
- must not be null.this
StreamReceiver.StreamReceiverOptionsBuilder
.public <HK,HV> StreamReceiver.StreamReceiverOptionsBuilder<K,MapRecord<K,HK,HV>> hashValueSerializer(RedisSerializationContext.SerializationPair<HV> pair)
pair
- must not be null.this
StreamReceiver.StreamReceiverOptionsBuilder
.public <NV> StreamReceiver.StreamReceiverOptionsBuilder<K,ObjectRecord<K,NV>> targetType(Class<NV> targetType)
Record
type to ObjectRecord
.targetType
- must not be null.this
StreamReceiver.StreamReceiverOptionsBuilder
.public <NV> StreamReceiver.StreamReceiverOptionsBuilder<K,ObjectRecord<K,NV>> objectMapper(HashMapper<NV,?,?> hashMapper)
Record
type to ObjectRecord
.hashMapper
- must not be null.this
StreamReceiver.StreamReceiverOptionsBuilder
.public StreamReceiver.StreamReceiverOptions<K,V> build()
StreamReceiver.StreamReceiverOptions
.StreamReceiver.StreamReceiverOptions
.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.