You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/event_handler/appsync_events.md
+30-23
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,8 @@ stateDiagram-v2
41
41
* Easily handle publish and subscribe events with dedicated handler methods
42
42
* Automatic routing based on namespace and channel patterns
43
43
* Support for wildcard patterns to create catch-all handlers
44
-
* Process events in parallel corontrol aggregation for batch processing
44
+
* Support for async functions
45
+
* Aggregation for batch processing
45
46
* Graceful error handling for individual events
46
47
47
48
## Terminology
@@ -59,6 +60,12 @@ It handles connection management, message broadcasting, authentication, and moni
59
60
60
61
You must have an existing AppSync Events API with real-time capabilities enabled and IAM permissions to invoke your Lambda function. That said, there are no additional permissions required to use Event Handler as routing requires no dependency (_standard library_).
AppSync Events uses a specific event format for Lambda requests and responses. In most scenarios, Powertools for AWS simplifies this interaction by automatically formatting resolver returns to match the expected AppSync response structure.
@@ -102,12 +109,16 @@ When processing events with Lambda, you can return errors to AppSync in three wa
102
109
103
110
You can define your handlers for different event types using the `app.on_publish()`, `app.async_on_publish()`, and `app.on_subscribe()` methods.
104
111
112
+
By default, the resolver processes messages individually. For batch processing, see the [Aggregated Processing](#aggregated-processing) section.
1. The `payload` argument is mandatory and will be passed as a list of dictionary.
174
+
162
175
### Handling errors
163
176
164
177
You can filter or reject events by raising exceptions in your resolvers or by formatting the payload according to the expected response structure. This instructs AppSync not to propagate that specific message, so subscribers will not receive it.
@@ -191,22 +204,22 @@ When processing batch of items with `aggregate=True`, you must format the payloa
If instead you want to fail the entire batch, you can throw an exception. This will cause the Event Handler to return an error response to AppSync and fail the entire batch.
0 commit comments