acrosa / kafka-rb

A simple Producer/Consumer client for Kafka (a distributed publish/subscribe messaging service)
Apache License 2.0
171 stars 43 forks source link

Producer just send the payload to kafka #22

Closed cleesmith closed 11 years ago

cleesmith commented 11 years ago

Is it possible to just send the payload string to kafka broker instead of the whole Kafka::Message object ? I've tried both 0.0.12 and 0.0.15 of kafka-rb.

My consumer shows this:

#<Kafka::Message:0x00000002392fb8 @magic=0, @payload="this is a log message", @checksum=348211236, @compression=0>
#<Kafka::Message:0x00000002392dd8 @magic=0, @payload="this is another log", @checksum=2885865363, @compression=0>
#<Kafka::Message:0x000000023929f0 @magic=0, @payload="and another", @checksum=3444544879, @compression=0>

... but I just want this, well, eventually a compressed version of this:

this is a log message
this is another log
and another

If I use the librdkafka_example (C program) the producer does send just the payload to kafka, but I would prefer to use ruby so I can select random partitions to send to.

Ideas ?

Thanks, Chris

cleesmith commented 11 years ago

Please ignore ... solved.