Module: Karafka::Pro::Cleaner::Messages::Metadata
- Defined in:
- lib/karafka/pro/cleaner/messages/metadata.rb
Overview
Extensions to the message metadata that allow for granular memory control on a per message basis
Instance Method Summary collapse
-
#clean! ⇒ Object
Cleans the headers and key.
-
#cleaned? ⇒ Boolean
True if the message metadata has been cleaned.
-
#headers ⇒ Object
Deserialized headers.
-
#key ⇒ Object
Deserialized key.
Instance Method Details
#clean! ⇒ Object
Cleans the headers and key
31 32 33 34 35 36 |
# File 'lib/karafka/pro/cleaner/messages/metadata.rb', line 31 def clean! self.raw_headers = false self.raw_key = false @key = nil @headers = nil end |
#cleaned? ⇒ Boolean
Returns true if the message metadata has been cleaned.
26 27 28 |
# File 'lib/karafka/pro/cleaner/messages/metadata.rb', line 26 def cleaned? raw_headers == false end |
#headers ⇒ Object
Returns deserialized headers. By default its a hash with keys and payload being strings.
21 22 23 |
# File 'lib/karafka/pro/cleaner/messages/metadata.rb', line 21 def headers cleaned? ? raise(Errors::MessageCleanedError) : super end |
#key ⇒ Object
Returns deserialized key. By default in the raw string format.
15 16 17 |
# File 'lib/karafka/pro/cleaner/messages/metadata.rb', line 15 def key cleaned? ? raise(Errors::MessageCleanedError) : super end |