Aru
Aru

Reputation: 184

Can i consume based on specific condition in 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..

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?

Upvotes: 3

Views: 4633

Answers (1)

Matthias J. Sax
Matthias J. Sax

Reputation: 62310

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.

Upvotes: 3

Related Questions