Apache kafka 有没有办法我只能从旧的偏移量中查找1条消息?

Apache kafka 有没有办法我只能从旧的偏移量中查找1条消息?,apache-kafka,spring-kafka,Apache Kafka,Spring Kafka,我想知道是否有任何方法我只能从旧的偏移量中查找1条消息?因为我只想重新处理一条消息。您应该实现ConsumerSekAware及其: /** * When using group management, called when partition assignments change. * @param assignments the new assignments and their current offsets. * @param callback the callback to p

我想知道是否有任何方法我只能从旧的偏移量中查找1条消息?因为我只想重新处理一条消息。

您应该实现
ConsumerSekAware
及其:

/**
 * When using group management, called when partition assignments change.
 * @param assignments the new assignments and their current offsets.
 * @param callback the callback to perform an initial seek after assignment.
 */
void onPartitionsAssigned(Map<TopicPartition, Long> assignments, ConsumerSeekCallback callback);
/**
*使用组管理时,分区分配更改时调用。
*@param assignments新的赋值及其当前偏移量。
*@param callback在赋值后执行初始寻道的回调。
*/
void onPartitionsAssigned(映射分配、ConsumerSekCallback回调);

在所需的
分区上执行所需的
-1
,其
偏移量作为
分配图中的值。

hmm,Artem,我的意思是,例如在分区9中,最后提交的偏移量是200。我只想寻找偏移量100,然后只重新处理这个事件。我不想再处理101-200,好的。这是不可能的。你只能过滤那些记录A,我想我需要过滤那些:(