The OpenEvent module of DataWorks Open Platform allows you to subscribe to and consume event messages by using EventBridge. After you create a custom bus in EventBridge, you must enable the event message subscription feature and configure an event distribution channel in DataWorks before you can create event rules and publish events in EventBridge. This topic describes how to enable the event message subscription feature in DataWorks and configure a custom bus in EventBridge.

Limits

  • The OpenEvent module is in public preview for users of DataWorks Enterprise Edition and DataWorks Ultimate Edition, and is available in the following regions: China (Beijing), China (Hangzhou), China (Shenzhen), China (Shanghai), China (Zhangjiakou), China (Chengdu), US (Silicon Valley), US (Virginia), Germany (Frankfurt), Japan (Tokyo), China (Hong Kong), and Singapore (Singapore).
  • The OpenEvent module allows you to use EventBridge to subscribe to and consume messages. Therefore, you must activate EventBridge. For more information, see What is EventBridge?.
  • Only an Alibaba Cloud account or a RAM user to which the AliyunDataWorksFullAccess policy is attached can be used to configure parameters to subscribe to and consume event messages in the DataWorks console. For more information about permission control by fine-grained RAM policies, see Custom RAM policies: fine-grained permission control for console operations.

EventBridge: Activate EventBridge

  1. Activate EventBridge. For more information, see Activate EventBridge and grant permissions to a RAM user.
  2. Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.
  3. In the upper-right corner of the page that appears, click Create in the Custom Event Buses section, skip the parameter configurations in the Event Source, Event Rule, and Event Target steps, and directly create a custom bus.
    Note You can skip the Event Source and Event Rule steps in the wizard when you create a custom bus that is used for event message subscription in DataWorks.
    Create Custom Event Bus panel

DataWorks: Enable event message subscription

Before you can subscribe to event messages, you must enable the event message subscription feature.

  1. Log on to the DataWorks console. In the left-side navigation pane, click Open Platform.
  2. On the Open Platform page, click the OpenEvent tab and then the Event subscription tab.
  3. On the Event subscription tab, turn on Enable Message Subscription.

DataWorks: Add an event distribution channel

  1. Authorize DataWorks to access your EventBridge resources.
    The first time you use EventBridge, the Click Authorization button is displayed in the Subscribe to events via EventBridge section on the Event subscription tab, and the Add event distribution channel button is dimmed. To use EventBridge, click Click Authorization to authorize DataWorks to access your EventBridge resources. After the authorization is complete, the service-linked role AliyunServiceRoleForDataWorksOpenPlatform appears on the Roles page under Identities in the RAM console. For more information about the service-linked role AliyunServiceRoleForDataWorksOpenPlatform, see View the permissions of the AliyunServiceRoleForDataWorksOpenPlatform role.
    Note Click Authorization is available only for an Alibaba Cloud account or a RAM user to which the AliyunDataWorksFullAccess policy is attached. For more information about how to attach the AliyunDataWorksFullAccess policy to a RAM user, see How do I grant the Aliyundataworksfullaccess permission to a RAM user by using the Alibaba Cloud account?.
  2. Add an event distribution channel.
    An event distribution channel allows you to distribute event messages that are generated in your workspace to a custom bus in EventBridge. Then, you can subscribe to and consume the event messages by using EventBridge. To add an event distribution channel, perform the following steps:
    1. Click Add event distribution channel. The Add event distribution channel dialog box appears.
    2. Select a workspace from the Workspace for Distribution of Event Messages drop-down list and select a custom bus from the Specify a custom bus to distribute to EventBridge drop-down list.
      Add event distribution channel dialog box
      Note If no custom bus is available, you can use one of the following methods to create a custom bus:
      • Click Create Custom Event Bus below the Specify a custom bus to distribute to EventBridge field. You are redirected to the EventBridge console where you can create a custom bus by performing the steps in the EventBridge: Activate EventBridge section in this topic.
      • Click Quickly Create Custom Event Bus with the Same Name as Your Workspace below the Specify a custom bus to distribute to EventBridge field. DataWorks directly creates a custom bus with the same name as your workspace.
    3. Click OK.

EventBridge: Create an event rule for the custom bus

Log on to the EventBridge console and configure an event rule for the custom bus. Take note of the following points when you configure the event rule:
  • In the event message:
    • data: the message body for an event. For more information about the message bodies for different types of events in DataWorks, see Appendix: Formats of event messages sent to EventBridge.
    • source: the identifier of the product in which an event occurred. In most cases, this parameter is set to acs.dataworks.
For more information about how to create an event rule, see Overview.

EventBridge: Publish an event

After you configure the custom bus, you can publish an event in the EventBridge console. You can publish an event to test the event rule that is configured in the custom bus. For more information about how to publish an event, see Publish an event.

DataWorks: Manage the event distribution channel

DataWorks allows you to manage the event distribution channel. For example, you can enable, disable, or remove the event distribution channel.

  • Enable: After the event distribution channel is enabled, the event messages that are generated in your workspace are pushed to the custom bus in EventBridge.
  • Disable: After the event distribution channel is disabled, the event messages that are generated in your workspace cannot be pushed to the custom bus in EventBridge. You cannot use EventBridge to receive the event messages.
  • Remove: After the event distribution channel is removed, the event messages that are generated in your workspace cannot be pushed to the custom bus in EventBridge. You cannot use EventBridge to receive the event messages.

What to do next

The OpenEvent module of DataWorks Open Platform uses EventBridge to distribute event messages. You can subscribe to event messages by using EventBridge. For more information about EventBridge, see What is EventBridge?.