Class: MarchHare::BasicPropertiesBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/march_hare/metadata.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) build_properties_from(props = {})



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/march_hare/metadata.rb', line 73

def self.build_properties_from(props = {})
  builder = AMQP::BasicProperties::Builder.new

  builder.content_type(props[:content_type]).
    content_encoding(props[:content_encoding]).
    headers(props[:headers]).
    delivery_mode(props[:persistent] ? 2 : 1).
    priority(props[:priority]).
    correlation_id(props[:correlation_id]).
    reply_to(props[:reply_to]).
    expiration(if props[:expiration] then props[:expiration].to_s end).
    message_id(props[:message_id]).
    timestamp(props[:timestamp]).
    type(props[:type]).
    user_id(props[:user_id]).
    app_id(props[:app_id]).
    cluster_id(props[:cluster_id]).
    build
end