Class: Karafka::Pro::RecurringTasks::Deserializer

Inherits:
Object
  • Object
show all
Defined in:
lib/karafka/pro/recurring_tasks/deserializer.rb

Overview

Note:

We use symbolize_names because we want to use the same convention of hash building for producing, consuming and displaying related data as in other places.

Recurring Tasks data deserializer. We compress data ourselves because we cannot rely on any external optional features like certain compression types, etc. By doing this that way we can ensure we have full control over the compression.

Instance Method Summary collapse

Instance Method Details

#call(message) ⇒ Hash

Returns deserialized data.

Parameters:

Returns:

  • (Hash)

    deserialized data



26
27
28
29
30
31
# File 'lib/karafka/pro/recurring_tasks/deserializer.rb', line 26

def call(message)
  ::JSON.parse(
    Zlib::Inflate.inflate(message.raw_payload),
    symbolize_names: true
  )
end