Closed IndraGunawan closed 5 years ago
Hey @IndraGunawan!
I believe this is already possible, it's just not obvious. The metadata
key of the TransportConfiuguration
object maps to the setter methods on the message object. So, something like this should work:
$bus->dispatch((new Envelope($message))->with(new TransportConfiguration(
[
'metadata' => ['deliveryDelay' => 5000
],
)));
Or, in the newly merged code (that I'll tag shortly):
$envelope = (new Envelope($message))
->with(new TransportConfiguration(['metadata' => [
'deliveryDelay' => 10000
]]))
;
$bus->dispatch($envelope);
Let me know if that helps!
from this issue #57. i propose that we allow override the producer options from transport configuration