EventGridReceiverClient class

Event Grid Namespaces Client

Constructors

EventGridReceiverClient(string, AzureKeyCredential | TokenCredential, string, string, EventGridReceiverClientOptions)

Azure Messaging EventGrid Client

Methods

acknowledgeEvents(string[], AcknowledgeEventsOptions)

Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully acknowledged. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer.

receiveEvents<T>(ReceiveEventsOptions)

Receive Batch of Cloud Events from the Event Subscription.

rejectEvents(string[], RejectEventsOptions)

Reject batch of Cloud Events.

releaseEvents(string[], ReleaseEventsOptions)

Release batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully released. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information.

renewEventLocks(string[], RenewEventLocksOptions)

Renew lock for batch of Cloud Events.

Constructor Details

EventGridReceiverClient(string, AzureKeyCredential | TokenCredential, string, string, EventGridReceiverClientOptions)

Azure Messaging EventGrid Client

new EventGridReceiverClient(endpoint: string, credential: AzureKeyCredential | TokenCredential, topicName: string, subscriptionName: string, options?: EventGridReceiverClientOptions)

Parameters

endpoint

string

topicName

string

subscriptionName

string

Method Details

acknowledgeEvents(string[], AcknowledgeEventsOptions)

Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully acknowledged. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer.

function acknowledgeEvents(lockTokens: string[], options?: AcknowledgeEventsOptions): Promise<AcknowledgeResult>

Parameters

lockTokens

string[]

Lock Tokens

options
AcknowledgeEventsOptions

Options to Acknowledge

Returns

receiveEvents<T>(ReceiveEventsOptions)

Receive Batch of Cloud Events from the Event Subscription.

function receiveEvents<T>(options?: ReceiveEventsOptions): Promise<ReceiveResult<T>>

Parameters

options
ReceiveEventsOptions

Options to receive

Returns

Promise<ReceiveResult<T>>

rejectEvents(string[], RejectEventsOptions)

Reject batch of Cloud Events.

function rejectEvents(lockTokens: string[], options?: RejectEventsOptions): Promise<RejectResult>

Parameters

lockTokens

string[]

Lock Tokens

options
RejectEventsOptions

Options to reject

Returns

Promise<RejectResult>

releaseEvents(string[], ReleaseEventsOptions)

Release batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully released. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information.

function releaseEvents(lockTokens: string[], options?: ReleaseEventsOptions): Promise<ReleaseResult>

Parameters

lockTokens

string[]

Lock Tokens

options
ReleaseEventsOptions

Options to release

Returns

Promise<ReleaseResult>

renewEventLocks(string[], RenewEventLocksOptions)

Renew lock for batch of Cloud Events.

function renewEventLocks(lockTokens: string[], options?: RenewEventLocksOptions): Promise<RenewLocksResult>

Parameters

lockTokens

string[]

Lock Tokens

options
RenewEventLocksOptions

Options to renew

Returns

Promise<RenewLocksResult>