Build a SaaS application integration solution based on EventBridge
Introduction
Event Driven Architecture (EDA) is an asynchronous architecture design model that decouples different systems based on events. In EDA, the event driven running process naturally divides the business semantics of each system, allowing users to flexibly customize events and their responses based on their needs. This makes it easy to build highly scalable applications based on EDA architecture. According to a research report by Daitan Group, as early as 2017, companies such as UBER, Deliveroo, Monzo, etc. had already adopted EDA to design their systems.
In order to make it easier for users to develop applications based on EDA architecture, Alibaba Cloud officially launched EventBridge at the 2020 Yunqi Conference. EventBridge is a serverless event bus service that can route events between applications using the standardized CloudEvents 1.0 protocol. At present, EventBridge has integrated numerous mature Alibaba Cloud products, allowing users to connect various Alibaba Cloud products and applications with low or even zero code, easily and efficiently building a distributed event driven architecture.
Event sources are the cornerstone of event driven development, and how to obtain more event sources is also a direction that EventBridge has been exploring and trying to explore. For Saas services from other cloud vendors and vertical fields in the market, EventBridge has released the HTTP Source capability, providing simple and easy to integrate third-party event push, helping customers achieve more efficient and convenient business cloud implementation.
HTTP Source Overview
There are various scenarios for accessing EventBridge applications: user-defined applications, Alibaba Cloud services, other cloud vendor services, or other SaaS products.
For user-defined applications, users can use the official API interface of EventBridge, multilingual clients, and open source clients from the CloudEvents community to complete access.
For Alibaba Cloud's cloud products, EventBridge native support allows users to select the corresponding cloud product and its related trigger events in the default event bus.
For other cloud vendors and SaaS products, EventBridge also provides convenient access methods for users to integrate, and HTTP Source event source is a typical access method.
Specifically, the HTTP Source event source is one of the event sources supported by EventBridge, which exposes the HTTP request address for publishing events in the form of Webhooks. Users can configure the HTTP Source event source in scenarios with URL callbacks, or directly use the simplest HTTP client to complete event publishing. The HTTP Source event source provides Webhook URLs that support different request methods and network environments such as HTTP and HTTPS, public network and Alibaba Cloud VPC, making it easy for users to integrate them into various applications. When accessing, there is no need to use a client, just ensure that the application can access the corresponding Webhook URL, which makes the access process simple and efficient.
When converting HTTP requests into CloudEvent, EventBridge will place the header and message body of the request in the CloudEvent field, and the remaining fields will be filled in based on the user's EventBridge resource properties and system default rules. Users can filter and extract the required content in the event rules, and finally assemble the required message content according to the template and deliver it to the event target.
The HTTP Source event source currently supports three types of security settings, namely request method, source IP, and request source domain name.
Request Method: Users can configure the valid HTTP request method for the current request to this event source. If the method type does not meet the configuration rules, the request will be filtered and will not be delivered to the event bus.
Source IP: Users can set a valid source IP (supporting IP segments and IPs) that allows access to this event source. When the request source IP is not within the set range, the request will be filtered and will not be delivered to the event bus.
Request Source Domain Name: Referer field of HTTP request. When the request's referer does not match the user configuration, the request is filtered and will not be delivered to the event bus.
Here's how to use HTTP Source to build the best practices for SaaS application integration, helping everyone quickly get started with SaaS integration solutions.
SaaS Integration Best Practices
Pin monitoring GitHub code push event
GitHub provides Webhook functionality, and the code repository can assist users in completing specific functions through callbacks when certain specific operations (push, fork, etc.) occur. For projects developed by multiple people, pushing GitHub events to specific nail groups can help members effectively monitor code changes and improve collaboration efficiency.
In this section, we demonstrate the best practices for monitoring GitHub code push events through pinning, mainly including the following steps:
Create a nail robot;
Create EventBridge related resources: event bus, event source (HTTP Source type), event rules, and event target (pin);
Create a custom event bus;
Select the GitHub code repository to create a Webhook;
Push code changes to the GitHub code repository;
The nail group receives information related to this code push.
1) Creating a Nail Robot
Refer to the official document of DingTalk [1] to create a group robot. When creating a group of robots, please check "Add Signature" for security settings and keep the key and the Webhook address of the robot generated later.
2) Create EventBridge related resources
Creating an EventBus event bus
Create an event source. After configuring the event source, click Skip. We will then specifically configure the event rules and targets.
After the creation is completed, enter the event source details page and save the Webhook URL that was just generated.
Click on the EventBridge console page to enter the newly created EventBus details page, and select "Create Rule" in the left column for "Event Rules".
Create a time goal. Select the nail and fill in the Webhook address and key of the nail robot. The push content side can be designed according to needs.
We fill in the template variable as:
{"repo":"$.data.body.repository.full_name","branch":"$.data.body.ref","pusher":"$.data.body.pusher.name"}
The template is:
{"msgtype": "text","text": {"content": "Github push event is triggered. repository: ${repo}, git reference: ${branch}, pusher: ${pusher}." } }
3) Creating Webhooks in the GitHub code repository
Log in to GitHub, select "Webhooks" on the left in the GitHub code repository "settings", and select "New Webhook".
Fill in the Webhook address of the HTTP Source event source in the configuration item for creating a Webhook, select "application/JSON" in the Content type section, select "Just the push event." below the trigger event type, and then click "Add Webhook" to complete the creation.
4) Push code changes to the GitHub code repository
Make certain changes to the local warehouse, commit and push GitHub.
5) The nail group receives relevant information about this code push
Asynchronous consumption monitoring alarm information
There are scenarios where asynchronous consumption of alarm information exists in the business, such as backup of alarm content, adaptive adjustment of alarm thresholds based on alarm frequency, etc. And for users of multi cloud services, how to integrate alarm information across cloud services is also a troublesome issue. By relying on HTTP Source, users can integrate different cloud vendors and monitoring products into the EventBridge platform to facilitate asynchronous consumption of alarm information.
In this section, we introduce how to use EventBridge to integrate Grafana and achieve asynchronous consumption monitoring alarm information. Grafana is an open source data visualization tool, which also has the function of monitoring and alarming. For specific use, please refer to the official document of Grafana [2]. This section mainly includes the following steps:
Create MNS queue;
Create EventBridge related resources;
• Configure Webhook on Grafana;
• Test reception results.
Create MNS queue
In the MNS console, select 'Queue List - Create Queue'.
Create EventBridge related resources
As mentioned earlier, here we only provide examples of the relevant configurations when creating event targets.
Configuring Webhook on Grafana
Click on "Alerting Notification channels" on the left side of the Grafana console and select "Add channel".
Select "Webhook" in the "type" column, fill in the Webhook address of the HTTP Source event source in the URL, and click "Test" below.
Test reception results
Log in to the MNS console, enter the queue details page, click on "Send and Receive Messages" in the upper right corner of the page, and you can see that MNS has received the message just sent by Grafana.
Click on the corresponding message details to see the message content, indicating that the message has been successfully consumed.
Summary
This article focuses on the new feature of EventBridge: HTTP Source event source. As a serverless event bus service, EventBridge has integrated Alibaba Cloud product control link data and message product business data into the event source ecosystem, improving the convenience of cloud user business integration. The support of Open API and multilingual SDK provides convenience for customers to access EventBridge for their own business.
On this basis, the HTTP Source event source goes further and opens up integration capabilities for other cloud vendors and SaaS applications in the form of Webhook. No code changes are required, and EventBridge integration operations can be completed with simple configuration.
Event Driven Architecture (EDA) is an asynchronous architecture design model that decouples different systems based on events. In EDA, the event driven running process naturally divides the business semantics of each system, allowing users to flexibly customize events and their responses based on their needs. This makes it easy to build highly scalable applications based on EDA architecture. According to a research report by Daitan Group, as early as 2017, companies such as UBER, Deliveroo, Monzo, etc. had already adopted EDA to design their systems.
In order to make it easier for users to develop applications based on EDA architecture, Alibaba Cloud officially launched EventBridge at the 2020 Yunqi Conference. EventBridge is a serverless event bus service that can route events between applications using the standardized CloudEvents 1.0 protocol. At present, EventBridge has integrated numerous mature Alibaba Cloud products, allowing users to connect various Alibaba Cloud products and applications with low or even zero code, easily and efficiently building a distributed event driven architecture.
Event sources are the cornerstone of event driven development, and how to obtain more event sources is also a direction that EventBridge has been exploring and trying to explore. For Saas services from other cloud vendors and vertical fields in the market, EventBridge has released the HTTP Source capability, providing simple and easy to integrate third-party event push, helping customers achieve more efficient and convenient business cloud implementation.
HTTP Source Overview
There are various scenarios for accessing EventBridge applications: user-defined applications, Alibaba Cloud services, other cloud vendor services, or other SaaS products.
For user-defined applications, users can use the official API interface of EventBridge, multilingual clients, and open source clients from the CloudEvents community to complete access.
For Alibaba Cloud's cloud products, EventBridge native support allows users to select the corresponding cloud product and its related trigger events in the default event bus.
For other cloud vendors and SaaS products, EventBridge also provides convenient access methods for users to integrate, and HTTP Source event source is a typical access method.
Specifically, the HTTP Source event source is one of the event sources supported by EventBridge, which exposes the HTTP request address for publishing events in the form of Webhooks. Users can configure the HTTP Source event source in scenarios with URL callbacks, or directly use the simplest HTTP client to complete event publishing. The HTTP Source event source provides Webhook URLs that support different request methods and network environments such as HTTP and HTTPS, public network and Alibaba Cloud VPC, making it easy for users to integrate them into various applications. When accessing, there is no need to use a client, just ensure that the application can access the corresponding Webhook URL, which makes the access process simple and efficient.
When converting HTTP requests into CloudEvent, EventBridge will place the header and message body of the request in the CloudEvent field, and the remaining fields will be filled in based on the user's EventBridge resource properties and system default rules. Users can filter and extract the required content in the event rules, and finally assemble the required message content according to the template and deliver it to the event target.
The HTTP Source event source currently supports three types of security settings, namely request method, source IP, and request source domain name.
Request Method: Users can configure the valid HTTP request method for the current request to this event source. If the method type does not meet the configuration rules, the request will be filtered and will not be delivered to the event bus.
Source IP: Users can set a valid source IP (supporting IP segments and IPs) that allows access to this event source. When the request source IP is not within the set range, the request will be filtered and will not be delivered to the event bus.
Request Source Domain Name: Referer field of HTTP request. When the request's referer does not match the user configuration, the request is filtered and will not be delivered to the event bus.
Here's how to use HTTP Source to build the best practices for SaaS application integration, helping everyone quickly get started with SaaS integration solutions.
SaaS Integration Best Practices
Pin monitoring GitHub code push event
GitHub provides Webhook functionality, and the code repository can assist users in completing specific functions through callbacks when certain specific operations (push, fork, etc.) occur. For projects developed by multiple people, pushing GitHub events to specific nail groups can help members effectively monitor code changes and improve collaboration efficiency.
In this section, we demonstrate the best practices for monitoring GitHub code push events through pinning, mainly including the following steps:
Create a nail robot;
Create EventBridge related resources: event bus, event source (HTTP Source type), event rules, and event target (pin);
Create a custom event bus;
Select the GitHub code repository to create a Webhook;
Push code changes to the GitHub code repository;
The nail group receives information related to this code push.
1) Creating a Nail Robot
Refer to the official document of DingTalk [1] to create a group robot. When creating a group of robots, please check "Add Signature" for security settings and keep the key and the Webhook address of the robot generated later.
2) Create EventBridge related resources
Creating an EventBus event bus
Create an event source. After configuring the event source, click Skip. We will then specifically configure the event rules and targets.
After the creation is completed, enter the event source details page and save the Webhook URL that was just generated.
Click on the EventBridge console page to enter the newly created EventBus details page, and select "Create Rule" in the left column for "Event Rules".
Create a time goal. Select the nail and fill in the Webhook address and key of the nail robot. The push content side can be designed according to needs.
We fill in the template variable as:
{"repo":"$.data.body.repository.full_name","branch":"$.data.body.ref","pusher":"$.data.body.pusher.name"}
The template is:
{"msgtype": "text","text": {"content": "Github push event is triggered. repository: ${repo}, git reference: ${branch}, pusher: ${pusher}." } }
3) Creating Webhooks in the GitHub code repository
Log in to GitHub, select "Webhooks" on the left in the GitHub code repository "settings", and select "New Webhook".
Fill in the Webhook address of the HTTP Source event source in the configuration item for creating a Webhook, select "application/JSON" in the Content type section, select "Just the push event." below the trigger event type, and then click "Add Webhook" to complete the creation.
4) Push code changes to the GitHub code repository
Make certain changes to the local warehouse, commit and push GitHub.
5) The nail group receives relevant information about this code push
Asynchronous consumption monitoring alarm information
There are scenarios where asynchronous consumption of alarm information exists in the business, such as backup of alarm content, adaptive adjustment of alarm thresholds based on alarm frequency, etc. And for users of multi cloud services, how to integrate alarm information across cloud services is also a troublesome issue. By relying on HTTP Source, users can integrate different cloud vendors and monitoring products into the EventBridge platform to facilitate asynchronous consumption of alarm information.
In this section, we introduce how to use EventBridge to integrate Grafana and achieve asynchronous consumption monitoring alarm information. Grafana is an open source data visualization tool, which also has the function of monitoring and alarming. For specific use, please refer to the official document of Grafana [2]. This section mainly includes the following steps:
Create MNS queue;
Create EventBridge related resources;
• Configure Webhook on Grafana;
• Test reception results.
Create MNS queue
In the MNS console, select 'Queue List - Create Queue'.
Create EventBridge related resources
As mentioned earlier, here we only provide examples of the relevant configurations when creating event targets.
Configuring Webhook on Grafana
Click on "Alerting Notification channels" on the left side of the Grafana console and select "Add channel".
Select "Webhook" in the "type" column, fill in the Webhook address of the HTTP Source event source in the URL, and click "Test" below.
Test reception results
Log in to the MNS console, enter the queue details page, click on "Send and Receive Messages" in the upper right corner of the page, and you can see that MNS has received the message just sent by Grafana.
Click on the corresponding message details to see the message content, indicating that the message has been successfully consumed.
Summary
This article focuses on the new feature of EventBridge: HTTP Source event source. As a serverless event bus service, EventBridge has integrated Alibaba Cloud product control link data and message product business data into the event source ecosystem, improving the convenience of cloud user business integration. The support of Open API and multilingual SDK provides convenience for customers to access EventBridge for their own business.
On this basis, the HTTP Source event source goes further and opens up integration capabilities for other cloud vendors and SaaS applications in the form of Webhook. No code changes are required, and EventBridge integration operations can be completed with simple configuration.
Related Articles
-
A detailed explanation of Hadoop core architecture HDFS
Knowledge Base Team
-
What Does IOT Mean
Knowledge Base Team
-
6 Optional Technologies for Data Storage
Knowledge Base Team
-
What Is Blockchain Technology
Knowledge Base Team
Explore More Special Offers
-
Short Message Service(SMS) & Mail Service
50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00