@@ -99,31 +99,36 @@ binary. For third-party providers, refers to the following table:
99
99
Sendgrid smtp://apikey:KEY@sendgrid n/a api://KEY@sendgrid
100
100
==================== ================================== ================================== ================================
101
101
102
- Failover Transport
103
- ------------------
102
+ Load Balancing
103
+ --------------
104
104
105
- You can create failover transport with the help of ``failover() `` keyword::
105
+ Symfony's mailer supports `load balancing `_ so you can distribute the mailing
106
+ workload across multiple transports. There are two main techniques to balance
107
+ the load: failover and round-robin.
106
108
107
- $dsn = 'failover(api://id@postmark smtp://key@sendgrid)';
109
+ Failover Load Balancing
110
+ ~~~~~~~~~~~~~~~~~~~~~~~
108
111
109
- So if the first transport fails, the mailer will attempt to send through the
110
- second transport.
112
+ A failover transport is configured with two or more transports and the
113
+ `` failover `` keyword::
111
114
112
- .. versionadded :: 4.4
115
+ $dsn = 'failover(api://id@postmark smtp://key@sendgrid)';
113
116
114
- The ``failover() `` keyword was introduced in Symfony 4.4.
117
+ The mailer will start using the first transport. If the sending fails, the
118
+ mailer won't retry it with the other transports, but it will switch to the next
119
+ transport automatically for the following deliveries.
115
120
116
- Round Robin
117
- -----------
121
+ Round- Robin Load Balancing
122
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
118
123
119
- If you want to send emails by using multiple transports in a round-robin fashion,
120
- you can use the ``roundrobin() `` keyword with the transports ::
124
+ A round-robin transport is configured with two or more transports and the
125
+ ``roundrobin `` keyword::
121
126
122
127
$dsn = 'roundrobin(api://id@postmark smtp://key@sendgrid)'
123
128
124
- .. versionadded :: 4.4
125
-
126
- The `` roundrobin() `` keyword was introduced in Symfony 4.4 .
129
+ The mailer will start using the first transport and if it fails, it will retry
130
+ the same delivery with the next transports until one of them succeeds (or until
131
+ all of them fail) .
127
132
128
133
Sending emails asynchronously
129
134
-----------------------------
@@ -174,3 +179,5 @@ Learn More
174
179
175
180
To learn more about how to use the mailer component, refer to the
176
181
:doc: `Symfony Framework Mailer documentation </mailer >`.
182
+
183
+ .. _`load balancing` : https://en.wikipedia.org/wiki/Load_balancing_(computing)
0 commit comments