Compartilhar via

Azure Event Hubs 作为事件网格的源

本文提供事件中心事件的属性和架构。 有关事件架构的简介,请参阅Azure Event Grid事件架构

可用事件类型

创建捕获文件时,事件中心会发出 Microsoft.EventHub.CaptureFileCreated 事件类型。

示例事件

此示例事件显示捕获功能存储文件时引发的事件中心事件的架构:

[
    {
        "source": "/subscriptions/<guid>/resourcegroups/rgDataMigrationSample/providers/Microsoft.EventHub/namespaces/tfdatamigratens",
        "subject": "eventhubs/hubdatamigration",
        "type": "Microsoft.EventHub.CaptureFileCreated",
        "time": "2017-08-31T19:12:46.0498024Z",
        "id": "14e87d03-6fbf-4bb2-9a21-92bd1281f247",
        "data": {
            "fileUrl": "https://tf0831datamigrate.blob.core.chinacloudapi.cn/windturbinecapture/tfdatamigratens/hubdatamigration/1/2017/08/31/19/11/45.avro",
            "fileType": "AzureBlockBlob",
            "partitionId": "1",
            "sizeInBytes": 249168,
            "eventCount": 1500,
            "firstSequenceNumber": 2400,
            "lastSequenceNumber": 3899,
            "firstEnqueueTime": "2017-08-31T19:12:14.674Z",
            "lastEnqueueTime": "2017-08-31T19:12:44.309Z"
        },
        "specversion": "1.0"
    }
]

事件属性

事件具有以下顶层数据:

财产 类型 说明
source 字符串 事件源的完整资源路径。 此字段不可写。 事件网格提供此值。
subject 字符串 由发布者定义的事件主题路径。
type 字符串 此事件源的已注册事件类型之一。
time 字符串 事件生成的时间是基于提供者的 UTC 时间。
id 字符串 事件的唯一标识符。
data 对象 事件中心的事件数据
specversion 字符串 CloudEvents 架构规范版本。

数据对象具有以下属性:

财产 类型 说明
fileUrl 字符串 捕获文件的路径。
fileType 字符串 捕获文件的文件类型。
partitionId 字符串 分片 ID。
sizeInBytes 整数 文件大小。
eventCount 整数 文件中的事件数。
firstSequenceNumber 整数 队列中的最小序列号。
lastSequenceNumber 整数 队列中的最后一个序列号。
firstEnqueueTime 字符串 第一次从队列中获取。
lastEnqueueTime 字符串 队列中的最后一次。

教程与操作方法

标题 说明
教程:将大数据流式传输到数据仓库 当事件中心创建捕获文件时,事件网格会将事件发送到函数应用。 应用检索捕获文件并将数据迁移到数据仓库。

后续步骤