README.md in logstash-codec-protobuf-1.1.0 vs README.md in logstash-codec-protobuf-1.2.0
- old
+ new
@@ -25,10 +25,13 @@
kafka
{
zk_connect => "127.0.0.1"
topic_id => "unicorns_protobuffed"
+ key_deserializer_class => "org.apache.kafka.common.serialization.ByteArrayDeserializer"
+ value_deserializer_class => "org.apache.kafka.common.serialization.ByteArrayDeserializer"
+
codec => protobuf
{
class_name => "Animals::Unicorn"
include_path => ['/path/to/pb_definitions/Animal.pb.rb', '/path/to/pb_definitions/Unicorn.pb.rb']
}
@@ -38,16 +41,26 @@
kafka
{
zk_connect => "127.0.0.1"
topic_id => "unicorns_protobuffed"
+ key_deserializer_class => "org.apache.kafka.common.serialization.ByteArrayDeserializer"
+ value_deserializer_class => "org.apache.kafka.common.serialization.ByteArrayDeserializer"
codec => protobuf
{
- class_name => "Animals.Unicorn"
+ class_name => "Animals.Unicorn"
include_path => ['/path/to/pb_definitions/Animal_pb.rb', '/path/to/pb_definitions/Unicorn_pb.rb']
protobuf_version => 3
}
- }
+ }
+
+For version 3 class names check the bottom of the generated protobuf ruby file. It contains lines like this:
+
+ Animals.Unicorn = Google::Protobuf::DescriptorPool.generated_pool.lookup("Animals.Unicorn").msgclass
+
+Use the parameter for the lookup call as the class_name for the codec config.
+
+If you're using a kafka input please also set the deserializer classes as shown above.
### Class loading order
Imagine you have the following protobuf version 2 relationship: class Unicorn lives in namespace Animal::Horse and uses another class Wings.