[フレーム]
BT

InfoQ Software Architects' Newsletter

A monthly overview of things you need to know as an architect or aspiring architect.

View an example

We protect your privacy.

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Unlock the full InfoQ experience

Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources.

Log In
or

Don't have an InfoQ account?

Register
  • Stay updated on topics and peers that matter to youReceive instant alerts on the latest insights and trends.
  • Quickly access free resources for continuous learningMinibooks, videos with transcripts, and training materials.
  • Save articles and read at anytimeBookmark articles to read whenever youre ready.

Topics

Choose your language

InfoQ Homepage News AWS AppSync Events Adds Direct WebSocket Message Publishing

AWS AppSync Events Adds Direct WebSocket Message Publishing

This item in japanese

Mar 20, 2025 2 min read

Write for InfoQ

Feed your curiosity. Help 550k+ global
senior developers
each month stay ahead.
Get in touch
Listen to this article - 0:00
Audio ready to play
0:00
0:00

AWS recently introduced a new enhancement with direct message publishing over WebSocket connections for AWS AppSync Events, a fully-managed serverless WebSocket API service.

Earlier, the company released AWS AppSync Events, which allows developers to easily broadcast real-time event data to a few or millions of subscribers using secure and performant Serverless WebSocket APIs.

Darryl Ruggles, a cloud solutions architect and AWS Community Builder, tweeted on X:

Appsync Events came out a few months ago as a managed/serverless WebSocket API. There are other approaches to using WebSockets on AWS, but this works well for many cases. Now, support has been added for publishing messages directly over WebSocket connections.

Brice Pellé, a principal product manager at AWS, wrote in an announcement blog post:

This update allows developers to use a single WebSocket connection for both publishing and receiving events, streamlining the development of real-time features and reducing implementation complexity.

Developers gain flexibility by choosing between HTTP endpoints for backend publishing and WebSocket for web and mobile client applications. This enhancement will enable developers to build more responsive and engaging real-time applications, such as collaborative tools and live dashboards.

Developers can immediately test the new WebSocket publishing feature through the AppSync console's Pub/Sub Editor. Selecting "WebSocket" as the publishing method triggers a publish_success message upon successful transmission.

(Source: AWS Front-End Web & Mobile blog post)

AppSync introduces a new "publish" WebSocket operation. After establishing a WebSocket connection, clients can publish events to configured channel namespaces. The message format requires an id, channel, an array of events (up to five), and authorization headers. Each event within the array must be a valid JSON string.

AWS also offers tools for infrastructure management to further streamline the development process. The AWS Cloud Development Kit (CDK) is an infrastructure-as-code framework that simplifies the configuration and deployment of AppSync Event APIs, including channel namespaces and API keys. The CDK consists of the L2 constructs that provide a higher-level abstraction, making it easier for developers to define AppSync Event APIs and their associated channel namespaces using familiar programming languages.

Yoseph Radding, a software engineer, posted on Bluesky:

That’s essentially how AWS CDK works. They define all of these high order constructs (called L2 constructs) the provide great out of the box abstractions. Like the Lambda constructs will create the versions, functions, and IAM roles.

Lastly, publishing over WebSocket is available in all regions where AppSync is supported. The client limit is 25 requests per second per connection. The HTTP endpoint can still be used for higher rates.

About the Author

Steef-Jan Wiggers

Show moreShow less

Rate this Article

Adoption
Style

Related Content

The InfoQ Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.

BT

AltStyle によって変換されたページ (->オリジナル) /