confluent-kafka-python icon indicating copy to clipboard operation
confluent-kafka-python copied to clipboard

Kafka client interceptors

Open cpuchakayala opened this issue 9 years ago • 7 comments

Is their plan to implement Kafka client interceptors like the java client has for python and go?

cpuchakayala avatar Apr 21 '17 19:04 cpuchakayala

There is ongoing work to add interceptor support to librdkafka (the underlying Kafka client implementation used by the Python, Go and .NET clients). The interceptors themselves will need to be implemented as standalone shared libraries written in C that are dynamically loaded based on configuration path.

Can you describe your use-case for interceptors?

edenhill avatar Apr 22 '17 08:04 edenhill

My use case is we sometimes get a large message, which is greater the max message size we configure in Kafka (producer, broker, consumer), and we don't want increase the max message size all over the place, and some of our large messages are in the range of 50MB-100MB, it would be impractical to increase the max message size to such a huge size in Kafka. So we would like to use interceptors to upload to s3 at the producer level and download from s3 at the consumer level. I am open to any suggestions to solve this problem, does by any librdkafka splits the large message like linked in does?

When do you think it will be released in librdkafka? do u know when confluent clients will get it?

cpuchakayala avatar Apr 22 '17 09:04 cpuchakayala

@cpuchakayaka For this use case you don't really need interceptors. In fact, in Python interceptors generally aren't as useful for the same reason the base producer/consumer don't need pluggable serializers/deserializers -- you can just subclass them and override the behavior of the send()/poll() methods to make the modifications to the data.

I don't think interceptors would solve this particular problem anyway since they operate 1:1 -- one message in, one message out.

ewencp avatar Apr 23 '17 22:04 ewencp

The interceptors that will be added to librdkafka will not support modifying the message itself, thus a read-only interceptor, so they won't really be useful for your use-case anyway.

edenhill avatar Apr 28 '17 08:04 edenhill

Thanks for the info.

cpuchakayala avatar May 15 '17 22:05 cpuchakayala

I see that interceptor plugin support has been added to librdkafka. Any idea when that will be brought forward to the kafka client? We're looking to implement confluent metrics and monitoring.

danfranks avatar Jun 06 '17 16:06 danfranks

Our aim is to release Confluent monitoring-interceptors for librdkafka-based clients soon.

edenhill avatar Jun 15 '17 21:06 edenhill