Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Kafka client with selector?

Tags:

apache-kafka

I am investigating Apache Kafka, and my use-case requires that the client be able to filter messages, and that the filtering happens on the broker, rather than the client. This requirement is identical to using a JMS Selector.

It is my understanding, though I maybe incorrect, that Kafka does not have a selector, and that filtering is done on the client. So all messages are sent to client, and client is responsible for filter.

Is there anyway to achieve a JMS Selector approach, where filtering happens on the broker?

like image 545
Magick Avatar asked Oct 18 '22 04:10

Magick


1 Answers

No, you can't do anything like that. The best you can do is filter on the client side. Apache Kafka API supports only fetching of kind "give me at most 1 megabyte of messages for topic N partition M starting from offset X".

You can refer to Wire Protocol reference to see possible options for a fetch request, but it does not contain anything you are looking for.

Actually, Kafka is that fast because every fetch is just a sequential read, so I don't think this will be implemented in future releases (but I'll be glad if I'm wrong :)).

like image 195
serejja Avatar answered Oct 29 '22 00:10

serejja