Can i consume based on specific condition in Kafka?

十年热恋 提交于 2019-12-08 01:04:40

问题


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..

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?


回答1:


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.



来源:https://stackoverflow.com/questions/39634354/can-i-consume-based-on-specific-condition-in-kafka

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!