This topic describes how to use EventBridge to route the start or end event of Cloud Video Conferencing to an HTTP gateway based on an event rule. This process shows how an event-driven architecture functions.

Prerequisites

Before you begin, make sure that the following operations are complete:

Background information

  • Event-driven architecture: used to design and manage services. This architecture allows you to decouple service modules with ease. This architecture also improves the stability and flexibility of services. All business data can be mapped to events. All business events are classified into multiple types of events based on business fields. For more information, see EDA.
  • Cloud Video Conferencing: an open, reliable, and intelligent conference platform as a service (PaaS). Cloud Video Conferencing allows you to create conference collaboration applications with ease. These benefits are all based on 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.

    The following table describes the types of Cloud Video Conferencing events.

    Event type Description Scenario
    aliyuncvc:MeetingEvent:MeetingStateEvent Start or end events
    • A conference starts when the first member joins the conference. The following parameters are pushed: time, MeetingUUID, MeetingName, and action.
    • A conference ends when the last member leaves the conference regardless of whether the member is intentional. The following parameters are pushed: time, MeetingUUID, MeetingName, and action.
    aliyuncvc:MeetingEvent:MemberStateEvent Member status events
    • A member joins a conference. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
    • A member leaves a conference. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
    aliyuncvc:MeetingEvent:MemberOperate Member operation events
    • A member is muted or unmuted. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
    • A member turns on or off the speaker. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
    • A member enables or disables the camera. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
    • A member enables or disables screen sharing. The following parameters are pushed: time, MeetingUUID, MeetingName, userID, groupId, and action.
    aliyuncvc:MeetingEvent:MeetingStatistic Statistics publishing events The maximum number of concurrent requests is pushed once every day.

Usage notes

Cloud Video Conferencing can be used as an event source only in the China (Hong Kong) and China (Hangzhou) regions.

Flow of Cloud Video Conferencing events

This section describes how to connect Cloud Video Conferencing to EventBridge.

cvcflow

Step 1: Create an event rule

Cloud Video Conferencing events are published to the system event bus. EventBridge provides the system event bus. You do not need to create an event bus. You can perform the following steps to create an event rule for the system event bus:

  1. Log on to the EventBridge console.
  2. In the left-side navigation pane, choose Event-driven Operations > Event Rules.
  3. In the top navigation bar, select a region.
  4. On the Event Rules page, select System Event Bus from the Event Bus drop-down list and click Create Rule.
  5. On the Create Rule page, perform the following steps:
    1. In the Configure Basic Info step, enter MyRule in the Name field and Route the start or end event of Cloud Video 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 Alibaba Cloud Video 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://api.xtingke.com/eventBridge/processEvent.
      • Body: Click Complete Event.
      Notice The event target 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";
    }
}