Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
feat: add amazon sqs to docs#13328
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1131,6 +1131,35 @@ during a request:: | ||||||||||||||||||||||||||||||||||||||
:class:`Symfony\\Bundle\\FrameworkBundle\\Test\\KernelTestCase` | ||||||||||||||||||||||||||||||||||||||
or :class:`Symfony\\Bundle\\FrameworkBundle\\Test\\WebTestCase`. | ||||||||||||||||||||||||||||||||||||||
Amazon SQS | ||||||||||||||||||||||||||||||||||||||
~~~~~~~~~~ | ||||||||||||||||||||||||||||||||||||||
.. versionadded:: 5.1 | ||||||||||||||||||||||||||||||||||||||
The Amazon SQS transport has been added in Symfony 5.1 | ||||||||||||||||||||||||||||||||||||||
Install it by running: | ||||||||||||||||||||||||||||||||||||||
.. code-block:: terminal | ||||||||||||||||||||||||||||||||||||||
$ composer require symfony/amazon-sqs-messenger | ||||||||||||||||||||||||||||||||||||||
The ``SQS`` transport configuration looks like this: | ||||||||||||||||||||||||||||||||||||||
.. code-block:: bash | ||||||||||||||||||||||||||||||||||||||
# .env | ||||||||||||||||||||||||||||||||||||||
MESSENGER_TRANSPORT_DSN=sqs://guest:guest@sqs.eu-west-3.amazonaws.com/test?region=eu-west-3 | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I would also add an option to debug with local fake sqs
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @jderusse Your example with slashes in the password won't work since it will be parsed by Suggested change
And add this in the example since at least a lot of AWS secrets have slashes in them:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. thanks. specials char in credentials works but youhave to urlencode theme. I'd rather keep (and fix) my exemple and add a note about that in the doc. Many people are confused about this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. A lot of AWS keys will have slashes in them, and I also don't like you have to put your AWS credentials in the .env file multiple times since it's in the DSN in the example. At least mention this in docs so people don't have to find this out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Agreed. Both ways should be documented. I like your sample. A little bit more verbose, but avoid missconfiguraiton. | ||||||||||||||||||||||||||||||||||||||
.. note:: | ||||||||||||||||||||||||||||||||||||||
By default, the transport will automatically create queue that are needed. That can be disabled. | ||||||||||||||||||||||||||||||||||||||
Contributor
|
By default, the transport will automatically createqueue that are needed.That can be disabled. | |
By default, the transport will automatically createqueues that are needed.This can be disabled using the "auto_setup" option configuration. |
or
By default, the transport will automatically create queue thatare needed.That can be disabled. | |
By default, the transport will automatically create queue thatis needed.This can be disabled using the "auto_setup" option configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
First one is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the exchange, queues binding keys and more. See the documentation on | |
the exchange, queues binding keys and more. See thecodedocumentation on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I would define the list of options:
Option | Description | Default |
---|---|---|
endpoint | Absolute URL to the SQS service | https://sqs.eu-west-1.amazonaws.com |
region | Name of the AWS region | eu-west-1 |
queue_name | Name of the queue | messages |
account | identifier of the AWS account | the owner of the credentials |
access_key | AWS access key | |
secret_key | AWS secret key | |
buffer_size | number of messages to prefetch | 9 |
wait_time | long polling duration in seconds | 20 |
poll_timeout | wait for new message duration in seconds | 0.1 |
visibility_timeout | amount of seconds the message won't be visible | queue's configuration |
auto_setup | Whether the table should be created automatically during send / get. | true |
and add the note:
difference between `wait_time` and `poll_timeout`: The `wait_time` parameter define the maximum duration Amazon SQS should wait until a message is available in a queue before sending a response. It helps reducing the cost of using Amazon SQSby eliminating the number of empty responses.The `poll_timeout` parameter define the duration the receiver should wait before returning null. It avoids blocking other receivers from being called
and also add:
If the queue name is suffixed by `.fifo` AWS will creates a [FIFO queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html).Use the stamp `Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\AmazonSqsFifoStamp` to define the `Message group ID` and the `Message deduplication ID`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
another note:
FIFO queues don't support setting a delay per message, for retries to work you need set this to 0 in the config.retry_strategy: delay: 0 # FIFO queues don't support per-message delay settings
I actually don't know if this should be in the docs or it is a bug :)