This topic describes how to use EventBridge to route the conference status event of Cloud Conferencing to an HTTP gateway based on an event rule. This process shows how an event-driven architecture functions.
Prerequisites
- Activate EventBridge and grant permissions to a RAM user
- Activate Cloud Conferencing.
Background information
- Event-driven architecture: used to design and manage services. You can use this architecture to decouple services and improve the stability and flexibility of services. In an event-driven architecture, all business data can be mapped to events, and business events are classified into multiple event types based on business fields. For more information, see EDA.
- Cloud Conferencing: an open, reliable, and intelligent platform-based conference service
powered by years of technology and experience accumulation of Alibaba Group in the
field of video conferencing, leading AI technologies, and network node coverage across
the world. You can use the service to create simple conference collaboration applications
that are available across multiple terminals.
The following table describes the types of Cloud Conferencing events.
Event type Description Scenario Conference status Start or end events - A conference starts when the first conferee joins the conference. The following parameters are pushed: time, MeetingUUID, MeetingName, and action.
- A conference ends when the last conferee leaves the conference regardless of whether the conferee is intentional. The following parameters are pushed: time, MeetingUUID, MeetingName, and action.
Conferee status Conferee status events - A conferee joins a conference. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
- A conferee leaves a conference. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
Conferee operations Conferee operation events - A conferee is muted or unmuted. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
- A conferee turns on or off the speaker. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
- A conferee enables or disables the camera. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
- A conferee enables or disables screen sharing. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
Conference statistics Statistics publishing events The maximum number of concurrent requests is pushed once every day.
Note
Cloud Conferencing can be used as an event source only in the China (Hong Kong) and China (Hangzhou) regions.
Flow of Cloud Conferencing events
This section describes how to connect Cloud Conferencing to EventBridge.
Step 1: Create an event rule
Cloud Conferencing events are published to the default event bus. You do not need to create an event bus because EventBridge provides the default event bus. To create an event rule for the default event bus, perform the following steps:
- Log on to the EventBridge console.
- In the left-side navigation pane, click Event Buses.
- In the top navigation bar, select the region.
- On the Event Buses page, find the default event bus and click default.
- In the left-side navigation pane, click Event Rules.
- In the left-side navigation pane, click Event Rules. On the Event Rules page, click Create Rule.
- Complete the Create Rule wizard.
Step 2: Use an HTTP gateway to receive events
The following code provides an example on how to use an HTTP gateway to receive events:
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@SpringBootApplication
@Slf4j
public class EventProcessingApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@PostMapping("/eventBridge/processEvent")
@ResponseBody
public String receiveMessage(@RequestBody String data) {
log.info("receiveEvent");
log.info(data);
return "received";
}
}