充当事件网格源的 Azure 事件中心Azure Event Hubs as an Event Grid source
本文提供事件中心事件的属性和架构。This article provides the properties and schema for event hubs events. 有关事件架构的简介,请参阅 Azure 事件网格事件架构。For an introduction to event schemas, see Azure Event Grid event schema.
可用事件类型Available event types
创建捕获文件时,事件中心发出 Microsoft.EventHub.CaptureFileCreated 事件类型。Event Hubs emits the Microsoft.EventHub.CaptureFileCreated event type when a capture file is created.
示例事件Example event
此示例事件显示捕获功能在存储文件时引发的事件中心事件的架构:This sample event shows the schema of an event hubs event raised when the capture feature stores a file:
[
{
"topic": "/subscriptions/<guid>/resourcegroups/rgDataMigrationSample/providers/Microsoft.EventHub/namespaces/tfdatamigratens",
"subject": "eventhubs/hubdatamigration",
"eventType": "Microsoft.EventHub.CaptureFileCreated",
"eventTime": "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"
},
"dataVersion": "",
"metadataVersion": "1"
}
]
事件属性Event properties
事件具有以下顶级数据:An event has the following top-level data:
属性Property | 类型Type | 说明Description |
---|---|---|
topic |
stringstring | 事件源的完整资源路径。Full resource path to the event source. 此字段不可写入。This field is not writeable. 事件网格提供此值。Event Grid provides this value. |
subject |
stringstring | 事件主题的发布者定义路径。Publisher-defined path to the event subject. |
eventType |
stringstring | 此事件源的一个注册事件类型。One of the registered event types for this event source. |
eventTime |
stringstring | 基于提供程序 UTC 时间的事件生成时间。The time the event is generated based on the provider's UTC time. |
id |
字符串string | 事件的唯一标识符。Unique identifier for the event. |
data |
objectobject | 事件中心事件数据。Event hub event data. |
dataVersion |
stringstring | 数据对象的架构版本。The schema version of the data object. 发布者定义架构版本。The publisher defines the schema version. |
metadataVersion |
stringstring | 事件元数据的架构版本。The schema version of the event metadata. 事件网格定义顶级属性的架构。Event Grid defines the schema of the top-level properties. 事件网格提供此值。Event Grid provides this value. |
数据对象具有以下属性:The data object has the following properties:
属性Property | 类型Type | 说明Description |
---|---|---|
fileUrl |
stringstring | 捕获文件的路径。The path to the capture file. |
fileType |
stringstring | 捕获文件的文件类型。The file type of the capture file. |
partitionId |
stringstring | 分片 ID。The shard ID. |
sizeInBytes |
integerinteger | 文件大小。The file size. |
eventCount |
integerinteger | 文件中的事件数。The number of events in the file. |
firstSequenceNumber |
integerinteger | 队列中的最小序列号。The smallest sequence number from the queue. |
lastSequenceNumber |
integerinteger | 队列中的最后一个序列号。The last sequence number from the queue. |
firstEnqueueTime |
stringstring | 队列中的第一个时间。The first time from the queue. |
lastEnqueueTime |
stringstring | 队列中的最后一个时间。The last time from the queue. |
教程和操作指南Tutorials and how-tos
标题Title | 说明Description |
---|---|
教程:将大数据流式传输到数据仓库Tutorial: stream big data into a data warehouse | 当事件中心创建捕获文件时,事件网格会将一个事件发送到函数应用。When Event Hubs creates a Capture file, Event Grid sends an event to a function app. 应用会检索捕获文件并将数据迁移到数据仓库。The app retrieves the Capture file and migrates data to a data warehouse. |
后续步骤Next steps
- 有关 Azure 事件网格的简介,请参阅什么是事件网格?For an introduction to Azure Event Grid, see What is Event Grid?
- 有关创建 Azure 事件网格订阅的详细信息,请参阅事件网格订阅架构。For more information about creating an Azure Event Grid subscription, see Event Grid subscription schema.
- 有关处理事件中心事件的信息,请参阅将大数据流式传输到数据仓库。For information about handling event hubs events, see Stream big data into a data warehouse.