send a HTTP message to an exchange with routing key

 *exchange*:: A AMQP exchange
 *routing_key*:: The routing key to use
 *message*:: The message to be sent
195529
def send_HTTP_request(exchange, routing_key, message)
      http_message = format_HTTP_message(message)

      message_id = AlchemyFlux::Service.generateUUID()

      http_message_options = {
        message_id:          message_id,
        type:               'http',
        reply_to:            @response_queue_name,
        content_encoding:   '8bit',
        content_type:       'application/json',
        expiration:          @options[:timeout],
        mandatory:           true
      }

      response_queue = Queue.new
      @transactions[message_id] = response_queue

      send_message(exchange, routing_key, http_message, http_message_options)

      EventMachine.add_timer(@options[:timeout]/1000.0) do
        response_queue = @transactions.delete message_id
        response_queue << TimeoutError if response_queue
      end

      response_queue.pop
    end
249908
def send(ch, message, **kwargs):
    
    params = {
        'type': kwargs.pop('req_type', 'self'),
        'key': settings.PUSHALL_API_KEYS[ch]['key'],
        'id': settings.PUSHALL_API_KEYS[ch]['id'],
        'title': kwargs.pop(
            "title", settings.PUSHALL_API_KEYS[ch].get('title') or ""),
        'text': message,
        'priority': kwargs.pop(
            "priority", settings.PUSHALL_API_KEYS[ch].get('priority') or "0"),
    }
    if kwargs:
        params.update(**kwargs)

    response = urlopen(
        Request('https://pushall.ru/api.php'),
        urlencode(params),
        timeout=10
    )

    if response.code != 200:
        raise PushAllError(response.read())

    json = loads(response.read())
    if json.get('error'):
        raise PushAllError(json.get('error'))

    return True
1000727
async def send_message(  # type: ignore
        self, request: str, response_expected: bool, **kwargs: Any
    ) -> Response:
        
        headers = dict(self.DEFAULT_HEADERS)
        headers.update(kwargs.pop("headers", {}))

        response = await self.client.fetch(
            self.endpoint, method="POST", body=request, headers=headers, **kwargs
        )

        return Response(response.body.decode(), raw=response)
1300296
def bind_topic_exchange(self, exchange_name, routing_key, queue_name):
        
        self._channel.queue_declare(
            queue=queue_name,
            auto_delete=True,
            durable=True,
        )
        self._channel.exchange_declare(
            exchange=exchange_name,
            exchange_type='topic',
            auto_delete=True,
        )
        self._channel.queue_bind(
            exchange=exchange_name,
            queue=queue_name,
            routing_key=routing_key
        )
814757
def Send(self, message):
    
    if not self.outgoing:
      raise NotConfigured("Send address not provided.")
    self.outgoing.InsertMessage(message)
648661
def send_client_message(message)
      Slanger::Redis.publish(message['channel'], Oj.dump(message, mode: :compat)) if authenticated?
    end
1296343
def send(self, from_client, message, to_clients=None, transient=False, push_data=None):
        
        if isinstance(message, dict):
            message = json.dumps(message)
        params = {
            'from_peer': from_client,
            'conv_id': self.id,
            'transient': transient,
            'message': message,
        }
        if to_clients:
            params['to_peers'] = to_clients
        if push_data:
            params['push_data'] = push_data
        client.post('/rtm/messages', params=params).json()
315582
protected function publish(AMQPMessage $message, $exchangeQueue, $routingKey, $publishChannels)
    {
        foreach ($publishChannels as $channel) {
            $channel->basic_publish($message, $exchangeQueue, $routingKey);
        }
    }
832838
public function send($exchange, $routing_key, $message, $type = self::TYPE_TOPIC)
    {
        $message = $this->prepareMessage($message);
        if ($type == self::TYPE_TOPIC) {
            $this->channel->exchange_declare($exchange, $type, false, true, false);
        }
        $this->channel->basic_publish($message, $exchange, $routing_key);
    }
351608
public function send($routing_key, $message, $exchange = null, $type = Amqp::TYPE_TOPIC)
    {
        $this->amqp->send($exchange ?: $this->exchange, $routing_key, $message, $type);
    }
822731
public function basic_publish(
        $msg,
        $exchange = '',
        $routing_key = '',
        $mandatory = false,
        $immediate = false,
        $ticket = null
    ) {
        $pkt = new AMQPWriter();
        $pkt->write($this->pre_publish($exchange, $routing_key, $mandatory, $immediate, $ticket));

        try {
            $this->connection->send_content(
                $this->channel_id,
                60,
                0,
                mb_strlen($msg->body, 'ASCII'),
                $msg->serialize_properties(),
                $msg->body,
                $pkt
            );
        } catch (AMQPConnectionClosedException $e) {
            $this->do_close();
            throw $e;
        }

        if ($this->next_delivery_tag > 0) {
            $this->published_messages[$this->next_delivery_tag] = $msg;
            $this->next_delivery_tag = bcadd($this->next_delivery_tag, '1', 0);
        }
    }
253458
def send_message(self, app_mxit_id, target_user_ids, message='', contains_markup=True,
                     spool=None, spool_timeout=None, links=None, scope='message/send'):
        

        data = {
            'From': app_mxit_id,
            'To': ",".join(target_user_ids),
            'Body': message,
            'ContainsMarkup': contains_markup
        }

        if spool:
            data['Spool'] = spool
        if spool_timeout:
            data['SpoolTimeOut'] = spool_timeout
        if links:
            data['Links'] = links

        return _post(
            token=self.oauth.get_app_token(scope),
            uri='/message/send',
            data=data
        )
691321
def send(self, message):
        
        if not isinstance(message, (Msg, MsgProto)):
            raise ValueError("Expected Msg or MsgProto, got %s" % message)

        if self.steam_id:
            message.steamID = self.steam_id
        if self.session_id:
            message.sessionID = self.session_id

        if self.verbose_debug:
            self._LOG.debug("Outgoing: %s\n%s" % (repr(message), str(message)))
        else:
            self._LOG.debug("Outgoing: %s", repr(message))

        data = message.serialize()

        if self.channel_key:
            if self.channel_hmac:
                data = crypto.symmetric_encrypt_HMAC(data, self.channel_key, self.channel_hmac)
            else:
                data = crypto.symmetric_encrypt(data, self.channel_key)

        self.connection.put_message(data)
1351373
async def _bind_key_to_queue(self, routing_key: AnyStr, queue_name: AnyStr) -> None:
        
        logger.info("Binding key='%s'", routing_key)

        result = await self._channel.queue_bind(
            exchange_name=self._exchange_name,
            queue_name=queue_name,
            routing_key=routing_key,
        )
        return result
610969
def return_msg(self, reply_code, reply_text, exchange, routing_key):
        '''
        
        '''
        args = Writer()
        args.write_short(reply_code).\
            write_shortstr(reply_text).\
            write_shortstr(exchange).\
            write_shortstr(routing_key)

        self.send_frame(MethodFrame(self.channel_id, 60, 50, args))
419340
def send_message(type, message=nil)
      message = message.nil? ? message = '' : message.to_json
      body = type + ' ' + message
      body.strip!
      length = body.bytesize
      @client.write("#{length}\n#{body}")
    end
1367245
def send(exchange)
      host = normalize_host(exchange.host)

      @socket.send(exchange.message.to_wire, 0, host, exchange.port)

      @log.info('-> ' + exchange.to_s)
      @log.debug(exchange.message.inspect)
    end