Sha256: 5890d093ca65ef368956db096edc17e99636d47a0d89e0f8bef5d9259776a5b1

Contents?: true

Size: 554 Bytes

Versions: 9

Compression:

Stored size: 554 Bytes

Contents

class Freddy
  module Producers
    class ReplyProducer
      CONTENT_TYPE = 'application/json'.freeze

      def initialize(channel, logger)
        @logger = logger
        @exchange = channel.default_exchange
      end

      def produce(destination, payload, properties)
        @logger.debug "Sending message #{payload.inspect} to #{destination}"

        properties = properties.merge(
          routing_key: destination, content_type: CONTENT_TYPE
        )

        @exchange.publish Payload.dump(payload), properties
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
freddy-jruby-0.5.6 lib/freddy/producers/reply_producer.rb
freddy-0.5.6 lib/freddy/producers/reply_producer.rb
freddy-0.5.5 lib/freddy/producers/reply_producer.rb
freddy-0.5.3 lib/freddy/producers/reply_producer.rb
freddy-0.5.2 lib/freddy/producers/reply_producer.rb
freddy-jruby-0.5.1 lib/freddy/producers/reply_producer.rb
freddy-0.5.1 lib/freddy/producers/reply_producer.rb
freddy-jruby-0.5.0 lib/freddy/producers/reply_producer.rb
freddy-0.5.0 lib/freddy/producers/reply_producer.rb