def amqp_send_once(packet, ids = nil)
      exchange = {:type => :fanout, :name => @request_queue, :options => {:durable => true, :no_declare => @secure}}
      @agent.client.publish(exchange, packet, :persistent => packet.persistent, :mandatory => true,
                            :log_filter => [:tags, :target, :tries, :persistent], :brokers => ids)
    rescue RightAMQP::HABrokerClient::NoConnectedBrokers => e
      ErrorTracker.log(self, error = "Failed to publish request #{packet.trace} #{packet.type}", e, packet)
      @send_failure_stats.update("NoConnectedBrokers")
      raise TemporarilyOffline.new(error + " (#{e.class}: #{e.message})")
    rescue StandardError => e
      ErrorTracker.log(self, error = "Failed to publish request #{packet.trace} #{packet.type}", e, packet)
      @send_failure_stats.update(e.class.name)
      raise SendFailure.new(error + " (#{e.class}: #{e.message})")
    end
def amqp_send_once(packet, ids = nil)
      exchange = {:type => :fanout, :name => @request_queue, :options => {:durable => true, :no_declare => @secure}}
      @agent.client.publish(exchange, packet, :persistent => packet.persistent, :mandatory => true,
                            :log_filter => [:tags, :target, :tries, :persistent], :brokers => ids)
    rescue RightAMQP::HABrokerClient::NoConnectedBrokers => e
      ErrorTracker.log(self, error = "Failed to publish request #{packet.trace} #{packet.type}", e, packet)
      @send_failure_stats.update("NoConnectedBrokers")
      raise TemporarilyOffline.new(error + " (#{e.class}: #{e.message})")
    rescue StandardError => e
      ErrorTracker.log(self, error = "Failed to publish request #{packet.trace} #{packet.type}", e, packet)
      @send_failure_stats.update(e.class.name)
      raise SendFailure.new(error + " (#{e.class}: #{e.message})")
    end
Send request via AMQP without retrying
 Use mandatory flag to request return of message if it cannot be delivered

 === Parameters
 packet(Push|Request):: Request packet to send
 ids(Array|nil):: Identity of specific brokers to choose from, or nil if any okay

 === Return
 (Array):: Identity of brokers to which request was published

 === Raise
 SendFailure:: If sending of request failed unexpectedly
 TemporarilyOffline:: If cannot send request because RightNet client currently disconnected
   and offline queueing is disabled