Add request to be sent to RPC Server.

@param string $messageBody
@param string $server
@param string $requestId
@param string $routingKey
356030
public function addRequest($messageBody, $server, $requestId, $routingKey = '')
    {
        if (empty($requestId)) {
            throw new \InvalidArgumentException("You must provide a request ID");
        }
        $this->setParameter('correlation_id', $requestId);
        $this->setParameter('reply_to', $this->queueName);

        $message = new AMQPMessage(
            $messageBody,
            $this->getParameters()
        );

        $this->channel
            ->basic_publish($message, $server . '-exchange', $routingKey);

        $this->requests++;
    }
522051
public function httpMkcol(RequestInterface $request, ResponseInterface $response)
    {
        $requestBody = $request->getBodyAsString();
        $path = $request->getPath();

        if ($requestBody) {
            $contentType = $request->getHeader('Content-Type');
            if (null === $contentType || (0 !== strpos($contentType, 'application/xml') && 0 !== strpos($contentType, 'text/xml'))) {
                // We must throw 415 for unsupported mkcol bodies
                throw new Exception\UnsupportedMediaType('The request body for the MKCOL request must have an xml Content-Type');
            }

            try {
                $mkcol = $this->server->xml->expect('{DAV:}mkcol', $requestBody);
            } catch (\Sabre\Xml\ParseException $e) {
                throw new Exception\BadRequest($e->getMessage(), 0, $e);
            }

            $properties = $mkcol->getProperties();

            if (!isset($properties['{DAV:}resourcetype'])) {
                throw new Exception\BadRequest('The mkcol request must include a {DAV:}resourcetype property');
            }
            $resourceType = $properties['{DAV:}resourcetype']->getValue();
            unset($properties['{DAV:}resourcetype']);
        } else {
            $properties = [];
            $resourceType = ['{DAV:}collection'];
        }

        $mkcol = new MkCol($resourceType, $properties);

        $result = $this->server->createCollection($path, $mkcol);

        if (is_array($result)) {
            $response->setStatus(207);
            $response->setHeader('Content-Type', 'application/xml; charset=utf-8');

            $response->setBody(
                $this->server->generateMultiStatus([$result])
            );
        } else {
            $response->setHeader('Content-Length', '0');
            $response->setStatus(201);
        }

        // Sending back false will interrupt the event chain and tell the server
        // we've handled this method.
        return false;
    }
249366
@Override
    public java.util.concurrent.Future<SendMessageResult> sendMessageAsync(String queueUrl, String messageBody) {

        return sendMessageAsync(new SendMessageRequest().withQueueUrl(queueUrl).withMessageBody(messageBody));
    }
315582
protected function publish(AMQPMessage $message, $exchangeQueue, $routingKey, $publishChannels)
    {
        foreach ($publishChannels as $channel) {
            $channel->basic_publish($message, $exchangeQueue, $routingKey);
        }
    }
843948
public function setMessage($messageString, $messageKey = null)
    {
        if ($messageKey === null) {
            $keys = array_keys($this->_messageTemplates);
            $messageKey = current($keys);
        }
        if (!isset($this->_messageTemplates[$messageKey])) {
            include_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception("No message template exists for key '$messageKey'");
        }
        $this->_messageTemplates[$messageKey] = $messageString;
        return $this;
    }
1134526
public void ack(String requestId, String resultMessage) throws TException
    {
        int index = this.requestedMap.remove(requestId);
        DRPCInvocationsClient client = this.clients.get(index);
        client.result(requestId, resultMessage);
    }
1109602
public function pushMessages($targetType, array $messages, $requestId = null, $campaignKey = null)
    {
        $data = [
            'request_id' => $requestId,
            'campaign_key' => $campaignKey,
            'target_type' => $targetType,
            'messages' => $messages,
        ];

        $options = [
            'auth' => [
                $this->apiKey,
                $this->apiSecret,
            ],
            'json' => $data,
        ];
        $uri = rtrim($this->uri, '/') . '/' . $this->appID;
        $response = $this->client->post($uri, $options);
        return json_decode($response->getBody(), true);
    }
1089148
public static void sendError( String messageKey, Throwable cause, ServletRequest request,
                                  HttpServletResponse response, Object[] messageArgs )
            throws IOException
    {
        // TODO: the following null check will be unnecessary once the deprecated
        // FlowController.sendError(String, HttpServletResponse) is removed.
        boolean avoidDirectResponseOutput = request != null ? avoidDirectResponseOutput( request ) : false;
        sendError( messageKey, messageArgs, request, response, cause, avoidDirectResponseOutput );
    }
871619
public CmsMenuItemVisibilityMode addMessageKey(String messageKey) {

        CmsMenuItemVisibilityMode mode = clone();
        mode.m_messageKey = messageKey;
        return mode;
    }
933649
public synchronized void add( int handle , String messageID , int deliveryMode , LocalQueue destination )
    {
    	// Create a new transaction item
    	TransactionItem item = new TransactionItem(handle,
    	                                           messageID,
    	                                           deliveryMode,
    	                                           destination);
    	items.add(item);
    }
1160708
function requestChannelRequest(server, channel, message) {
  try {
    var res = null;
    // do we have a request or is this just rendezvous?
    var req = new IncomingMessage(message, channel);
    if ( message.request.body == true) {
      channel.pendingRequest = req;
    } else {
      req.push(null);
    }
    res = new ServerResponse(req);
    res.requestId = message.request.id;
    res.assignSocket(channel);
    server.emit('request', req, res);
  } catch (err) {
    console.log(err);
  }
}
711677
protected function createBinding($exchange, $queue, $routingKey = null, array $arguments = array())
    {
        $this->action->createBinding($exchange, $queue, $routingKey, $arguments);
    }
862193
public static function add(string $messageType, string $message): void
    {
        $_SESSION[self::SESSION_KEY][$messageType][] = $message;
    }
324302
public function createFromPageAction(Request $request, $rootId, $pageId)
    {
        $rootNode = $this->admin->getObject($rootId);

        if (!$rootNode) {
            throw new NotFoundHttpException(sprintf('unable to find the Menu with id : %s', $rootId));
        }

        $page = $this->get('networking_init_cms.page_manager')->find($pageId);

        if (!$page) {
            throw new NotFoundHttpException(sprintf('unable to find the Page with id : %s', $pageId));
        }

        $menuItem = new MenuItem();

        $menuItem->setPage($page);
        $menuItem->setRoot($rootNode);
        $menuItem->setParent($rootNode);
        $menuItem->setName($page->getTitle());

        $em = $this->getDoctrine()->getManager();
        $em->persist($menuItem);
        $em->flush();

        $this->admin->createObjectSecurity($menuItem);

        return $this->redirect(
            $this->admin->generateUrl('list', ['page_id' => $page->getId(), 'menu_id' => $menuItem->getId()]).'#end'
        );
    }
897519
public function publishMessage($exchangeName, $routingKey, $message)
    {
        $informations = $this->query('POST', sprintf(
            '/api/exchanges/%s/%s/publish',
            $this->credentials['vhost'],
            $exchangeName
        ), array(
            'properties'       => array(),
            'routing_key'      => $routingKey,
            'payload'          => $message,
            'payload_encoding' => 'string',
        ));

        $decodedInformations = json_decode($informations, true);

        if (isset($decodedInformations['routed']) && true === $decodedInformations['routed']) {
            return;
        }

        throw new \RuntimeException('Unable to send that message into rabbit.');
    }
416393
private void addEntityID(Map<String, String> requestParameters, StringBuilder uri) {
        if (StringUtils.hasText(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_ID))) {
            uri.append("/").append(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_ID));
        }
    }
874298
private function sendResponse(int $requestId, ResponseInterface $response): void
    {
        $statusCode   = $response->getStatusCode();
        $reasonPhrase = $response->getReasonPhrase();

        $headerData = "Status: {$statusCode} {$reasonPhrase}\r\n";

        foreach ($response->getHeaders() as $name => $values) {
            $headerData .= $name.': '.implode(', ', $values)."\r\n";
        }

        $headerData .= "\r\n";

        $this->writeResponse($requestId, $headerData, $response->getBody()->detach());
    }