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
We are excited to announce a new integration for Event Handler to work with AWS AppSync Events APIs. This utility provides a structured way to handle AppSync real-time events through dedicated handler methods, automatic routing, and flexible configuration options.
The new AppSyncEventsResolver is designed to streamline working with AWS AppSync real-time APIs by:
Handling publish and subscribe events with dedicated handler methods
Routing events automatically based on namespace and channel patterns
Supporting wildcard patterns for catch-all handlers
Controlling event aggregation for batch processing
Implementing graceful error handling
Handling publish events
You can register handlers for publish events using the OnPublish method and specifying a pattern for the namespace and channels. This is useful when you want to modify payload content, persist the message in a database, or apply business logic and conditionally filter messages out.
Handling subscribe events
You can use the OnSubscribe method to process subscription requests before allowing clients to connect to specific channels. This enables authorization checks and subscription filtering based on client context or payload attributes, as well as subscription tracking, for example:
Working with aggregated processing
You can use the OnPublishAggregate method to process multiple events together as a batch. This is useful when you need to optimize database operations, or want to have full control over how the messages are processed.
AppSync Events FAQs
Q: Can I handle different types of events from the same channel?
A: Yes, you can register different handlers for publish and subscribe events on the same channel.
Q: How does handler precedence work with wildcard patterns?
A: More specific patterns take precedence over wildcards. For example, /default/channel1 will be chosen over /default/, which will be chosen over /.
Q: What happens when an exception occurs in my handler?
A: With individual processing, the utility catches exceptions and includes them in the response for the specific event while still processing other events. You can also explicitly raise an UnauthorizedException exception to reject the entire request.
Q: Does the order of async event processing matter?
A: No, AppSync Events doesn't guarantee delivery order. As long as each response includes the original event ID, AppSync processes them correctly regardless of order.
Q: Can I process multiple events as a batch?
A: Yes, use OnPublishAggregate to receive all matching events as a batch. When doing so, you're responsible implementing the logic to process them and return a list of corresponding items.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
We are excited to announce a new integration for Event Handler to work with AWS AppSync Events APIs. This utility provides a structured way to handle AppSync real-time events through dedicated handler methods, automatic routing, and flexible configuration options.
New Event Handler for AppSync Events
Docs
The new
AppSyncEventsResolver
is designed to streamline working with AWS AppSync real-time APIs by:Handling publish events
You can register handlers for publish events using the
OnPublish
method and specifying a pattern for the namespace and channels. This is useful when you want to modify payload content, persist the message in a database, or apply business logic and conditionally filter messages out.Handling subscribe events
You can use the
OnSubscribe
method to process subscription requests before allowing clients to connect to specific channels. This enables authorization checks and subscription filtering based on client context or payload attributes, as well as subscription tracking, for example:Working with aggregated processing
You can use the
OnPublishAggregate
method to process multiple events together as a batch. This is useful when you need to optimize database operations, or want to have full control over how the messages are processed.AppSync Events FAQs
Q: Can I handle different types of events from the same channel?
A: Yes, you can register different handlers for publish and subscribe events on the same channel.
Q: How does handler precedence work with wildcard patterns?
A: More specific patterns take precedence over wildcards. For example,
/default/channel1
will be chosen over/default/
, which will be chosen over/
.Q: What happens when an exception occurs in my handler?
A: With individual processing, the utility catches exceptions and includes them in the response for the specific event while still processing other events. You can also explicitly raise an
UnauthorizedException
exception to reject the entire request.Q: Does the order of async event processing matter?
A: No, AppSync Events doesn't guarantee delivery order. As long as each response includes the original event ID, AppSync processes them correctly regardless of order.
Q: Can I process multiple events as a batch?
A: Yes, use
OnPublishAggregate
to receive all matching events as a batch. When doing so, you're responsible implementing the logic to process them and return a list of corresponding items.Changes
📜 Documentation updates
047452c
to23b6978
in /docs (chore(deps): bump squidfunk/mkdocs-material from047452c
to23b6978
in /docs #830) by @dependabot[bot]🔧 Maintenance
047452c
to23b6978
in /docs (chore(deps): bump squidfunk/mkdocs-material from047452c
to23b6978
in /docs #830) by @dependabot[bot]This release was made possible by the following contributors:
@dependabot[bot], @hjgraca, Release bot and dependabot[bot]
This discussion was created from the release 1.50.
Beta Was this translation helpful? Give feedback.
All reactions