This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
This article builds on theWhat is Azure Event Grid? and on the Event Gridconcepts article to provide essential information before you start using Event Grid’s pull delivery over HTTP. It covers fundamental concepts, resource models, and message delivery modes supported. At the end of this document, you find useful links to articles that guide you on how to use Event Grid and to articles that offer in-depth conceptual information.
Note
This document helps you get started with Event Grid capabilities that use the HTTP protocol. This article is suitable for users who need to integrate applications on the cloud. If you require to communicate IoT device data, seeOverview of the MQTT Broker feature in Azure Event Grid.
Event Grid namespace topics accepts events that comply with the Cloud Native Computing Foundation (CNCF)’s open standardCloudEvents 1.0 specification using theHTTP protocol binding withJSON format.
For more information, seeCloudEvents support for more information.
The CloudEvents specification defines threecontent modes you can use:binary,structured, andbatched.
Important
With any content mode you can exchange text (JSON, text/*, etc.) or binary encoded event data. The binary content mode is not exclusively used for sending binary data.
The content modes aren't about the encoding you use, binary or text, but about how the event data and its metadata are described and exchanged. The structured content mode uses a single structure, for example, a JSON object, where both the context attributes and event data are together in the HTTP payload. The binary content mode separates context attributes, which are mapped to HTTP headers, and event data, which is the HTTP payload encoded according to the media type value inContent-Type.
For more information, seeCloudEvents content modes for more information.
A CloudEvent typically carries event data announcing an occurrence in a system, that is, a system state change. However, you could convey any kind of data when using CloudEvents. For example, you might want to use the CloudEvents exchange format to send a command message to request an action to a downstream application. Another example is when you're routing messages from Event Grid's MQTT broker to a topic. Under this scenario, you're routing an MQTT message wrapped up in a CloudEvents envelope.
With pull delivery, your application connects to Event Grid to read CloudEvents using queue-like semantics.
Pull delivery offers these event consumption benefits:
Consume events at your own pace, at scale or at an ingress rate your application supports.
Consume events at a time of your own choosing. For example, given business requirements, messages are processed at night.
Consume events over a private link so that your data uses private IP space.
Note
When receiving events or using operations that manage event state, an application specifies a namespace HTTP endpoint, a topic name, and the name of aqueue event subscription. A queue event subscription has itsdeliveryMode set to "queue". Queue event subscriptions are used to consume events using the pull delivery API. For more information about how to create these resources, see createnamespaces,topics, andevent subscriptions.
You use an event subscription to define the filtering criteria for events and in doing so, you effectively define the set of events that are available for consumption through that event subscription. One or more subscriber (consumer) applications can connect to the same namespace endpoint and use the same topic and event subscription.
Your application uses the following operations when working with pull delivery.
In some other occasions, your consumer application might want to release or reject events.
Your consumer applicationreleases a received event to signal Event Grid that it isn't ready to process that event and to make it available for redelivery. It does so by calling therelease operation with the lock tokens identifying the events to be returned back to Event Grid. Your application can control if the event should be released immediately or if a delay should be used before the event is available for redelivery.
You could opt toreject an event if there's a condition, possibly permanent, that prevents your consumer application to process the event. For example, a malformed message can be rejected as it can't be successfully parsed. Rejected events are dead-lettered, if a dead-letter destination is available. Otherwise, they're dropped.
When you invoke areceive,acknowledge,release,reject, orrenew lock operation, those actions are performed in the context of the event subscription. For example, if you acknowledge an event, that event is no longer available through the event subscription used when calling theacknowledge action. Other event subscription could still have the "same" event available. That is because an event subscription gets a copy of the events published. Those event copies are effectively distinct from each other across event subscriptions. Each event has its own state independent of other events.
Whendelivering events using pull delivery, Event Grid includes an array of objects that in turn includes theevent andbrokerProperties objects. The value of theevent property is the CloudEvent delivered in structured content mode. ThebrokerProperties object contains the lock token associated to the CloudEvent delivered. The following json object is a sample response from areceive operation that returns two events:
{ "value": [ { "brokerProperties": { "lockToken": "CiYKJDUwNjE4QTFFLUNDODQtNDZBQy1BN0Y4LUE5QkE3NjEwNzQxMxISChDXYS23Z+5Hq754VqQjxywE", "deliveryCount": 2 }, "event": { "specversion": "1.0", "id": "A234-1234-1235", "source": "/mycontext", "time": "2018-04-05T17:31:00Z", "type": "com.example.someeventtype", "data": "some data" } }, { "brokerProperties": { "lockToken": "CiYKJDUwNjE4QTFFLUNDODQtNDZBQy1BN0Y4LUE5QkE3NjEwNzQxMxISChDLeaL+nRJLNq3/5NXd/T0b", "deliveryCount": 1 }, "event": { "specversion": "1.0", "id": "B688-1234-1235", "source": "/mycontext", "type": "com.example.someeventtype", "time": "2018-04-05T17:31:00Z", "data": { "somekey" : "value", "someOtherKey" : 9 } } } ]}Event Grid supports push and pull event delivery using HTTP. Withpush delivery, you define a destination in an event subscription, a webhook, or an Azure service, to which Event Grid sends events. Withpull delivery, subscriber applications connect to Event Grid to consume events. Pull delivery is supported for topics in an Event Grid namespace.
Important
Event Hubs is supported as a destination for subscriptions to namespace topics. In coming releases, Event Grid Namespaces will support all destinations currently available in Event Grid Basic along with additional destinations.
The following are general guidelines to help you decide when to use pull or push delivery.
The following articles provide you with information on how to use Event Grid or provide you with additional information on concepts.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?