Module: Karafka::Messages::Builders::Messages
- Defined in:
- lib/karafka/messages/builders/messages.rb
Overview
Builder for creating message batch instances.
Class Method Summary collapse
-
.call(messages, topic, partition, received_at) ⇒ Karafka::Messages::Messages
Creates messages batch with messages inside based on the incoming messages and the topic from which it comes.
Class Method Details
.call(messages, topic, partition, received_at) ⇒ Karafka::Messages::Messages
Creates messages batch with messages inside based on the incoming messages and the topic from which it comes.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/karafka/messages/builders/messages.rb', line 17 def call(, topic, partition, received_at) # We cannot freeze the batch metadata because it is altered with the processed_at time # prior to the consumption. It is being frozen there = BatchMetadata.call( , topic, partition, received_at ) Karafka::Messages::Messages.new( , ).freeze end |