src/Publisher/SerializingPublisher.php
public function publish($data, $routingKey = '', array $headers = [])
    {
        $returnValue = $this->publisher->publish(
            $this->serializer->serialize($data),
            $routingKey,
            $headers
        );

        return $this->serializer->deserialize($returnValue);
    }
public function publish($data, $routingKey = '', array $headers = [])
    {
        $returnValue = $this->publisher->publish(
            $this->serializer->serialize($data),
            $routingKey,
            $headers
        );

        return $this->serializer->deserialize($returnValue);
    }
Publish a message on the queue

@param mixed    $data
@param string   $routingKey
@param string[] $headers

@return mixed