<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
autoprotect-group / messenger-enqueue-transport example snippets
use Symfony\Component\Messenger\Envelope;
use Enqueue\MessengerAdapter\EnvelopeItem\TransportConfiguration;
// ...
// create your message like normal
$message = // ...
$transportConfig = (new TransportConfiguration())
// commmon options have a convenient method
->setDeliveryDelay(5000)
// other transport-specific options are set via metadata
// example custom option for AmqpMessage
// each "metadata" will map to a setter on your message
// will result in setDeliveryMode(AmqpMessage::DELIVERY_MODE_PERSISTENT)
// being called
->addMetadata('deliveryMode', AmqpMessage::DELIVERY_MODE_PERSISTENT)
;
$bus->dispatch((new Envelope($message))->with($transportConfig));
use Symfony\Component\Messenger\Envelope;
use Enqueue\MessengerAdapter\EnvelopeItem\TransportConfiguration;
// ...
$transportConfig = (new TransportConfiguration())
->setTopic('specific-topic')
;
$bus->dispatch((new Envelope($message))->with($transportConfig));