src/Publisher/ExchangePublisher.php
protected function publishToExchange(Message $message, \AMQPExchange $exchange)
    {
        $isPublished = $exchange->publish(
            $message->getMessage(),
            $message->getRoutingKey(),
            $message->getFlags(),
            $message->getAttributes()
        );

        if (!$isPublished) {
            throw FailedToPublishException::fromMessage($message);
        }

        return $isPublished;
    }
protected function publishToExchange(Message $message, \AMQPExchange $exchange)
    {
        $isPublished = $exchange->publish(
            $message->getMessage(),
            $message->getRoutingKey(),
            $message->getFlags(),
            $message->getAttributes()
        );

        if (!$isPublished) {
            throw FailedToPublishException::fromMessage($message);
        }

        return $isPublished;
    }
protected function publishToExchange ( Message $ message , \ AMQPExchange $ exchange ) { $ isPublished = $ exchange -> publish ( $ message -> getMessage ( ) , $ message -> getRoutingKey ( ) , $ message -> getFlags ( ) , $ message -> getAttributes ( ) ) ; if ( ! $ isPublished ) { throw FailedToPublishException :: fromMessage ( $ message ) ; } return $ isPublished ; }
Publish the message to AMQP exchange

@param Message $message
@param \AMQPExchange $exchange
@return bool
@throws \AMQPException
Publish the message to AMQP exchange