Consider the situation:
public class OrderController {
IBus bus;
public OrderController(IBus bus) {
this.bus = bus;
}
public ActionResult Checkout(String orderId) {
var command = new CheckoutOrderCommand(orderId);
bus.Send(command);
return Redirect("on-success-url");
}
}
The corresponding command handler (defined in a separate assembly) is awaiting for the incomming message to be processed.
But we have already said that everything is ok by sending
return Redirect("on-success-url");
What if handler fails to save changes to the domain?
Well, it is possible to use a queue on command handler side to publish response, to subscribe web application to the queue.
How does the end user get immediate/synchronous ui response, which would reflect the real changes made to the domain? Should I do so?
Is handling incomming commands by means of message bus is only good for a background tasks without acknowledgment?