lib/manageiq/messaging/client.rb
def subscribe_topic(options, &block)
        raise "A block is required" unless block_given?
        assert_options(options, [:service])

        subscribe_topic_impl(options, &block)
      end
# Subscribe to receive topic type messages.
# Expected keys in +options+ are:
# * :service (service is used to determine the topic address)
# Other options are underlying messaging system specific.
#
# Some messaging systems allow subscribers to consume events missed during the period when
# the client is offline when they reconnect. Additional options are needed to turn on
# this feature.
#
# A callback block is needed to consume the topic:
#
#   client.subcribe_topic(:service => 'provider_events', :auto_ack => false) do |msg|
#     # msg is a type of ManageIQ::Messaging::ReceivedMessage
#     # attributes in msg
#     msg.sender
#     msg.message
#     msg.payload
#     msg.ack_ref
#
#     msg.ack # needed only when options[:auto_ack] is false
#     # process the message
#   end
#
# With the auto_ack option default to true, the message will be automatically
# acked immediately after the delivery.
# Some messaging systems allow the subscriber to ack each message in the
# callback block. The code in the block can decide when to ack according
# to whether a message can be retried. Ack the message in the beginning of
# processing if the message is not re-triable; otherwise ack it after the
# message is proccessed. Any un-acked message will be redelivered to next subscriber
# AFTER the current subscriber disconnects normally or abnormally (e.g. crashed).
#
# To ack a message call +msg.ack+
Subscribe to receive topic type messages.
Expected keys in +options+ are:
:service (service is used to determine the topic address)
Other options are underlying messaging system specific.

Some messaging systems allow subscribers to consume events missed during the period when
the client is offline when they reconnect. Additional options are needed to turn on
this feature.

A callback block is needed to consume the topic.



msg.ack # needed only when options[:auto_ack] is false
process the message
end

With the auto_ack option default to true, the message will be automatically
acked immediately after the delivery.
Some messaging systems allow the subscriber to ack each message in the
callback block. The code in the block can decide when to ack according
to whether a message can be retried. Ack the message in the beginning of
processing if the message is not re-triable; otherwise ack it after the
message is proccessed. Any un-acked message will be redelivered to next subscriber
AFTER the current subscriber disconnects normally or abnormally .

To ack a message call +msg.ack+
Subscribe to receive topic type messages . Expected keys in + options + are : : service ( service is used to determine the topic address ) Other options are underlying messaging system specific . Some messaging systems allow subscribers to consume events missed during the period when the client is offline when they reconnect . Additional options are needed to turn on this feature . A callback block is needed to consume the topic . msg . ack # needed only when options [ : auto_ack ] is false process the message end With the auto_ack option default to true the message will be automatically acked immediately after the delivery . Some messaging systems allow the subscriber to ack each message in the callback block . The code in the block can decide when to ack according to whether a message can be retried . Ack the message in the beginning of processing if the message is not re - triable ; otherwise ack it after the message is proccessed . Any un - acked message will be redelivered to next subscriber AFTER the current subscriber disconnects normally or abnormally . To ack a message call + msg . ack +
def subscribe_topic(options, &block)
        raise "A block is required" unless block_given?
        assert_options(options, [:service])
        subscribe_topic_impl(options, &block)
      end
def subscribe_topic ( options , & block ) raise "A block is required" unless block_given? assert_options ( options , [ :service ] ) subscribe_topic_impl ( options , & block ) end
Subscribe to receive topic type messages.
Subscribe to receive topic type messages .
options
block