Azure Event Grid 네임스페이스 토픽에 대한 구독의 처리기 대상으로 Azure Event Hubs(미리 보기)
이벤트 처리기는 이벤트가 전송된 위치입니다. 처리기는 이벤트를 처리하는 작업을 수행합니다. 현재 Azure Event Hubs 는 네임스페이스 토픽에 대한 구독의 대상으로 지원되는 유일한 처리기입니다.
솔루션이 이벤트를 처리할 수 있는 것보다 더 빠르게 Event Grid에서 이벤트를 가져오는 경우 Event Hubs를 사용합니다. 이벤트가 이벤트 허브에 있으면 애플리케이션은 자체 일정에 따라 이벤트 허브에서 이벤트를 처리할 수 있습니다. 들어오는 이벤트를 처리하도록 이벤트 처리 규모를 확장할 수 있습니다.
Important
이 기능은 현재 미리 보기로 제공됩니다.
메시지 헤더
Event Hubs로 전송된 이벤트 또는 메시지의 헤더에서 받는 속성은 다음과 같습니다.
Property name | 설명 |
---|---|
aeg-subscription-name |
이벤트 구독의 이름입니다. |
aeg-delivery-count |
이벤트에 대한 시도 횟수입니다. |
aeg-output-event-id |
시스템 생성 이벤트 ID입니다. |
aeg-compatibility-mode-enabled |
이 속성은 Event Grid 네임스페이스를 통해 배달할 때만 사용할 수 있으며 설정됩니다. 현재 가능한 유일한 값은 false입니다. 이벤트 처리기가 Event Grid 네임스페이스를 통해 전달되는 이벤트와 Event Grid 사용자 지정 토픽/시스템 토픽/파트너 네임스페이스 등을 구분하는 데 도움이 됩니다. |
aeg-metadata-version |
이벤트의 메타데이터 버전입니다. 클라우드 이벤트 스키마의 사양 버전을 나타냅니다. |
REST 예제
시스템 할당 ID를 사용하여 Event Hubs를 이벤트 처리기로 사용하는 이벤트 구독
{
"properties": {
"deliveryConfiguration": {
"deliveryMode": "Push",
"push": {
"deliveryWithResourceIdentity": {
"identity": {
"type": "SystemAssigned"
},
"destination": {
"endpointType": "EventHub",
"properties": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/{resource-group}/providers/Microsoft.EventHub/namespaces/{namespace-name}/eventhubs/{eventhub-name}"
}
}
}
}
}
}
}
사용자 할당 ID를 사용하여 Event Hubs를 이벤트 처리기로 사용하는 이벤트 구독
{
"properties": {
"deliveryConfiguration": {
"deliveryMode": "Push",
"push": {
"deliveryWithResourceIdentity": {
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/{resource-group}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{user-identity-name}"
},
"destination": {
"endpointType": "EventHub",
"properties": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/{resource-group}/providers/Microsoft.EventHub/namespaces/{namespace-name}/eventhubs/{eventhub-name}"
}
}
}
}
}
}
}
Event Hubs 이벤트 처리기에 데드렛 대상을 구성한 이벤트 구독
{
"properties": {
"deliveryConfiguration": {
"deliveryMode": "Push",
"push": {
"deliveryWithResourceIdentity": {
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/{resource-group}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{user-identity-name}"
},
"destination": {
"endpointType": "EventHub",
"properties": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/{resource-group}/providers/Microsoft.EventHub/namespaces/{namespace-name}/eventhubs/{eventhub-name}"
}
}
},
"deadLetterDestinationWithResourceIdentity": {
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/{resource-group}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{user-identity-name}"
},
"deadLetterDestination": {
"endpointType": "StorageBlob",
"properties": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/{resource-group}/providers/Microsoft.Storage/storageAccounts/{storage-account-name}",
"blobContainerName": "{blob-container-name}"
}
}
}
}
}
}
}
Event Hubs 이벤트 처리기에 배달 속성이 구성된 이벤트 구독
{
"properties": {
"deliveryConfiguration": {
"deliveryMode": "Push",
"push": {
"deliveryWithResourceIdentity": {
"identity": {
"type": "SystemAssigned"
},
"destination": {
"endpointType": "EventHub",
"properties": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/{resource-group}/providers/Microsoft.EventHub/namespaces/{namespace-name}/eventhubs/{eventhub-name}",
"deliveryAttributeMappings": [
{
"name": "somestaticname",
"type": "Static",
"properties": {
"value": "somestaticvalue"
}
},
{
"name": "somedynamicname",
"type": "Dynamic",
"properties": {
"sourceField": "subject"
}
}
]
}
}
}
}
}
}
}
Event Hubs 특정 배달 속성
이벤트 구독을 사용하면 배달된 이벤트에 포함 되는 HTTP 헤더를 설정할 수 있습니다. 이 기능을 사용하면 대상에 필요한 사용자 지정 헤더를 설정할 수 있습니다. Azure Event Hubs로 배달되는 이벤트에 사용자 지정 헤더를 설정할 수 있습니다.
이벤트 허브 내 특정 파티션에 이벤트를 게시해야 하는 경우 이벤트 구독에서 PartitionKey
속성을 정의하여 대상 이벤트 허브 파티션을 식별하는 파티션 키를 지정합니다.
헤더 이름 | 헤더 형식 |
---|---|
PartitionKey |
정적 또는 동적 |
자세한 내용은 네임스페이스의 사용자 지정 배달 속성을 참조 하세요.
Azure Portal
이벤트 배달 모드가 푸시로 설정된 이벤트 구독을 만들 때 이벤트 처리기의 유형으로 Event Hubs를 선택하고 이벤트 허브를 처리기로 구성할 수 있습니다.
단계별 지침은 네임스페이스 토픽의 대상인 Event Hubs 사용을 참조 하세요.
Azure CLI
단계별 지침은 Event Hubs 대상 구성을 참조하세요.
다음 단계
- Event Grid 네임스페이스는 배달을 푸시합니다.