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

The following operations are complete:

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.

cvcflow

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:

  1. Log on to the EventBridge console.
  2. In the left-side navigation pane, click Event Buses.
  3. In the top navigation bar, select a region.
  4. On the Event Buses page, find the default event bus and click default.
  5. In the left-side navigation pane, click Event Rules.
  6. In the left-side navigation pane, click Event Rules. On the Event Rules page, click Create Rule.
  7. Complete the Create Rule wizard.
    1. In the Configure Basic Info step, enter MyRule in the Name field and Route the conference status event of Cloud Conferencing to an HTTP gateway in the Description field, and click Next Step.
    2. In the Configure Event Pattern step, set the Event Source Type parameter to Alibaba Cloud Service Event Source, select acs.aliyuncvc Cloud Conferencing from the Event Source drop-down list and Meeting Status from the Event Type drop-down list, and then click Next Step.
    3. In the Configure Targets step, configure an event target. Then, click Create.
      • Service Type: Click HTTP.
      • URL: Enter http://example.com/eventBridge/processEvent.
      • Body: Click Complete Event.
      • Network Type: Click Internet.
      Notice The event targets that you want to configure for an event rule must reside in the same region as the event rule.

Step 2: Use an HTTP gateway to receive events

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 revieveMessage(@RequestBody String data) {
        log.info("revieveEvent");
        log.info(data);
        return "recieved";
    }
}