Commit Graph

20 Commits

Author SHA1 Message Date
Mike Hillyer 164f109326 Traffic Shaping Refactor First Pass 2026-06-09 13:23:56 -04:00
Mike Hillyer ac67fdf71e Linter complaint 2025-05-22 14:39:40 -04:00
Mike Hillyer 168fb14e67 Correction. 2025-05-21 09:53:41 -04:00
Ryan Bonnell 6e39c91295 Edit words 2025-02-06 13:58:49 -07:00
Mike Hillyer 415b1736ed Add a note about throttles and webhooks. 2024-12-05 14:45:52 -05:00
Wez Furlong cf911c4067 docs: update dev -> 2024.11.08-d383b033 2024-11-12 12:25:53 -07:00
Laurent Marchaud 6142808730 fix a few typos in the docs
Signed-off-by: Laurent Marchaud <laurent@marchaud.com>
2024-10-24 12:10:53 -04:00
Wez Furlong 5e1ae20497 Add batching support for log hooks
This really is adding batching support to custom lua delivery
protocol handlers, but the main use case for these today is
to implement log hooks.

The way that it works is that you can specify a `batch_size`
as part of setting up the lua protocol handler.

Then, when it is time to send messages, if the batch_size is
the default of 1, the lua delivery logic will invoke the `send` method
on the connection object returned from the constructor.  This
is the same as the behavior from before this commit.

However, if the batch_size is greater than 1, then the lua delivery
logic will instead attempt to collect up to batch_size messages
that are immediately available from the ready queue, and then pass
those to a new `send_batch` method.

The send_batch method accepts an array of messages; that array will
always have at least one message, and up to batch_size messages,
depending on the throughput and queue size.

If the send_batch method's return value applies equally to all
messages in the batch, so if it indicates that something failed,
that disposition will apply to all messages.

One of the reasons that I'd avoided implementing batching thus far
was that it makes it awkward to resolve persistent/recurring issues
that are due to a single message in that batch.  If the batch is
always retried together then there is a good chance that it will
always fail together.

There's no explicit mitigation for that issue here, but it may
be probablistically mitigated by the jitter that is applied to
messages that transiently fail.  If a batch transiently fails,
each message in that batch will be subject to its own random
jitter which should cause an offending message to be retried
with a different subset of messages next time around.

The integration test included here demonstrates the batching
working with an http log hook implementation.
2024-09-16 18:14:25 -07:00
Wez Furlong c1565d2478 docs: forgot to format 2024-07-10 10:34:21 -07:00
Wez Furlong af103457a7 docs: remove low-level webhook example
There are subtle edge cases that are handled by the helper,
so I want everyone to use the helper in order to reduce potential
headaches for everyone.
2024-07-10 08:27:55 -07:00
Mike Hillyer 77f9830513 Fix warning in the webhooks page 2024-06-19 16:55:52 -04:00
Mike Hillyer 080b38d9ad Add a warning to the webhooks helper about proper positioning of the log hooks and queue helper calls. 2024-04-16 14:57:09 -04:00
Tom Mairs 5808ed4f46 reword trace-smtp-server title 2023-11-15 20:04:11 +00:00
Mike Hillyer b4a149a5f3 Add samples for webhooks to the example config, update webhooks docs page with helper info. 2023-11-14 18:18:47 -05:00
Wez Furlong 39a046e07c docs: add missing routing_domain param to get_queue_config event examples 2023-10-18 06:56:01 -07:00
Wez Furlong dc78142c35 docs: operation: tidy up formatting, show more kcli usage 2023-08-11 10:36:32 -07:00
Tom Mairs 9a0855f11b update for name field in log_hook 2023-07-13 18:06:20 +00:00
Mike Hillyer 297895e85d Adding AMQP to the User Guide. 2023-05-16 15:05:09 -04:00
Mike Hillyer 052bcaa454 Adding warning and pointer to the Secrets Load function. 2023-05-10 16:52:55 -04:00
Mike Hillyer bc970ab94e Move webhook chapter to Operations. 2023-05-10 13:45:45 -04:00