# File lib/mcollective/connector/rabbitmq.rb, line 428 def subscribe(agent, type, collective) if type == :reply # On rabbitmq if you send a message with a reply-to: header set to # '/temp-queue/*' it automatically creates a private queue, munges # the reply-to: header to point to this private queue, and # subscribes you to it. As such you should never attempt to # SUBSCRIBE or UNSUBSCRIBE to '/temp-queue/*' directly as that'll # cause great pain and suffering. # https://www.rabbitmq.com/stomp.html#d.tqd # The exception to this is in 'use_reply_exchange' mode, when the # reply-to will be set to a queue in an explicit exchange. if !get_bool_option("rabbitmq.use_reply_exchange", false) # We aren't in 'use_reply_exchange' mode, don't subscribe. return end end source = make_target(agent, type, collective) unless @subscriptions.include?(source[:id]) Log.debug("Subscribing to #{source[:name]} with headers #{source[:headers].inspect.chomp}") @connection.subscribe(source[:name], source[:headers], source[:id]) @subscriptions << source[:id] end rescue ::Stomp::Error::DuplicateSubscription Log.error("Received subscription request for #{source.inspect.chomp} but already had a matching subscription, ignoring") end