zenstruck / messenger-test

Assertions and helpers for testing your symfony/messenger queues.
MIT License
218 stars 15 forks source link

transport options are not processed when configure in the options #79

Closed aegypius closed 3 months ago

aegypius commented 3 months ago

In the factory, the options array is ignored so it's not possible to use it to specify options instead of in the dsn.

For example:

my_queue:
  dsn: 'test://'
     options:
        queue_name: low
        disable_retries: false

or

$messengerConfig->transport('my_queue')
  ->dsn('test://')
    ->options([
       'queue_name' => 'low', 
       'disabled_retries' => false,
    ])

Is there any possible problem to merge options with the parsed options from dsn to allow to use the array syntax ?

I am willing to make a pull-request, if you think it's pertinent.

Thanks !

nikophil commented 3 months ago

Hi!

I think it is pertinent, since it mimics best what's happening in messenger.

from the docs:

Options defined under options take precedence over ones defined in the DSN.

I think this should be respected in the implementation.

I am willing to make a pull-request, if you think it's pertinent.

Cool, thanks! go ahead! :blush: