Sends message to the exchange.

@param string $routing_key
@param string|array|AMQPMessage $message
@param string $exchange
@param string $type
@return void
351608
public function send($routing_key, $message, $exchange = null, $type = Amqp::TYPE_TOPIC)
    {
        $this->amqp->send($exchange ?: $this->exchange, $routing_key, $message, $type);
    }
789298
public function setMessage($message, $type = 'info', $parameters = [])
    {
        $this->getSession()->getFlashBag()->add($type, $this->translate($message, $parameters));
    }
248012
public function sendShipping($emails, $type, $body)
    {
        $templateName = 'CoreBundle:Email:newsletter.html.twig';
  
        $context = array(
            'type'     => $type,
            'body' => $body
        );
        
         $this->sendMessage(
                $templateName, 
                $context,  
                $this->twigGlobal->getParameter('admin_email'), 
                $emails
                );

    }
880267
public function send($type, $id, $sender, $msgType, $message)
    {
        $content = (new Transformer($msgType, $message))->transform();

        $params = array_merge([
            'receiver' => [
                'type' => $type,
                'id'   => $id,
            ],
            'sender' => $sender,
        ], $content);

        return $this->parseJSON('json', [self::API_SEND, $params]);
    }
50236
public function addMessage($message, $type) {
		if(!($this->session->get($this->sessionKey, [])) == null)
		{
			$messages = $this->session->get($this->sessionKey, []);
		}
		
		$messages[] = [
			'message' => $message,
			'type' => $type,
		];
		
		$this->session->set($this->sessionKey, $messages);
	}
1011117
void processPing(final HttpServerExchange exchange, final RequestData requestData) throws IOException {

        final String jvmRoute = requestData.getFirst(JVMROUTE);
        final String scheme = requestData.getFirst(SCHEME);
        final String host = requestData.getFirst(HOST);
        final String port = requestData.getFirst(PORT);

        final String OK = "Type=PING-RSP&State=OK&id=" + creationTime;
        final String NOTOK = "Type=PING-RSP&State=NOTOK&id=" + creationTime;

        if (jvmRoute != null) {
            // ping the corresponding node.
            final Node nodeConfig = container.getNode(jvmRoute);
            if (nodeConfig == null) {
                sendResponse(exchange, NOTOK);
                return;
            }
            final NodePingUtil.PingCallback callback = new NodePingUtil.PingCallback() {
                @Override
                public void completed() {
                    try {
                        sendResponse(exchange, OK);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }

                @Override
                public void failed() {
                    try {
                        nodeConfig.markInError();
                        sendResponse(exchange, NOTOK);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            };
            nodeConfig.ping(exchange, callback);
        } else {
            if (scheme == null && host == null && port == null) {
                sendResponse(exchange, OK);
                return;
            } else {
                if (host == null || port == null) {
                    processError(TYPESYNTAX, SMISFLD, exchange);
                    return;
                }
                // Check whether we can reach the host
                checkHostUp(scheme, host, Integer.parseInt(port), exchange, new NodePingUtil.PingCallback() {
                    @Override
                    public void completed() {
                        sendResponse(exchange, OK);
                    }

                    @Override
                    public void failed() {
                        sendResponse(exchange, NOTOK);
                    }
                });
                return;
            }
        }
    }
711677
protected function createBinding($exchange, $queue, $routingKey = null, array $arguments = array())
    {
        $this->action->createBinding($exchange, $queue, $routingKey, $arguments);
    }
136867
def handle_message(metadata, payload)
       # loop through appenders and fire each as required
       @consumers.each do |consumer|
         action = metadata.routing_key.split('.', 2).first
         if(action == "publish")
           exchange = metadata.attributes[:headers]["exchange_name"]
           queue = metadata.routing_key.split('.', 2).last
           item = {:date => Time.now, 
                :exchange => exchange,
                :queue => queue,
                :routing_keys => metadata.attributes[:headers]["routing_keys"].inspect,
                :attributes => metadata.attributes.inspect,
                :payload => payload.inspect
           }
           consumer.log_event(item)
         end 
       end
    end
1119688
def send(self,message,message_type,topic=''):
        
        if message_type == RAW:
            self._sock.send(message)
        elif message_type == PYOBJ:
            self._sock.send_pyobj(message)
        elif message_type == JSON:
            self._sock.send_json(message)
        elif message_type == MULTIPART:
            self._sock.send_multipart([topic, message])
        elif message_type == STRING:
            self._sock.send_string(message)
        elif message_type == UNICODE:
            self._sock.send_unicode(message)
        else:
            raise Exception("Unknown message type %s"%(message_type,))
1291373
protected function _sendAddresses($type, $addresses)
    {
        foreach ($addresses as $k => $v) {
            if (is_int($k)) {
                $this->_writeLine("$type: <$v>");
            } else {
                $this->_writeLine("$type: " . $this->_encode($v) . " <$k>");
            }
        }
        return $this;
    }
282519
public static function send($eventKey, array $data, $ip = "0.0.0.0")
    {

        $id = self::getId($ip);
        $ventData = [
            '_id'       => $id,
            'eventKey'  => $eventKey,
            'data'      => $data,
            'ip'        => $ip,
        ];
        $exchangeName   = Helper::getExchangeName();
        $rabbitMq       = new RabbitMq($exchangeName);
        $routeKey       = "route_gateway";
        $rabbitMq->send($ventData, $routeKey);
        return $id;
    }
167546
private function addSessionFlashBagMessage($message, $type = Bootstrap4::STATE_SUCCESS, $translationDomain = null)
    {
        if (false !== $translationDomain) {
            $message = $this->getTranslator()->trans($message, [], $translationDomain);
        }

        $this->getSession()->getFlashBag()->add($type, $message);
    }
432386
public void send(String channel, String message) {
		// CAUSE: Assignment to method parameter
		Pair<Boolean, String> sendValidation = isSendValid(channel, message, null, null);

		//String lMessage = message.replace("\n", "\\n");

		if (sendValidation != null && sendValidation.first) {
			try {
				String messageId = Strings.randomString(8);
				ArrayList<Pair<String, String>> messagesToSend = multiPartMessage(
						message, messageId);
				for (Pair<String, String> messageToSend : messagesToSend) {
					send(channel, messageToSend.second, messageToSend.first,
							sendValidation.second);
				}
			} catch (IOException e) {
				raiseOrtcEvent(EventEnum.OnException, this, e);
			}
		}
	}
1120465
public static void sendContinueResponse(final HttpServerExchange exchange, final IoCallback callback) {
        if (!exchange.isResponseChannelAvailable()) {
            callback.onException(exchange, null, UndertowMessages.MESSAGES.cannotSendContinueResponse());
            return;
        }
        internalSendContinueResponse(exchange, callback);
    }
162046
public function publish($body, array $headers = [], $exchange = '', $routingKey = '', $mandatory = false, $immediate = false)
    {
        $response = $this->publishImpl($body, $headers, $exchange, $routingKey, $mandatory, $immediate);

        if ($this->mode === ChannelModeEnum::CONFIRM) {
            if ($response instanceof PromiseInterface) {
                return $response->then(function () {
                    return ++$this->deliveryTag;
                });
            } else {
                return ++$this->deliveryTag;
            }
        } else {
            return $response;
        }
    }
161320
public void send(final Message msg) throws MailException {
		Transport transport = null;
		try {
			if (log.isDebugEnabled()) {
				log.debug("Sending mail message [subject={}, recipients={}]", msg.getSubject(),
						on(", ").join(msg.getAllRecipients()));
			}
			transport = sessionProvider.get().getTransport();
			transport.connect();
			transport.sendMessage(msg, msg.getAllRecipients());
		} catch (MessagingException ex) {
			throw new MailException("Error sending mail message", ex);
		} finally {
			try {
				transport.close();
			} catch (MessagingException ex) {
				log.error(ex.getMessage(), ex);
			}
		}
	}
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