Skip to content

Commit ee3f6bc

Browse files
committed
Merge branch '4.4'
* 4.4: [Mailer] Better explain the load-balancing options
2 parents 9814761 + 9a55536 commit ee3f6bc

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

components/mailer.rst

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,37 @@ binary. For third-party providers, refers to the following table:
9595
Sendgrid smtp://apikey:KEY@sendgrid n/a api://KEY@sendgrid
9696
==================== ================================== ================================== ================================
9797

98-
Failover Transport
99-
------------------
98+
Load Balancing
99+
--------------
100100

101-
You can create failover transport with the help of ``failover()`` keyword::
101+
Symfony's mailer supports `load balancing`_ so you can distribute the mailing
102+
workload across multiple transports. There are two main techniques to balance
103+
the load: failover and round-robin.
104+
105+
Failover Load Balancing
106+
~~~~~~~~~~~~~~~~~~~~~~~
107+
108+
A failover transport is configured with two or more transports and the
109+
``failover`` keyword::
102110

103111
$dsn = 'failover(api://id@postmark smtp://key@sendgrid)';
104112

105-
So if the first transport fails, the mailer will attempt to send through the
106-
second transport.
113+
The mailer will start using the first transport. If the sending fails, the
114+
mailer won't retry it with the other transports, but it will switch to the next
115+
transport automatically for the following deliveries.
107116

108-
Round Robin
109-
-----------
117+
Round-Robin Load Balancing
118+
~~~~~~~~~~~~~~~~~~~~~~~~~~
110119

111-
If you want to send emails by using multiple transports in a round-robin fashion,
112-
you can use the ``roundrobin()`` keyword with the transports::
120+
A round-robin transport is configured with two or more transports and the
121+
``roundrobin`` keyword::
113122

114123
$dsn = 'roundrobin(api://id@postmark smtp://key@sendgrid)'
115124

125+
The mailer will start using the first transport and if it fails, it will retry
126+
the same delivery with the next transports until one of them succeeds (or until
127+
all of them fail).
128+
116129
Sending emails asynchronously
117130
-----------------------------
118131

@@ -162,3 +175,5 @@ Learn More
162175

163176
To learn more about how to use the mailer component, refer to the
164177
:doc:`Symfony Framework Mailer documentation </mailer>`.
178+
179+
.. _`load balancing`: https://en.wikipedia.org/wiki/Load_balancing_(computing)

0 commit comments

Comments
 (0)