From 4ed672460eec55af9de7c85b28dc6009d4a69993 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Sat, 13 Apr 2024 10:52:45 +0200 Subject: [PATCH] fix incoming task acceptance message (#13) removed uncessary transaction scope --- .../Workflow/IncomingTaskMessageHandler.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Rebus.Operations/Rebus.Operations.Core/Workflow/IncomingTaskMessageHandler.cs b/src/Rebus.Operations/Rebus.Operations.Core/Workflow/IncomingTaskMessageHandler.cs index 6abc5e0..6f200bf 100644 --- a/src/Rebus.Operations/Rebus.Operations.Core/Workflow/IncomingTaskMessageHandler.cs +++ b/src/Rebus.Operations/Rebus.Operations.Core/Workflow/IncomingTaskMessageHandler.cs @@ -41,19 +41,10 @@ public async Task Handle(OperationTaskSystemMessage taskMessage) AdditionalData = _messageEnricher.EnrichTaskAcceptedReply(taskMessage), Created = DateTimeOffset.UtcNow }; - var replyAddress = MessageContext.Current.Headers.GetValueOrNull(Headers.ReturnAddress); - if (replyAddress == null) - { - _logger.LogWarning($"Operation Workflow {taskMessage.OperationId}/{taskMessage.TaskId}: missing return address"); - } - else - { - using var replyScope = new RebusTransactionScope(); - await _bus.Advanced.Routing.Send(replyAddress, reply).ConfigureAwait(false); - _logger.LogTrace($"Accepted incoming operation message. Operation id: '{taskMessage.OperationId}'"); - await replyScope.CompleteAsync().ConfigureAwait(false); - } + await _bus.Reply(reply).ConfigureAwait(false); + _logger.LogTrace($"Accepted incoming operation message. Operation id: '{taskMessage.OperationId}'"); + await _bus.SendLocal(new OperationTask(taskMessage.Message, taskMessage.OperationId, taskMessage.InitiatingTaskId,