All Products
Search
Document Center

EventBridge:Event transformation

Last Updated:Oct 21, 2024

The event transformation feature allows you to perform operations, such as splitting, mapping, and enriching, on events. Before you route events to a sink, you can use the event transformation feature to transform the events into the format that is accepted or required by the sink. For example, if you use ApsaraMQ for RocketMQ as the source and Simple Message Queue (formerly MNS) as the sink, you can use the event transformation feature to transform events from ApsaraMQ for RocketMQ into the format that is required by Simple Message Queue (formerly MNS).

Description

After an event is transformed, EventBridge does not impose limits on the returned data and processes the data based on whether the data is in the array format.

  • Non-array data: data that is not in the [***, ***] format. This type of data is sent to the sink without processing. For example, if the data returned by event transformation is "test", "test" is sent to the sink as a single data record.

  • Array data: data that is in the [***, ***] format. The processing methods for this type of data vary based on the sink type.

    • If the sink is a service other than Function Compute, such as Simple Message Queue (formerly MNS), ApsaraMQ for RocketMQ, and ApsaraMQ for Kafka, array data is split by default. In this case, data records in an array are sent to the sink one by one. For example, if the data returned by event transformation is ["test1", "test2"], "test1" and "test2" are separately sent to and received by the sink.

    • If the sink is Function Compute, array data is sent to the sink as a single data record by default. For example, if the data returned by event transformation is ["test1", "test2"], ["test1", "test2"] is sent to and received by the sink.