Trigger Delivery Policy Components
A Trigger Delivery Policy is composed of:
-
Name: a string of at most 127 characters, unique for each realm. Names starting with "?", "!", or "@" are reserved. This is a required component and uniquely identifies the policy in the realm.
-
Error handlers: a non-empty list of handlers. Each handler acts on groups of delivery errors and describes the strategy Data Orchestrator should take when they occur. In pseudo-BNF syntax, an handler is described by the following grammar:
handler ::= "{" "on" ":" "client_error" | "server_error" | "any_error" | [<int>] "," "strategy" ":" "discard" | "retry" "}"
There are two possible strategies: either discard the event or retry. If the strategy is retry, events will be requeued in the event queue. The default retry strategy is discarding events. The on field specifies the group of HTTP errors the handler refers to: client errors (400-499), server errors (500-599), all errors (400-599), or a custom range of error codes (e.g. [418, 419, 420]). Handlers can be at most 200 and must be not overlapping (i.e. there can not be two handlers which refer to at least one shared error code).
-
Maximum capacity: the maximum size of the event queue which refers to the policy. If the number of messages to be retried exceeds the event queue size, older events will be discarded.
-
Retry times: the maximum number of times an event in the event queue can be resent. A single policy does not allow to retry sending events for different amount of times, but different policies may have different numbers. This is optional, but required if the policy specifies at least one handler with retry strategy.
-
Event TTL: in order to further lower the space requirement of the event queue, events may be equipped with a TTL which specifies the amount of seconds an event is retained in the event queue. When an event expires, it is discarded from the event queue, even if it has not been delivered. This is optional.
-
Prefetch Count: defines the maximum number of unacknowledged event messages a consumer can hold in its local memory at any given time: if the maximum number of in-flight messages is reached the delivery of new messages will be paused. It acts as a backpressure mechanism protecting the consumers from having to handle too many messages concurrently. It is an optional field. When not set, it defaults to 1 to ensure ordered processing of messages. A value higher than 1 will increase throughput, but lose the ordering of events. Refer to RabbitMQ documentation of consumer prefetch count for more information.