Skip to content

[simple-client] sqs: DSN not working #483

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

Closed
jhogervorst opened this issue Jul 31, 2018 · 1 comment · Fixed by #486
Closed

[simple-client] sqs: DSN not working #483

jhogervorst opened this issue Jul 31, 2018 · 1 comment · Fixed by #486
Milestone

Comments

@jhogervorst
Copy link

I’ve installed enqueue/sqs, enqueue/fs, and enqueue/simple-client via Composer.

When running:

$dsn = 'sqs:?key=aKey&secret=aSecret&region=eu-west-1';
$client = new \Enqueue\SimpleClient\SimpleClient($dsn);

I get an exception:

Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
Unrecognized option "sqs:?key=aKey&secret=aSecret&region=eu_west_1" under "enqueue.transport"

I’ve already checked whether the SQS broker exists, which is the case (var_dump(class_exists(\Enqueue\Sqs\SqsConnectionFactory::class)) yields bool(true)).

I did notice that when I change the DSN to sqs://... (so adding two slashes), I do not get the Symphony exception. However, then I get a "Failed to parse DSN" exception from SqsConnectionFactory, as it doesn’t expect those extra slashes

@jhogervorst
Copy link
Author

Also, I already found the issue 😄

In enqueue/simple-client/SimpleClient.php:380, there is a check whether :// occurs in the DSN, which is not the case for the SQS DSN. If I manually specify the config array that would be used if :// did occur, it does work:

$dsn = 'sqs:?key=aKey&secret=aSecret&region=eu-west-1';
$config = ['transport' => ['default' => $dsn]];
$client = new \Enqueue\SimpleClient\SimpleClient($config);

@makasim makasim added the bug label Jul 31, 2018
@makasim makasim added the 0.9 label Nov 27, 2018
@makasim makasim added this to the 0.9 milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants