我可以根据卡夫卡的特定条件消费吗? [英] Can i consume based on specific condition in Kafka?

查看:64
本文介绍了我可以根据卡夫卡的特定条件消费吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在向Kafka写一个味精,并在另一端使用它. 在其中做一些处理,并将其写回到另一个Kafka主题.

I'm writing a msg in to Kafka and consuming it in the other end. Doing some process in it and writing it back to another Kafka topic.

我想知道哪个消息响应针对哪个请求.

I want to know which message response is for which request..

当前决定从用户端捕获偏移量id,然后写入响应并读取响应有效负载并决定.

currently decided to capture the offset id from consumer side then write in the response and read the response payload and decide the same.

对于这种方法,我们需要阅读每条消息,是否还有其他方法可以根据使用者的配置条件进行消费?

For this approach we need to read each message is there any other way we can consume based on consumer config condition?

推荐答案

消费者只能阅读整个主题.您只能通过seek()跳过消息,但是没有可以评估的条件来筛选代理.

Consumers can only read the whole topic. You can only skip messages via seek() but there is no conditions that you can evaluate on the broker to filter messages.

您将需要在客户端中使用整个进程/过滤器来消耗整个主题.

You will need to consume the whole topic an process/filter in the client.

这篇关于我可以根据卡夫卡的特定条件消费吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆