Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] Add the transports documentation#9756

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
sroze wants to merge4 commits intosymfony:4.1fromsroze:messenger-amqp-transport

Conversation

@sroze
Copy link
Contributor

@srozesroze commentedMay 10, 2018
edited
Loading

Add the Messenger transports documentation. Does not aim to be exhaustive but give more details.

One little thing... we wait for this one to be merged:symfony/symfony#27008

$this->toEmail = $toEmail;
}

public function send($message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should be updated according to the current contract,Envelope $... ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.


class YourTransport implements TransportInterface
{
public function send($message) : void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Same here.


First, create your sender::

namespace App\MessageSender;
Copy link
Member

@ycerutoycerutoMay 10, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We could go suggesting a better structure for Messenger stuff? maybeApp\Message\Sender orApp\Messenger\Transport instead?

ogizanagi reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yep, why not 👍

~~~~~~~~~~~~~~

If something wrong happens (i.e. an exception is thrown) while handling your message,
the default behaviour is that your message will be "NACK" and requeued.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Who is NACK? It sounds mean :).

Seriously, as someone not too familiar with this stuff, is NACK an "action". Like, a "message is NACKed"? OR, something different?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not Acknowledge. Do you have any idea on how to phrase it differently? 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Beginning with this, i'll explain this like : Not Acknowledge = nottreated and requeued.

Retry
~~~~~

When receiving messages from a broker, it might happen that some exceptions will
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm not clear what this means. Do you mean, when my app is handling a message (that just came from a broker), it could fail (e.g. DB exception, or my handler throws an exception)? Or, are you talking about some sort of communication error from the broker?

the first failure, it will wait 10 seconds before trying it. After the 2nd failure,
it will wait 30 seconds. After the 3rd failure, it will wait a minute. If it still
fails, the message will be moved to a "dead queue" and you will have to manually
handle this message.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you just define a single TTL to be used for each retry? Or is there a default?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

These are to be removed as retry wasn't merged in.

When receiving messages from a broker, it might happen that some exceptions will
arise. Typically, a 3rd party provider is down or your system is under heavy load
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::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You can't use the:: in these cases - it's short for.. code-block:: php, and it's just text below. Let's use:

.. code-block:: text

~~~~~~~~~~~~~~~~~~~~~~~~~~~

The options available in the DSN are documented on the ``Connection`` class
in the code repository.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@xabbuhxabbuh added the Waiting Code MergeDocs for features pending to be merged labelMay 18, 2018
Copy link
ContributorAuthor

@srozesroze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Will update when the envelope one is merged :)

~~~~~~~~~~~~~~

If something wrong happens (i.e. an exception is thrown) while handling your message,
the default behaviour is that your message will be "NACK" and requeued.
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not Acknowledge. Do you have any idea on how to phrase it differently? 🤷‍♂️


First, create your sender::

namespace App\MessageSender;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yep, why not 👍

the first failure, it will wait 10 seconds before trying it. After the 2nd failure,
it will wait 30 seconds. After the 3rd failure, it will wait a minute. If it still
fails, the message will be moved to a "dead queue" and you will have to manually
handle this message.
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

These are to be removed as retry wasn't merged in.

@javiereguiluz
Copy link
Member

Anyone with experience in Messenger is willing to do the final push required to finish this pull request? Thanks!

@llaakkkk
Copy link

Thank you very much for your pull request!

As part of the Symfony EU funded hackathon (https://symfony.com/blog/the-symfony-and-api-platform-hackathon-is-coming), we were able to assemble most of the core team and big contributors in one place. Our goal is to finish as many open issues and PRs as possible.

Your commits will not be lost and you will therefore get credit for your work. All that will happen is that your commits will be moved to a new PR where all remaining concerns will be addressed.

Without your work this would not have been possible. So thank you once again!

@sroze
Copy link
ContributorAuthor

Thank you@llaakkkk 🙌

@srozesroze closed thisApr 7, 2019
@srozesroze deleted the messenger-amqp-transport branchApril 7, 2019 08:13
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@weaverryanweaverryanweaverryan requested changes

+3 more reviewers

@ycerutoycerutoyceruto left review comments

@ogizanagiogizanagiogizanagi left review comments

@ktheragektheragektherage left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

MessengerStatus: Needs WorkWaiting Code MergeDocs for features pending to be merged

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

9 participants

@sroze@javiereguiluz@llaakkkk@weaverryan@yceruto@ogizanagi@ktherage@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp