Package io.hstream
Interface ConsumerBuilder
-
public interface ConsumerBuilder
A builder forConsumer
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConsumerBuilder
ackAgeLimit(long ackAgeLimit)
Optional, default: 100(ms), the value should be less than Subscription.ackTimeoutSeconds.ConsumerBuilder
ackBufferSize(int ackBufferSize)
WhenResponder
.ack() is called, the consumer will not send it to servers immediately, the ack request will be buffered until the ack count reaches ackBufferSize or the consumer is stopping.ConsumerBuilder
batchReceiver(BatchReceiver batchReceiver)
Consumer
build()
ConsumerBuilder
hRecordReceiver(HRecordReceiver hRecordReceiver)
Same as rawRecordReceiver except receiving HRecord instead of raw record.ConsumerBuilder
name(String name)
Optional, if not provided, the ConsumerBuilder will generate a unique name.ConsumerBuilder
rawRecordReceiver(RawRecordReceiver rawRecordReceiver)
Optional, when the consumer receives raw records, rawRecordReceiver is executed sequentially for each record, if rawRecordReceiver throws an exception, the consumer will ignore it and consume the next record.ConsumerBuilder
subscription(String subscription)
Positional
-
-
-
Method Detail
-
name
ConsumerBuilder name(String name)
Optional, if not provided, the ConsumerBuilder will generate a unique name.- Parameters:
name
- consumer name- Returns:
- the ConsumerBuilder instance
-
subscription
ConsumerBuilder subscription(String subscription)
Positional- Parameters:
subscription
- subscription name- Returns:
- the ConsumerBuilder instance
-
rawRecordReceiver
ConsumerBuilder rawRecordReceiver(RawRecordReceiver rawRecordReceiver)
Optional, when the consumer receives raw records, rawRecordReceiver is executed sequentially for each record, if rawRecordReceiver throws an exception, the consumer will ignore it and consume the next record.- Parameters:
rawRecordReceiver
- raw record receiver- Returns:
- the ConsumerBuilder instance
-
hRecordReceiver
ConsumerBuilder hRecordReceiver(HRecordReceiver hRecordReceiver)
Same as rawRecordReceiver except receiving HRecord instead of raw record.- Parameters:
hRecordReceiver
- HRecord receiver- Returns:
- the ConsumerBuilder instance
-
batchReceiver
ConsumerBuilder batchReceiver(BatchReceiver batchReceiver)
-
ackBufferSize
ConsumerBuilder ackBufferSize(int ackBufferSize)
WhenResponder
.ack() is called, the consumer will not send it to servers immediately, the ack request will be buffered until the ack count reaches ackBufferSize or the consumer is stopping.- Parameters:
ackBufferSize
- ack buffer size- Returns:
- the ConsumerBuilder instance
-
ackAgeLimit
ConsumerBuilder ackAgeLimit(long ackAgeLimit)
Optional, default: 100(ms), the value should be less than Subscription.ackTimeoutSeconds.- Parameters:
ackAgeLimit
- the ack age limit(Milliseconds)- Returns:
- the ConsumerBuilder instance
-
build
Consumer build()
-
-