Sha256: f800817a5f0b134b77a3f6d7987bc7bedafa84519e98fccd6e2a55fc759b8c5a

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

require 'modern_times/jms/connection'
require 'modern_times/jms/publisher'
require 'modern_times/jms/supervisor_mbean'
require 'modern_times/jms/supervisor'
require 'modern_times/jms/worker'

module ModernTimes
  module JMS
    def self.same_destination?(options1, options2)
      if options1[:queue_name]
        return options1[:queue_name]  == options2[:queue_name]
      elsif options1[:topic_name]
        return options1[:topic_name]  == options2[:topic_name]
      elsif options1[:virtual_topic_name]
        return options1[:virtual_topic_name]  == options2[:virtual_topic_name]
      elsif options1[:destination]
        return options1[:destination] == options2[:destination]
      else
        return false
      end
    end

    def self.create_message(session, marshaler, object)
      case marshaler.marshal_type
        when :text
          session.create_text_message(marshaler.marshal(object))
        when :bytes
          msg = session.create_bytes_message()
          msg.data = marshaler.marshal(object)
          msg
        else raise "Invalid marshal type: #{marshaler.marshal_type}"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
modern_times-0.2.6 lib/modern_times/jms.rb
modern_times-0.2.5 lib/modern_times/jms.rb
modern_times-0.2.4 lib/modern_times/jms.rb
modern_times-0.2.3 lib/modern_times/jms.rb