接口 ReaderInterceptor<T>
- 类型参数:
T
-
Reader interceptor.
-
方法概要
修饰符和类型方法说明beforeRead
(Reader<T> reader, Message<T> message) This is called just before the message is returned byReader.readNext()
,ReaderListener.received(Reader, Message)
or theCompletableFuture
returned byReader.readNextAsync()
completes.void
close()
Close the interceptor.default void
onPartitionsChange
(String topicName, int partitions) This method is called when partitions of the topic (partitioned-topic) changes.
-
方法详细资料
-
close
void close()Close the interceptor. -
beforeRead
This is called just before the message is returned byReader.readNext()
,ReaderListener.received(Reader, Message)
or theCompletableFuture
returned byReader.readNextAsync()
completes. This method is based onConsumerInterceptor.beforeConsume(Consumer, Message)
, so it has the same features.- 参数:
reader
- the reader which contains the interceptormessage
- the message to be read by the client.- 返回:
- message that is either modified by the interceptor or same message passed into the method.
-
onPartitionsChange
This method is called when partitions of the topic (partitioned-topic) changes.- 参数:
topicName
- topic namepartitions
- new updated number of partitions
-