public async void Handle(IncrementCounterWithAckCommand message) { //publish the event with some retries and a future expiry await _bus.PublishDurable(new CounterIncrementedWithAckEvent(), new RetryPolicy(3, TimeSpan.FromHours(1))); //now that event(s) are safely published, acknowledge the command await _bus.Acknowledge(message); }
public async void Handle(CounterIncrementedWithAckEvent message) { var viewModel = _modelManager.Get <CounterDisplayPageViewModel>(); if (null == viewModel) { viewModel = new CounterDisplayPageViewModel(); } viewModel.AcknowledgedCounter++; _modelManager.Put(viewModel); await _bus.Acknowledge(message); }
public async Task AcknowledgeLastMessage(DurableMessageBus bus) { await bus.Acknowledge(Messages.Last()); }