Sha256: 90b08f7acee1208e3a145f1200be1c217ed0c581cff053abbf6a15983014600c
Contents?: true
Size: 821 Bytes
Versions: 1
Compression:
Stored size: 821 Bytes
Contents
module Rdkafka class Message attr_reader :topic, :partition, :payload, :key, :offset, :timestamp def initialize(native_message) unless native_message[:rkt].null? @topic = FFI.rd_kafka_topic_name(native_message[:rkt]) end @partition = native_message[:partition] unless native_message[:payload].null? @payload = native_message[:payload].read_string(native_message[:len]) end unless native_message[:key].null? @key = native_message[:key].read_string(native_message[:key_len]) end @offset = native_message[:offset] @timestamp = FFI.rd_kafka_message_timestamp(native_message, nil) end def to_s "Message in '#{topic}' with key '#{key}', payload '#{payload}', partition '#{partition}', offset '#{offset}'" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rdkafka-0.1.11 | lib/rdkafka/message.rb |