Open malarzm opened 5 years ago
when trying
$envelope = $envelope->with((new TransportConfiguration())->setDeliveryDelay(5000));
got this
Missing "setDeliveryDelay" setter for "deliveryDelay" metadata key in "Interop\Amqp\Impl\AmqpMessage" class
It does not seem like there should be the setDeliveryDelay, setDelayStrategy and setTimeToLive methods in the TransportConfiguration class. Those methods set metadata that QueueInteropTransport::setMessageMetadata uses to set methods on \Interop\Amqp\AmqpMessage or \Interop\Queue\Message which do not exist. The TransportConfiguration::setPriority method will also only work on AmqpMessage.
It seems like 'deliveryDelay', 'delayStrategy', 'priority' and 'timeToLive' should only be set as options to QueueInteropTransport which are all supported.
The proper way to only delay specific messages would be to add a \Symfony\Component\Messenger\Stamp\DelayStamp to the Envelope but, unfortunately, that is not working on QueueInteropTransport right now:
$envelope = $envelope->with(new DelayStamp(5000));
Should setDeliveryDelay, setDelayStrategy, setTimeToLive and setPriority be dropped from TransportConfiguration?
Expected result:
deliveryDelay
fromTransportConfiguration
is used overdeliveryDelay
specified in transport's options.Actual result:
Enqueue\MessengerAdapter\Exception\MissingMessageMetadataSetterException: Missing "setDeliveryDelay" setter for "deliveryDelay" metadata key in "Double\Enqueue\MessengerAdapter\Tests\Fixtures\DecoratedPsrMessage\P1"
Sorry for not providing a PR, this test can be pasted directly to
QueueInteropTransportTest