本文提供事件中心事件的属性和架构。 有关事件架构的简介,请参阅 Azure 事件网格事件架构。
可用事件类型
创建捕获文件时,事件中心发出 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 | string | 事件源的完整资源路径。 此字段不可写入。 事件网格提供此值。 | 
| subject | string | 事件主题的发布者定义路径。 | 
| type | string | 此事件源的一个注册事件类型。 | 
| time | string | 基于提供程序 UTC 时间的事件生成时间。 | 
| id | string | 事件的唯一标识符。 | 
| data | object | 事件中心事件数据。 | 
| specversion | 字符串 | CloudEvents 架构规范版本。 | 
数据对象具有以下属性:
| 属性 | 类型 | 说明 | 
|---|---|---|
| fileUrl | string | 捕获文件的路径。 | 
| fileType | string | 捕获文件的文件类型。 | 
| partitionId | string | 分片 ID。 | 
| sizeInBytes | integer | 文件大小。 | 
| eventCount | integer | 文件中的事件数。 | 
| firstSequenceNumber | integer | 队列中的最小序列号。 | 
| lastSequenceNumber | integer | 队列中的最后一个序列号。 | 
| firstEnqueueTime | string | 队列中的第一个时间。 | 
| lastEnqueueTime | string | 队列中的最后一个时间。 | 
教程和操作指南
| 标题 | 说明 | 
|---|---|
| 教程:将大数据流式传输到数据仓库 | 当事件中心创建捕获文件时,事件网格会将一个事件发送到函数应用。 应用会检索捕获文件并将数据迁移到数据仓库。 | 
后续步骤
- 有关 Azure 事件网格的简介,请参阅什么是事件网格?
- 有关创建 Azure 事件网格订阅的详细信息,请参阅事件网格订阅架构。
- 有关处理事件中心事件的信息,请参阅将大数据流式传输到数据仓库。