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.

You can also try Rayvens which integrates with Kafka.