title: How to use EventStore to built up new application views in praxis?
body: <p>Yes, something similar has been asked at least a couple of times before. Thus I know the answer: You just replay the events on the new handler, simple. But having a go at an actual implementation raises some questions.</p>
  <p>I'm using JOlivier's EventStore which seems nice. For starters I'll ignore the concept of SnapShots and just look at a way to get my events out. All I could get going is this code:</p>
  <pre><code>var commitList = Store.GetFrom(DateTime.UtcNow.AddSeconds(-1));
  foreach (var commit in commitList)
  {
      foreach (var comittedEvent in commit.Events)
      {
          if (comittedEvent.Body is SomeDomainEvent)
              Console.WriteLine(string.Format(&quot;Found interesting event: {0}&quot;, ((SomeDomainEvent)comittedEvent.Body).Value));
      }
  }
  </code></pre>
  <p>First question here is of course: Is this the way to do it? I'm having trouble using the parameter for &quot;GetFrom&quot; since it's just a DateTime and I can't be sure that all servers are in sync timewise. What if the the clock on one server is 1 minut behind another? Or ½ hour? I'm also using NServiceBus so the new handler queue will pile up events from a certain point in time - but how can I be 100% sure that there isn't 10 seconds missing here? Please tell me how you get events out of the EventStore while being 100% (not 99%) sure that the new application view is completely in sync when started.</p>
  <p>Also: Do you create a special import method in your code? I mean, suppose the handler in my new application sends out an email when it handles &quot;SomeDomainEvent&quot;. I don't want it to send out emails for all 10.000 old events. How do you do this &quot;import&quot; in praxis/code?</p>