X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=plugins%2Fmcollective%2Fconnector%2Frabbitmq.rb;fp=plugins%2Fmcollective%2Fconnector%2Frabbitmq.rb;h=f3e2dbe94abbcb17d96e144890cb56689f7f7313;hb=8fd0f35facc21b89b378ecfb253e06a66af1e422;hp=2bb3b1c95dcfea70a8702d9e23181669ab9d89eb;hpb=327162e6e319ff38447992668e0753363b870b6e;p=packages%2Fprecise%2Fmcollective.git diff --git a/plugins/mcollective/connector/rabbitmq.rb b/plugins/mcollective/connector/rabbitmq.rb index 2bb3b1c..f3e2dbe 100644 --- a/plugins/mcollective/connector/rabbitmq.rb +++ b/plugins/mcollective/connector/rabbitmq.rb @@ -73,7 +73,7 @@ module MCollective host = {} host[:host] = get_option("rabbitmq.pool.#{poolnum}.host") - host[:port] = get_option("rabbitmq.pool.#{poolnum}.port", 6163).to_i + host[:port] = get_option("rabbitmq.pool.#{poolnum}.port", 61613).to_i host[:login] = get_env_or_option("STOMP_USER", "rabbitmq.pool.#{poolnum}.user") host[:passcode] = get_env_or_option("STOMP_PASSWORD", "rabbitmq.pool.#{poolnum}.password") host[:ssl] = get_bool_option("rabbitmq.pool.#{poolnum}.ssl", false) @@ -190,7 +190,7 @@ module MCollective target = {:name => msg.request.headers["reply-to"], :headers => {}, :id => ""} elsif [:request, :direct_request].include?(msg.type) - target = make_target(msg.agent, msg.type, msg.collective, node) + target = make_target(msg.agent, msg.type, msg.collective, msg.reply_to, node) else raise "Don't now how to create a target for message type #{msg.type}" @@ -200,7 +200,7 @@ module MCollective return target end - def make_target(agent, type, collective, node=nil) + def make_target(agent, type, collective, reply_to=nil, node=nil) raise("Unknown target type #{type}") unless [:directed, :broadcast, :reply, :request, :direct_request].include?(type) raise("Unknown collective '#{collective}' known collectives are '#{@config.collectives.join ', '}'") unless @config.collectives.include?(collective) @@ -213,7 +213,11 @@ module MCollective when :broadcast, :request # publishing a request to all nodes with an agent target[:name] = "/exchange/%s_broadcast/%s" % [collective, agent] - target[:headers]["reply-to"] = "/temp-queue/mcollective_reply_%s" % agent + if reply_to + target[:headers]["reply-to"] = reply_to + else + target[:headers]["reply-to"] = "/temp-queue/mcollective_reply_%s" % agent + end target[:id] = "%s_broadcast_%s" % [collective, agent] when :direct_request # a request to a specific node