All Products
Search
Document Center

DataWorks:Enable event message subscription

Last Updated:Jan 25, 2024

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 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 DataWorks Enterprise Edition users 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.

  • 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?

  • Extension point events are classified into tenant-level events and workspace-level events. You can select one of the preceding types of events when you register an extension. For information about the types of extension point events that are supported by DataWorks, see Supported extension point events.

EventBridge: Activate EventBridge and create a custom bus

  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.

    创建自定义总线

DataWorks: Add an event distribution channel

  1. Go to Open Platform.

  2. In the left-side navigation pane, click OpenEvent. The OpenEvent page appears.

  3. Optional. 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, follow the on-screen instructions 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 use an Alibaba Cloud account to attach the Aliyundataworksfullaccess policy to a RAM user?

  4. 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.

    Click Add event distribution channel. The Add event distribution channel dialog box appears. 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.

    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 and create a custom bus 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.

  5. 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:

For more information about how to create an event rule, see Overview.

EventBridge: Create an event target

After you configure the custom bus, you can create an event target in the EventBridge console. The event target is used to consume events. For more information, see Overview.

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?