Pushing complete notifications to client

Posted by ton.yeung on Programmers See other posts from Programmers or by ton.yeung
Published on 2013-08-12T21:31:28Z Indexed on 2013/10/19 10:13 UTC
Read the original article Hit count: 275

Filed under:

So with cqrs, we accept that consistency is eventual.

However, that doesn't mean that the user has to continually poll, or that eventual means an update has to take more then 500ms to sync.

For the sake of UX, we want to at least give the illusion of consistency, or if not possible, be as transparent as possible.

With that in mind, I have this setup:

  • angularjs web client, consumes
  • webapi restful services, sends commands to
  • nservicebus command handlers, saves to
  • neventstore, dispatches events to
  • nservicebus event handlers, sends message to
  • signalr hub, sends notifications to
  • angularjs web client

so with that setup, theoretically

  • some initiates a request
  • the server validates the request
  • sends out the necessary commands

In the mean time

  • the client gets a 200 response
  • updates the view: working on it
  • gets message sometime later: done, here's the updated data

Here's where things get interesting, each command could spawn multiple events. Not sure if this is a serious no, no, or not, but that's how it is currently. For example, a new customer spawns CustomerIDCreated, CustomerNameUpdated, CustomerAddressUpdated, etc...

Which event handler needs to notify the client? Should all of them in a progress bar style update?

© Programmers or respective owner

Related posts about cqrs

  • CQRS at Jax Code Camp 2012

    as seen on ASP.net Weblogs - Search for 'ASP.net Weblogs'
    Continuing my CQRS world tour...I gave my CQRS presentation at the Jax Code Camp 2012 this past Saturday.  It was a great crowd with lots of representation from the wicked smart engineers at Feature[23] and others from the Jacksonville developer community. If you'd like to take a… >>> More

  • CQRS without using others patterns

    as seen on Programmers - Search for 'Programmers'
    I would like to explain CQRS to my team of developers. I just can't figure out how to explain it in the simplest way so they can implement the pattern rapidly without any others frameworks. I've read a lot of resources including video and articles but I don't find how to implement CQRS without using… >>> More

  • Domain queries in CQRS

    as seen on Stack Overflow - Search for 'Stack Overflow'
    We are trying out CQRS. We have a validation situation where a CustomerService (domain service) needs to know whether or not a Customer exists. Customers are unique by their email address. Our Customer repository (a generic repository) only has Get(id) and Add(customer). How should the CustomerService… >>> More

  • CQRS - The query side

    as seen on Stack Overflow - Search for 'Stack Overflow'
    A lot of the blogsphere articles related to CQRS (command query repsonsibility) seperation seem to imply that all screens/viewmodels are flat. e.g. Name, Age, Location Of Birth etc.. and thus the suggestion that implementation wise we stick them into fast read source etc.. single table per view mySQL… >>> More

  • CQRS event versioning

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Versioning If your events changes you would create a new version of that event, and keep the old ones. To keep your domain code form being bloated with handling of all versions of events you would basically introduce a component that converts your events from previous to newer versions, and then… >>> More