QueueClient.RegisterMessageHandler Method

Definition

Overloads

RegisterMessageHandler(Func<Message,CancellationToken,Task>, MessageHandlerOptions)

Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. This handler(System.Func`3) is awaited on every time a new message is received by the receiver.

RegisterMessageHandler(Func<Message,CancellationToken,Task>, Func<ExceptionReceivedEventArgs,Task>)

Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. This handler(System.Func`3) is awaited on every time a new message is received by the receiver.

RegisterMessageHandler(Func<Message,CancellationToken,Task>, MessageHandlerOptions)

Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. This handler(System.Func`3) is awaited on every time a new message is received by the receiver.

public void RegisterMessageHandler (Func<Microsoft.Azure.ServiceBus.Message,System.Threading.CancellationToken,System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.MessageHandlerOptions messageHandlerOptions);
abstract member RegisterMessageHandler : Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Microsoft.Azure.ServiceBus.MessageHandlerOptions -> unit
override this.RegisterMessageHandler : Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Microsoft.Azure.ServiceBus.MessageHandlerOptions -> unit

Parameters

handler
System.Func<Message,System.Threading.CancellationToken,System.Threading.Tasks.Task>

A System.Func`3 that processes messages.

messageHandlerOptions
MessageHandlerOptions

The MessageHandlerOptions options used to configure the settings of the pump.

Implements

Remarks

Enable prefetch to speed up the receive rate.

Applies to

RegisterMessageHandler(Func<Message,CancellationToken,Task>, Func<ExceptionReceivedEventArgs,Task>)

Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. This handler(System.Func`3) is awaited on every time a new message is received by the receiver.

public void RegisterMessageHandler (Func<Microsoft.Azure.ServiceBus.Message,System.Threading.CancellationToken,System.Threading.Tasks.Task> handler, Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs,System.Threading.Tasks.Task> exceptionReceivedHandler);
abstract member RegisterMessageHandler : Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> -> unit
override this.RegisterMessageHandler : Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> -> unit
Public Sub RegisterMessageHandler (handler As Func(Of Message, CancellationToken, Task), exceptionReceivedHandler As Func(Of ExceptionReceivedEventArgs, Task))

Parameters

handler
System.Func<Message,System.Threading.CancellationToken,System.Threading.Tasks.Task>

A System.Func`3 that processes messages.

exceptionReceivedHandler
System.Func<ExceptionReceivedEventArgs,System.Threading.Tasks.Task>

A System.Func`2 that is invoked during exceptions. ExceptionReceivedEventArgs contains contextual information regarding the exception.

Implements

Remarks

Enable prefetch to speed up the receive rate. Use RegisterMessageHandler(Func<Message,CancellationToken,Task>, MessageHandlerOptions) to configure the settings of the pump.

Applies to