lib/deimos/batch_consumer.rb in deimos-ruby-1.3.0.pre.beta1 vs lib/deimos/batch_consumer.rb in deimos-ruby-1.3.0.pre.beta2
- old
+ new
@@ -21,11 +21,13 @@
end
# :nodoc:
def before_consume_batch(batch, metadata)
_with_error_span(batch, metadata) do
- metadata[:keys] = batch.map do |message|
- decode_key(message.key)
+ if self.class.config[:key_configured]
+ metadata[:keys] = batch.map do |message|
+ decode_key(message.key)
+ end
end
batch.map do |message|
self.class.decoder.decode(message.payload) if message.payload.present?
end