/** * @param Message $message * @param string|null $queueName */ public function produce(Message $message, $queueName = null) { $queueName = $queueName ?: Util::guessQueue($message); $queue = $this->queues->create($queueName); $queue->enqueue($envelope = new Envelope($message)); $this->dispatcher->dispatch('bernard.produce', new EnvelopeEvent($envelope, $queue)); }
/** * {@inheritdoc} */ public function getQueue() { return Util::guessQueue($this); }