Class: Karafka::Pro::ScheduledMessages::Deserializers::Payload

Inherits:
Object
  • Object
show all
Defined in:
lib/karafka/pro/scheduled_messages/deserializers/payload.rb

Overview

States payload deserializer We only deserialize states data and never anything else. Other payloads are the payloads we are expected to proxy, thus there is no need to deserialize them in any context. Their appropriate target topics should have expected deserializers

Instance Method Summary collapse

Instance Method Details

#call(message) ⇒ Hash

Returns deserialized data.

Parameters:

Returns:

  • (Hash)

    deserialized data



25
26
27
28
29
30
# File 'lib/karafka/pro/scheduled_messages/deserializers/payload.rb', line 25

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