Class: Kafka::Producer

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/kafka_producer_ext.rb

Instance Method Summary collapse

Instance Method Details

#produce2(value, key: nil, topic:, partition: nil, partition_key: nil) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fluent/plugin/kafka_producer_ext.rb', line 13

def produce2(value, key: nil, topic:, partition: nil, partition_key: nil)
  create_time = Time.now

  message = PendingMessage.new(
    value,
    key,
    topic,
    partition,
    partition_key,
    create_time
  )

  @target_topics.add(topic)
  @pending_message_queue.write(message)

  nil
end