How can I implement request/reply pattern with Apache Kafka? Implementation should also work with scaling of service instances (f.e. pods in the kubernetes).
In the rabbit, I can create the temporary non-durable unique queue per instance that receives responses from other services. This queue will be removed automatically when connection is lost (when instance of the service is down).
How can I do this with Kafka? How to scale this solution?
I use node js
Given that your Rabbit example is only talking about the channel for receiving the response (ignoring sending the request), it's most practical (since Kafka doesn't handle dynamic topic creation/deletion particularly well) to have a single topic for responses to that service with however many partitions you need to meet your throughput goal. A requestor instance will choose a partition to consume at random (multiple instances could consume the same partition) and communicate that partition and a unique correlation ID with the request. The response is then produced to the selected partition and keyed with the correlation ID. Requestors track the set of correlation IDs they're waiting for and ignore responses with keys not in that set.
The risk of collisions in correlation IDs can be mitigated by having the requestors coordinate among themselves (possibly using something like etcd/zookeeper/consul).
This isn't a messaging pattern for which Kafka is that well-suited (it's definitely not best of breed for this), but it's workable.