]> git.ipfire.org Git - thirdparty/haproxy.git/commit
EXAMPLES: mailqueue for lua mailers script
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 3 May 2023 17:12:53 +0000 (19:12 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 May 2023 14:28:32 +0000 (16:28 +0200)
commit4537ac115aa48b7cb35631c028b4f44d56278bdc
tree20d7b1ab85b4a85a320c1588090b20e61f861aec
parent86fb22c5572a709500cafe6876d251f0744d0184
EXAMPLES: mailqueue for lua mailers script

Lua mailers scripts now leverages Queue class to implement a mailqueue.

Thanks to the mailqueue, emails are still sent asynchronously, but with
respect to their generation order (better ordering consistency).

That is, previous script limitation (see below) is no longer true:
"
 Current known script limitation: if multiple events are generated
 simultaneously it is possible that emails could be received out of
 order since emails are sent asynchronously using smtp_send_email()
 and there is no sending queue. Relying on the email "date" should
 help to know which email was generated first..
"

For a given server, email-alerts will be sent in the same order as the
events were generated. However this does not apply to events between 2
distinct servers, since each server is tracked independently within
the lua script. (1 subscription per server, to make sure only relevant
servers x events are being tracked and prevent useless wakeups)
examples/lua/mailers.lua