Пример #1
0
        public static void ProcessMessage(Message message, ILogger log, EventWaitHandle waitHandle1, EventWaitHandle waitHandle2)
        {
            string messageString = ServiceBusSessionsTestHelper.GetStringMessage(message);

            log.LogInformation($"{messageString}-{message.SessionId}");

            if (messageString == "message5" && message.SessionId == "test-session1")
            {
                waitHandle1.Set();
            }

            if (messageString == "message5" && message.SessionId == "test-session2")
            {
                waitHandle2.Set();
            }
        }
Пример #2
0
 public override async Task CompleteProcessingMessageAsync(IMessageSession session, Message message, Executors.FunctionResult result, CancellationToken cancellationToken)
 {
     _logger?.LogInformation("Custom processor End called!" + ServiceBusSessionsTestHelper.GetStringMessage(message));
     await base.CompleteProcessingMessageAsync(session, message, result, cancellationToken);
 }
Пример #3
0
 public override async Task <bool> BeginProcessingMessageAsync(IMessageSession session, Message message, CancellationToken cancellationToken)
 {
     _logger?.LogInformation("Custom processor Begin called!" + ServiceBusSessionsTestHelper.GetStringMessage(message));
     return(await base.BeginProcessingMessageAsync(session, message, cancellationToken));
 }