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++;
    }
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++;
    }
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 ++ ; }
Add request to be sent to RPC Server.

@param string $messageBody
@param string $server
@param string $requestId
@param string $routingKey
Add request to be sent to RPC Server .