Class: Karafka::Messages::Metadata
- Inherits:
 - 
      Struct
      
        
- Object
 - Struct
 - Karafka::Messages::Metadata
 
 
- Defined in:
 - lib/karafka/messages/metadata.rb
 
Overview
Single message metadata details that can be accessed without the need of deserialization.
Instance Attribute Summary collapse
- 
  
    
      #deserializers  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute deserializers.
 - 
  
    
      #message  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute message.
 - 
  
    
      #offset  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute offset.
 - 
  
    
      #partition  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute partition.
 - 
  
    
      #raw_headers  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute raw_headers.
 - 
  
    
      #raw_key  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute raw_key.
 - 
  
    
      #received_at  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute received_at.
 - 
  
    
      #timestamp  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute timestamp.
 - 
  
    
      #topic  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute topic.
 
Instance Method Summary collapse
- 
  
    
      #headers  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Deserialized headers.
 - 
  
    
      #key  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Deserialized key.
 
Instance Attribute Details
#deserializers ⇒ Object
Returns the value of attribute deserializers
      6 7 8  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 6 def deserializers @deserializers end  | 
  
#message ⇒ Object
Returns the value of attribute message
      6 7 8  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 6 def @message end  | 
  
#offset ⇒ Object
Returns the value of attribute offset
      6 7 8  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 6 def offset @offset end  | 
  
#partition ⇒ Object
Returns the value of attribute partition
      6 7 8  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 6 def partition @partition end  | 
  
#raw_headers ⇒ Object
Returns the value of attribute raw_headers
      6 7 8  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 6 def raw_headers @raw_headers end  | 
  
#raw_key ⇒ Object
Returns the value of attribute raw_key
      6 7 8  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 6 def raw_key @raw_key end  | 
  
#received_at ⇒ Object
Returns the value of attribute received_at
      6 7 8  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 6 def received_at @received_at end  | 
  
#timestamp ⇒ Object
Returns the value of attribute timestamp
      6 7 8  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 6 def @timestamp end  | 
  
#topic ⇒ Object
Returns the value of attribute topic
      6 7 8  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 6 def topic @topic end  | 
  
Instance Method Details
#headers ⇒ Object
Returns deserialized headers. By default its a hash with keys and payload being strings.
      27 28 29 30 31  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 27 def headers return @headers if @headers @headers = deserializers.headers.call(self) end  | 
  
#key ⇒ Object
Returns deserialized key. By default in the raw string format.
      19 20 21 22 23  | 
    
      # File 'lib/karafka/messages/metadata.rb', line 19 def key return @key if @key @key = deserializers.key.call(self) end  |