How can I integrate Apache Kafka with Ray Serve?

Hello guys,
I’m still beginner with Ray Serve and I want to ask you if it is possible to use Apache Kafka with Ray Serve.

I found this blog but I find it a little bit hard to understand the steps Anyscale - Serverless Kafka Stream Processing with Ray.

Thank you so much.

I believe that this is possible. That blog walks through how to build a Ray application that uses Kafka, but you should be able to do something similar with Serve. Instead of using Ray tasks and actors (which are decorated with @ray.remote), you can use Serve deployments (which are decorated with @serve.deployment).

In general, Ray Serve accepts any arbitrary Python code, so if you can access Kafka with Python, Ray Serve should be able to support it.

You might be able to follow that blog post using the @serve.deployment decorator instead of @ray.remote. However, I would recommend first going through the Ray Serve end-to-end tutorial to get more context on Serve.

1 Like

You can also try Rayvens which integrates with Kafka.

Hi, I am trying to integrate my kafka consumer with Ray.

Anyscale - Serverless Kafka Stream Processing with Ray I also read this document this is bit difficult to understand. Do we any other resource which is easy to understand.

In case you are still interested in this topic, I have written an article about Ray Serve and Kafka integration: Integrate Distributed Ray Serve Deployment with Kafka