public function submitCommand($queue, $payload, $options = null)
    {
        $queue = $this->queueManager->getQueue($queue);
        if ($options !== null) {
            $options = json_decode($options, true);
        }
        $messageId = $queue->submit($payload, $options !== null ? $options : []);
        $this->outputLine('<success>Submitted payload to queue "%s" with ID "%s".</success>', [$queue->getName(), $messageId]);
    }
public function submitCommand($queue, $payload, $options = null)
    {
        $queue = $this->queueManager->getQueue($queue);
        if ($options !== null) {
            $options = json_decode($options, true);
        }
        $messageId = $queue->submit($payload, $options !== null ? $options : []);
        $this->outputLine('<success>Submitted payload to queue "%s" with ID "%s".</success>', [$queue->getName(), $messageId]);
    }
public function submitCommand ( $ queue , $ payload , $ options = null ) { $ queue = $ this -> queueManager -> getQueue ( $ queue ) ; if ( $ options !== null ) { $ options = json_decode ( $ options , true ) ; } $ messageId = $ queue -> submit ( $ payload , $ options !== null ? $ options : [ ] ) ; $ this -> outputLine ( '<success>Submitted payload to queue "%s" with ID "%s".</success>' , [ $ queue -> getName ( ) , $ messageId ] ) ; }
Submit a message to a given queue

This command can be used to "manually" add messages to a given queue.

<b>Example:</b>
<i>flow queue:submit some-queue "some payload" --options '{"delay": 14}'</i>

To make this work with the <i>JobManager</i> the payload has to be a serialized
instance of an object implementing <i>JobInterface</i>.

@param string $queue Name of the queue to submit a message to (e.g. "some-queue")
@param string $payload Arbitrary payload, for example a serialized instance of a class implementing JobInterface
@param string $options JSON encoded, for example '{"some-option": "some-value"}'
@return void
@throws Exception
Submit a message to a given queue