Skip to content

Commit 61ab5c6

Browse files
authored
CHA-1452 Event-Platform Update http subscription delivery policy (#1035)
1 parent 428ad1b commit 61ab5c6

File tree

2 files changed

+52
-7
lines changed

2 files changed

+52
-7
lines changed

content/event-platform/concepts.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,21 @@ The statuses for a subscription are:
5151

5252
## Subscription types
5353

54+
::: info
55+
We will consider adding other subscription destinations based on feedback. Please [fill-in this form](https://forms.gle/XsZ7rovRnqfAn4xF9) to propose & upvote new destination types.
56+
:::
57+
58+
5459
### Pub/Sub subscription
5560

61+
This is the **preferred and most resilient method** for consuming events. It leverages Google Cloud's managed messaging service.
62+
63+
#### Key Advantages
64+
65+
- **Managed Scalability & Reliability:** Google Pub/Sub inherently handles high throughput and traffic bursts, absorbing the complexities of scaling.
66+
- **Reduced Infrastructure Burden:** Significantly lowers the operational overhead and risk for the customer.
67+
- **Simplified Integration:** Easier setup and maintenance compared to managing a custom HTTP endpoint.
68+
5669
#### Configuration
5770

5871
For the `pubsub` subscription type, the `config` property needed when creating the subscription requires both the project ID and the topic ID.
@@ -90,6 +103,25 @@ For comprehensive details on managing subscriptions, consult the complete API re
90103

91104
### HTTPS subscription
92105

106+
This option pushes events directly to a HTTP endpoint. It offers flexibility but requires careful infrastructure planning.
107+
108+
#### Critical Requirements & Considerations
109+
110+
- **Strong Infrastructure:** The endpoint must be highly available and designed to handle variable event loads.
111+
- This also depends on the **source PIM's size and activity**. A small PIM with few SKUs won't generate the same volume as a large instance with many jobs. Thus, the **HTTP endpoint** can be adjusted based on the PIM's intended use.
112+
- **Mandatory Rate Limiting (HTTP 429):**
113+
- Our platform **dynamically adjusts its delivery rate from 1 to 100 events per second.**
114+
- This adaptive mechanism **relies entirely on the endpoint correctly returning an `HTTP 429 "Too Many Requests"` status** when its capacity is reached. [ref](https://api.akeneo.com/event-platform/key-platform-behaviors.html#optimized-throughput)
115+
116+
::: warning
117+
Endpoints without proper HTTP 429 handling are at high risk of being overwhelmed, leading to event loss and subscription suspension.
118+
:::
119+
120+
- **Fast Acknowledgement:** Endpoints must respond with an `HTTP 200 OK` within **5 seconds**. Delays trigger retries and can lead to suspension. [ref](https://api.akeneo.com/event-platform/key-platform-behaviors.html#delivery-timeout)
121+
- **Recommendation:** Implement an asynchronous processing model (e.g., using an internal queue) to acknowledge events quickly and process them separately.
122+
- **Suspension Policy:** Subscriptions may be suspended due to repeated errors (e.g., `4xx`/`5xx` status codes, timeouts, misconfigured SSL). [ref](https://api.akeneo.com/event-platform/key-platform-behaviors.html#suspension-policy)
123+
124+
93125
#### Configuration
94126

95127
For the `https` type, the `config` property requires:
@@ -177,6 +209,8 @@ We currently use a static IP address provided by Google Cloud: `34.140.80.128`
177209

178210
When configuring a subscription, you can optionally define a **filter** to receive **only the events that match specific criteria**.
179211

212+
**Regardless of the destination type, we strongly advise to utilize event filters.** This ensures you only subscribe to and receive events that are relevant to your specific integration needs.
213+
180214
You can find the list of currently available filters and the correct syntax to use [here](/event-platform/available-filters.html).
181215

182216
### Example

content/event-platform/key-platform-behaviors.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Key platform behaviors
32

43
Your subscribing service implementation and architecture must deal with the following capabilities and constraints to consume events from the platform at its best.
@@ -14,15 +13,27 @@ To help identify duplicated events and deal with un-ordered events if it's somet
1413

1514
## Optimized throughput
1615

17-
Our delivery engine will try to deliver events as fast as possible but will adapt the throughput within the limits described in this section.
16+
If your subscription has an HTTPS destination, our delivery engine adapts the event delivery rate based on your system's capacity, operating within these limits:
17+
18+
**Maximum rate:** `100` events per second
19+
20+
**Minimum rate:** `1` event per second
21+
22+
23+
The throughput automatically adjusts between these limits based on your endpoint's responses:
24+
- `200 OK`: The delivery rate gradually increases up to the maximum rate
25+
- `429 Too Many Requests`: The delivery rate decreases to prevent system overload
26+
27+
::: warning
28+
Events that are throttled and remain undelivered for more than one hour will negatively impact your success rate, as it indicates a potential queuing risk. This may trigger the [suspension policy](/event-platform/key-platform-behaviors.html#suspension-policy).
29+
:::
1830

19-
If your subscription has an HTTPS destination, please respond with `429 Too Many Requests` when your system is overloaded: this way, the delivery engine will slow down, retry undelivered events, and gradually increase the throughput when your system gets back to recovers (i.e., when it responds `200 OK` again).
31+
Consider using another [subscription type](/event-platform/concepts.html#subscription-types) to get around these limitations.
2032

21-
Please note that if the throughput drops too significantly, the suspension policy will be triggered ([see bellow](/event-platform/key-platform-behaviors.html#suspension-policy)).
2233

2334
## Delivery timeout
2435

25-
Specifically for the HTTPS destination type, the delivery timeout ensures that messages are processed within a specified time frame. Your endpoint is expected to handle requests within **`5 seconds`**. If processing exceeds this duration, the event will enter the retry process ([see bellow](/event-platform/concepts.html#retry-policy-for-transient-failures.html)).
36+
Specifically for the HTTPS destination type, the delivery timeout ensures that messages are processed within a specified time frame. Your endpoint is expected to handle requests within **`5 seconds`**. If processing exceeds this duration, the event will enter the retry process ([see bellow](/event-platform/concepts.html#retry-policy-for-transient-failures)).
2637

2738
Under normal circumstances, your HTTPS endpoint must handle the event as fast as possible.
2839
**Our recommendation** is to put the message in a `queuing system` or in a `database` for asynchronous processing.
@@ -53,12 +64,12 @@ Your subscription is immediately suspended if you meet one of these conditions:
5364

5465
### Threshold-Based Suspension:
5566

56-
This type of suspension is based on the success rate of your HTTPS endpoint. If the success rate drops below 95% within the last rolling hour, your subscription will be suspended.
67+
This type of suspension is based on the success rate of your HTTPS endpoint. If the success rate drops below 90% within the last rolling hour, your subscription will be suspended.
5768

5869
Here are the errors type that decrease the success rate:
5970

6071
- `5XX Server Error` HTTP statuses
61-
- `429 Too Many Requests` HTTP statuses (while the minimum rate threshold is exceeded)
72+
- `429 Too Many Requests` HTTP statuses (while the event remains undelivered for more than one hour)
6273
- `4xx Client Error Response` HTTP status
6374
- Delivery timeout
6475

0 commit comments

Comments
 (0)