What's the proper way to abandon an Azure SB Message so that it becomes visible again in the future in a way I can control?

前端 未结 5 1777
梦谈多话
梦谈多话 2020-12-17 08:38

So the scenario is that I\'m using an SB queue to throttle outgoing callbacks to other services. One of the standard problems with calling back to other services is that the

5条回答
  •  春和景丽
    2020-12-17 09:09

    I would prefer the last approach because it seems to be the most simple solution using the built in features of the Azure service bus.

    The flow is this:

    var newMessage = new BrokeredMessage();
    // Copy message body and properties from original message...
    
    var scheduleTimeUtc = DateTimeOffset.UtcNow.Add(...);
    await queueClient.ScheduleMessageAsync(newMessage, scheduleTimeUtc);
    
    await originalMessage.CompleteAsync()
    

提交回复
热议问题