Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow override options from configuration #58

Closed
wants to merge 2 commits into from

Conversation

IndraGunawan
Copy link

from this issue #57. i propose that we allow override the producer options from transport configuration

@weaverryan
Copy link
Collaborator

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!

@weaverryan weaverryan closed this Mar 12, 2019
@IndraGunawan IndraGunawan deleted the override-options branch March 12, 2019 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants