EventBridge is a serverless service that uses events to connect application components together, making it easier for you to build scalable event-driven applications. It can be used to route events from sources such as home-grown applications, AWS services, and third-party software to consumer applications across organizations. EventBridge provides a simple and consistent way to ingest, filter, transform, and deliver events to build new applications quickly.
What is StreamNative Cloud?
StreamNative Cloud is a fully managed cloud-native messaging and event streaming service built on Apache Pulsar.
Why integrate StreamNative Cloud with Amazon EventBridge?
StreamNative Cloud and Amazon EventBridge have different ecosystems and capabilities.
Synchronizing StreamNative Cloud data to EventBridge can help teams quickly access the AWS ecosystem, such as Lambda function, API Gateway, etc. Likewise, synchronizing Amazon EventBridge data to StreamNative Cloud can take advantage of more features of the Pulsar ecosystem, such as functions, data order guarantees, and flexible publish and subscribe models.
To integrate StreamNative Cloud with Amazon EventBridge, there are two data flow directions:
StreamNative Cloud → EventBridge: Specify a topic in Pulsar, and whenever there is data in that topic, it is synchronized to an event bus in AWS EventBridge.
EventBridge → StreamNative Cloud: Specify an event bus in AWS EventBridge, and whenever there is data in that event bus, it is synchronized to a topic in Pulsar.
Here's how to implement each scenario.
StreamNative cloud data to AWS EventBridge.
This scenario can be implemented using a pulsar sink connector. StreamNative open-sourced the AWS EventBridge sink connector and has already integrated it into StreamNative Cloud. This connector can be used to easily send StreamNative Cloud messages to AWS EventBridge.
Create an AWS EventBridge sink connector on the StreamNative Cloud console.
Tutorial: AWS EventBridge data to StreamNative cloud.
Since AWS EventBridge does not provide a similar poll/receive interface, this means that we cannot provide source connectors for StreamNative Cloud. AWS EventBridge uses API destinations to send msg from EventBridge to the third-party app.
> Note: If you use native Pulsar without StreamNative Cloud, you can’t integrate EventBridge into Pulsar data flow. Because the native Pulsar REST API does not support configured JSON content, StreamNative Cloud REST API improves it.
1. Get StreamNative Cloud REST config information
To get StreamNative Cloud REST Config:
Log in to StreamNative Cloud.
In the left navigation pane, choose Pulsar Clients.
Select Rest API table.
Select a service account.
Select the authentication type, and use Oauth2 and DownloadKey. Extract type, client_id, client_secret, client_email, and issuer_url from this key.
Show Client configuration. Extract grant_type, audience, and get_token_url from this information.
Select a topic and get Producer messages curl cmd. Extract produce_message_url from this cmd.
2. Create a connection on AWS EventBridge API destinations
The first layer of data format is fixed (detail-type, detail, etc), and the user's data is in the detail field.
In general, detail-type should contain type information about detail, and you can deserialize the content of detail based on detail-type. It depends on how the source of your data is set.
Baodi is a platform engineer at StreamNative. He once worked in a fintech company for 5 years, mainly responsible for middleware development. His work focuses on event sourcing, domain-driven design, and real-time computing.