Module: JMS::MessageProducer
- Defined in:
- lib/jms/message_producer.rb
Overview
Extend JMS Message Producer Interface with Ruby methods
For further help on javax.jms.MessageProducer
http://download.oracle.com/javaee/6/api/javax/jms/MessageProducer.html
Interface javax.jms.Producer
Instance Method Summary collapse
-
#delivery_mode_sym ⇒ Object
Return the Delivery Mode as a Ruby symbol :persistent :non_persistent nil if unknown.
-
#delivery_mode_sym=(mode) ⇒ Object
Set the JMS Delivery Mode from a Ruby Symbol Valid values for mode :persistent :non_persistent.
Instance Method Details
#delivery_mode_sym ⇒ Object
Return the Delivery Mode as a Ruby symbol
:persistent
:non_persistent
nil if unknown
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/jms/message_producer.rb', line 13 def delivery_mode_sym case delivery_mode when JMS::DeliveryMode::PERSISTENT :persistent when JMS::DeliveryMode::NON_PERSISTENT :non_persistent else nil end end |
#delivery_mode_sym=(mode) ⇒ Object
Set the JMS Delivery Mode from a Ruby Symbol Valid values for mode
:persistent
:non_persistent
Example:
producer.delivery_mode_sym = :persistent
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/jms/message_producer.rb', line 31 def delivery_mode_sym=(mode) self.delivery_mode = case mode when :persistent JMS::DeliveryMode::PERSISTENT when :non_persistent JMS::DeliveryMode::NON_PERSISTENT else raise "Unknown delivery mode symbol: #{mode}" end end |