Skip to content

Commit

Permalink
fix incoming task acceptance message (#13)
Browse files Browse the repository at this point in the history
removed uncessary transaction scope
  • Loading branch information
fw2568 authored Apr 13, 2024
1 parent 5f75368 commit 4ed6724
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,10 @@ public async Task Handle(OperationTaskSystemMessage<T> 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<T>(taskMessage.Message,
taskMessage.OperationId, taskMessage.InitiatingTaskId,
Expand Down

0 comments on commit 4ed6724

Please sign in to comment.