Apply suggestions from code review

Co-authored-by: David Pine <david.pine@microsoft.com>
This commit is contained in:
Sumit Ghosh 2021-10-20 17:42:06 +05:30 committed by GitHub
parent fcd42510ff
commit 488fd63db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,15 +121,15 @@ public class EventBusServiceBus : IEventBus
var messageData = Encoding.UTF8.GetString(message.Body); var messageData = Encoding.UTF8.GetString(message.Body);
// Complete the message so that it is not received again. // Complete the message so that it is not received again.
if (await ProcessEvent(eventName, messageData)) if (await ProcessEventAsync(eventName, messageData))
{ {
await _serviceBusPersisterConnection.SubscriptionClient.CompleteAsync(message.SystemProperties.LockToken); await _serviceBusPersisterConnection.SubscriptionClient.CompleteAsync(message.SystemProperties.LockToken);
} }
}, },
new MessageHandlerOptions(ExceptionReceivedHandler) { MaxConcurrentCalls = 10, AutoComplete = false }); new MessageHandlerOptions(ExceptionReceivedHandlerAsync) { MaxConcurrentCalls = 10, AutoComplete = false });
} }
private Task ExceptionReceivedHandler(ExceptionReceivedEventArgs exceptionReceivedEventArgs) private Task ExceptionReceivedHandlerAsync(ExceptionReceivedEventArgs exceptionReceivedEventArgs)
{ {
var ex = exceptionReceivedEventArgs.Exception; var ex = exceptionReceivedEventArgs.Exception;
var context = exceptionReceivedEventArgs.ExceptionReceivedContext; var context = exceptionReceivedEventArgs.ExceptionReceivedContext;