10000 [Messenger] SQS Transport ignores endpoint, queue_name & account from options · Issue #37598 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Messenger] SQS Transport ignores endpoint, queue_name & account from options #37598
Closed
@surikman

Description

@surikman

Symfony version(s) affected: 5.1

Description
AmazonSqs Messenger Transport Connection ignores endpoint, queue_name & account from options.
There is only one way to setup:
sqs://vpce-TfLKluIPhZtmo5uJ-zXcBsSWD.sqs.eu-west-1.vpce.amazonaws.com/123456789/my_queue

I would like to use endpoint queue_name and account from Available options as it is described in \Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\Connection but unfortunately this option is not used.

How to reproduce
Configuration:

    transports:
      my_transport:
        dsn: 'sqs://default'
        options:
            endpoint: 'https://vpce-TfLKluIPhZtmo5uJ-zXcBsSWD.sqs.eu-west-1.vpce.amazonaws.com'
            region: 'eu-west-1'
            queue_name: 'my_queue'
            account: '123456789'
            access_key: 'aws-access-key'
            secret_key: 'aws-secret-key'

Initialized Transport will have:
queue_name = ''
account = null

and clientConfiguration will be without custom endpoint

Possible Solution
Use Configuration e.g.:

    transports:
      my_transport:
        dsn: 'sqs://default'  # or maybe e.g.: sqs://custom for this case? (but I think that it is not necessary)
        options:
            endpoint: 'https://vpce-TfLKluIPhZtmo5uJ-zXcBsSWD.sqs.eu-west-1.vpce.amazonaws.com'
            region: 'eu-west-1'
            queue_name: 'my_queue'
            account: '123456789'
            access_key: 'aws-access-key'
            secret_key: 'aws-secret-key'

and in Connection::fromDsn() add something like this to parsing options data

 $configuration['account'] = $options['account'] ?? self::DEFAULT_OPTIONS['account'];
 $configuration['queue_name'] = $options['queue_name'] ?? self::DEFAULT_OPTIONS['queue_name'];
 $clientConfiguration['endpoint'] = $options['endpoint'] ?? self::DEFAULT_OPTIONS['endpoint'];

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0