acrosa/kafka-rb — pull request #12 by liamstewart (2012-09-11 19:01:01+00:00)
Title: Multiproduce support

@acrosa

This pull request adds support for the multiproduce request type through a new producer class called MultiProduce. MultiProduce has two methods:
- send: sends a set of messages on a single topic/partition using the produce request type
- multi_send: sends messages from multiple topics/partitions using the multiproduce request type

multi_send takes ProducerRequest objects (have a topic, a partition, and a set of messages) rather than Message objects.

Other changes:
- made the default host/port constants in the IO module
- moved encoding functions to a new Encoder module
- changed message encoding function to include the length of the message in the return value

There are some changes to the Producer class - removed the encode* methods and the request type constant in order to share encoder code. These seem more like implementation details that shouldn't necessarily be called directly by a client. I can back the changes out though.

Tests included and I've run a producer against a kafka instance and verified that messages are processed correctly.