Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] Updating messenger docs for 4.3 #11602

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

Merged
merged 1 commit into from
May 30, 2019

Conversation

weaverryan
Copy link
Member

@weaverryan weaverryan commented May 26, 2019

Hi!

This rewrites the docs for Messenger for 4.3. Code was tested as I wrote it, however, any reviews are warmly welcomed as there are many details.

Btw, I'm experimenting with a new (but not crazy) idea with the messenger docs, which is:

A) To mostly favor in big document, but still isolate bigger, more complex "how to" topics to other documents
B) To think critically about the top level (h2) and secondary level (h3) headlines and let that guide the docs. The reason is that these are what show up on the left sidebar of the docs (https://symfony.com/doc/4.1/messenger.html) and I think we should control what this looks like in a purposeful way. Here is the hierarchy for these new docs:

- Installation
- Creating a Message & Handler
- Dispatching the Message
- Transports: Async/Queued Messages
	- Routing Messages to a Transport
	- Doctrine Entities in Messages
	- Handling Messages Synchronously
	- creating your own transport [External]
- Consuming Messages (Running the Worker)
	- Deploying to Production
	- Prioritized Transports
        - Supervisor Configuration
- Retries & Failure
	- Avoiding Retry on an Error
	- Saving & Retrying Failed Messages
- Transport Configuration
	- amqp Transport
	- doctrine Transport
	- redis Transport
	- in-memory Transport
	- Serializing Messages
- Customizing Handlers
	- Manually Configuring the Handler
	- Handler Subscriber & Options
	- Sending Handlers to Different Transports
- Extending Messenger
	- Envelopes
	- Disabling default Middleware
	- Adding your own Middleware
	- Middleware for Doctrine
	- Events
- Multiple Buses, Command & Event Buses
- Learn More

Closes #11236
Closes #10281
Closes #10279
Closes #9662
Closes #9651
Closes #9639

@@ -0,0 +1,138 @@
How to Create Your own Messenger Transport
Copy link
Member Author

Choose a reason for hiding this comment

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

This document was extracted to its own doc, but is unchanged and still untested.

@weaverryan weaverryan changed the title [Messe]ger Updating messenger docs for 4.3 [Messenger Updating messenger docs for 4.3 May 26, 2019
@weaverryan weaverryan changed the title [Messenger Updating messenger docs for 4.3 [Messenger] Updating messenger docs for 4.3 May 26, 2019
Copy link
Contributor

@maxhelias maxhelias left a comment

Choose a reason for hiding this comment

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

I have some comments, but this is the first time I commented on a PR about the documentation. Be nice to me and tell me if I'm wrong 😅
And I really like this plan

@OskarStark OskarStark added this to the 4.3 milestone May 27, 2019
Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

Amazing work! Thanks a lot Ryan.

.. configuration-block::
Supervisor is a great tool to guarantee that your worker process(es) is
*always* running (even if it closes due to failure, hitting a message limit
or thanks to ``messenger:stop-workers``). You can install it on Ubuntu, for
Copy link
Member

Choose a reason for hiding this comment

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

We should mention Windows and macOS too, even adding some links to how to install Supervisor (or its alternatives, if they are compatible with Messenger too).

Copy link
Member

Choose a reason for hiding this comment

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

Usually, we do not show installation instructions of third party tools. We only link to their official installation guide

Copy link
Member Author

Choose a reason for hiding this comment

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

It's so simple to say apt-get install supervisor - I think it illustrates (without going into too much detail) how you install it on the most popular system. The realistic options are just to say "Install supervisor" and nothing else (because we don't want to link to or show every system's setup, obviously) or sudo apt-get install supervisor. The latter feels more practical to me

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, good point! I think the best way is linking to their docs and showing the apt install line (btw please suggest apt and not apt-get), that'll please everyone :)

Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

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

👍 great work!

My comments are mostly adding comments from Yaml to PHP and XML examples as well. It's now saved which tab you want to see, so we can no longer be sure that everyone sees the comments in Yaml.


================== =================================== =======
Option Description Default
================== =================================== =======
Copy link
Member

Choose a reason for hiding this comment

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

I think we should fix these outline lines to match the longest length of this column

Copy link
Member Author

Choose a reason for hiding this comment

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

I kind of did it on purpose :). These "simple" tables are meant to be easier to write - I think we should be a bit flexible on them.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I guess it's just me that goes "whaaaa" when seeing outlining like this :)

Co-Authored-By: Wouter J <[email protected]>
Co-Authored-By: Maxime Helias <[email protected]>
@weaverryan weaverryan merged commit 3e67080 into symfony:4.3 May 30, 2019
weaverryan added a commit that referenced this pull request May 30, 2019
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Updating messenger docs for 4.3

Hi!

This rewrites the docs for Messenger for 4.3. Code was tested as I wrote it, however, any reviews are warmly welcomed as there are many details.

Btw, I'm experimenting with a new (but not crazy) idea with the messenger docs, which is:

A) To mostly favor in big document, but still isolate bigger, more complex "how to" topics to other documents
B) To think critically about the top level (h2) and secondary level (h3) headlines and let that guide the docs. The reason is that these are what show up on the left sidebar of the docs (https://symfony.com/doc/4.1/messenger.html) and I think we should control what this looks like in a purposeful way. Here is the hierarchy for these new docs:

```
- Installation
- Creating a Message & Handler
- Dispatching the Message
- Transports: Async/Queued Messages
	- Routing Messages to a Transport
	- Doctrine Entities in Messages
	- Handling Messages Synchronously
	- creating your own transport [External]
- Consuming Messages (Running the Worker)
	- Deploying to Production
	- Prioritized Transports
        - Supervisor Configuration
- Retries & Failure
	- Avoiding Retry on an Error
	- Saving & Retrying Failed Messages
- Transport Configuration
	- amqp Transport
	- doctrine Transport
	- redis Transport
	- in-memory Transport
	- Serializing Messages
- Customizing Handlers
	- Manually Configuring the Handler
	- Handler Subscriber & Options
	- Sending Handlers to Different Transports
- Extending Messenger
	- Envelopes
	- Disabling default Middleware
	- Adding your own Middleware
	- Middleware for Doctrine
	- Events
- Multiple Buses, Command & Event Buses
- Learn More
```

Closes #11236
Closes #10281
Closes #10279
Closes #9662
Closes #9651
Closes #9639

Commits
-------

3e67080 Updating messenger docs for 4.3
@weaverryan weaverryan deleted the messenger-4.3 branch May 30, 2019 13:43
@Tobion
Copy link
Contributor

Tobion commented May 31, 2019

Nice work @weaverryan. I just added some comments while reading through it with pleasure.

javiereguiluz added a commit that referenced this pull request Jun 3, 2019
…(weaverryan)

This PR was merged into the 4.3 branch.

Discussion
----------

Tweaks to messenger docs based on feedback from @Tobion

See @Tobion's review: #11602 (review) - it contains some good stuff.

Commits
-------

5d561fb tweaks to messenger docs based on feedback from @Tobion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants