QueueClient.RegisterMessageHandler Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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(Func<T1,T2,TResult>) 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(Func<T1,T2,TResult>) is awaited on every time a new message is received by the receiver. |
RegisterMessageHandler(Func<Message,CancellationToken,Task>, MessageHandlerOptions)
- Source:
- QueueClient.cs
Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. This handler(Func<T1,T2,TResult>) 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
Public Sub RegisterMessageHandler (handler As Func(Of Message, CancellationToken, Task), messageHandlerOptions As MessageHandlerOptions)
Parameters
- handler
- Func<Message,CancellationToken,Task>
A Func<T1,T2,TResult> 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>)
- Source:
- QueueClient.cs
Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. This handler(Func<T1,T2,TResult>) 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
- Func<Message,CancellationToken,Task>
A Func<T1,T2,TResult> that processes messages.
- exceptionReceivedHandler
- Func<ExceptionReceivedEventArgs,Task>
A Func<T,TResult> 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.