Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Add a documentation about Messenger's transports#11331
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
Closed
Uh oh!
There was an error while loading.Please reload this page.
Closed
Changes from1 commit
Commits
Show all changes
7 commits Select commitHold shift + click to select a range
b4e25a1 Add a documentation about Messenger's transports
srozecf224cd fixup! Add a documentation about Messenger's transports
7ad2123 fixup! Add a documentation about Messenger's transports
38f76c6 fixup! Add a documentation about Messenger's transports
9055f2f fixup! Add a documentation about Messenger's transports
547971d fixup! Add a documentation about Messenger's transports
83b26c5 fixup! Add a documentation about Messenger's transports
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
fixup! Add a documentation about Messenger's transports
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
28 changes: 16 additions & 12 deletionscomponents/messenger/transports.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -8,7 +8,7 @@ To send and receive messages via message brokers, the Messenger component has | ||
| "transports". Transports are responsible for routing messages to and from | ||
| the message brokers. | ||
| Every transport is configurable using a DSN. This DSN allows you tochoose the | ||
| transport layer as well as configure it. | ||
| AMQP | ||
| @@ -18,7 +18,7 @@ The most famous message broker protocol is probably AMQP, which is most | ||
| commonly implemented with RabbitMQ. The Messenger component has built-in | ||
| support for AMQP. | ||
| HowDoesitWorks? | ||
| ~~~~~~~~~~~~~ | ||
| A DSN that starts with ``amqp://`` is recognized and used to create | ||
| @@ -34,11 +34,11 @@ queue on the ``/`` vhost (the ``%2f`` is a url-encoded ``/``). | ||
| By default, RabbitMQ uses ``guest`` as a username and ``guest`` as a password | ||
| and has a ``/`` vhost. | ||
| ErrorHandling | ||
| ~~~~~~~~~~~~~~ | ||
| If something wrong happens (i.e. an exception is thrown) while handling your message, | ||
| the defaultbehavior is that your message will be "NACK" and requeued. | ||
| However, if your exception implements the ``RejectMessageExceptionInterface`` interface, | ||
| the message will be rejected from the queue. | ||
| @@ -51,6 +51,7 @@ arise. Typically, a 3rd party provider is down or your system is under heavy loa | ||
| and can't really process some messages. To handle this scenario, there is a built-in | ||
| retry mechanism that can be enabled via your DSN:: | ||
| .. code-block:: bash | ||
| amqp://guest:guest@localhost/%2f/messages | ||
llaakkkk marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| ?retry[attempts]=3 | ||
| &retry[ttl][0]=10000 | ||
| @@ -63,7 +64,7 @@ it will wait 30 seconds. After the 3rd failure, it will wait a minute. If it sti | ||
| fails, the message will be moved to a "dead queue" and you will have to manually | ||
| handle this message. | ||
| DSNConfiguration Reference | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| The options available in the DSN are documented on the ``Connection`` class | ||
| @@ -76,20 +77,23 @@ Probably one of the most famous PHP queue-broker libraries, Enqueue, has 10+ ada | ||
| with brokers like Kafka, Google Pub/Sub, AWS SQS and more. Check out the transport | ||
| documentation in `Enqueue's official repository`_. | ||
| Your ownTransport | ||
| ------------------ | ||
| If there is no available transport for your message broker, you can create your own. | ||
| Your ownSender | ||
| ~~~~~~~~~~~~~~~ | ||
| Using the ``SenderInterface``, you can create your own message sender. | ||
| You already have an ``ImportantAction`` message going through the | ||
| message bus and handled by a handler. Now, you also want to send this message as | ||
| an email via your sender:: | ||
| .. code-block:: php | ||
| // src/MessageSender/ImportantActionToEmailSender.php | ||
| namespace App\MessageSender; | ||
llaakkkk marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| use App\Message\ImportantAction; | ||
| @@ -129,7 +133,7 @@ Your own receiver | ||
| A receiver is responsible for receiving messages from a source and dispatching | ||
| them to the application. | ||
| You already processed some "orders" in your application using a | ||
| ``NewOrder`` message. Now you want to integrate with a 3rd party or a legacy | ||
| application but you can't use an API and need to use a shared CSV file with new | ||
| orders. | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.