sclasen / akka-kafka

185 stars 62 forks source link

Any reason for losing the key #32

Closed radekg closed 9 years ago

radekg commented 9 years ago

Akka kafka seems to be passing the message only : https://github.com/sclasen/akka-kafka/blob/master/src/main/scala/com/sclasen/akka/kafka/Actors.scala#L203. Is there a method to receive the key with a message?

sclasen commented 9 years ago

If you specify a msgHandler you can sent on the full msgandmetadata or do an arbitrary transform.

The default handler does as you observed and just sends on the msg.

https://github.com/sclasen/akka-kafka/blob/master/src/main/scala/com/sclasen/akka/kafka/AkkaConsumer.scala#L149

https://github.com/sclasen/akka-kafka/blob/master/src/main/scala/com/sclasen/akka/kafka/Actors.scala#L200

On Wednesday, March 25, 2015, Rad Gruchalski notifications@github.com wrote:

Akka kafka seems to be passing the message only : https://github.com/sclasen/akka-kafka/blob/master/src/main/scala/com/sclasen/akka/kafka/Actors.scala#L203 . Is there a method to receive the key with a message?

— Reply to this email directly or view it on GitHub https://github.com/sclasen/akka-kafka/issues/32.

radekg commented 9 years ago

Great stuff. Thank you.