catch-up subscription

This post:

https://github.com/EventStore/geteventstore.com/blob/c9df631e38106667417927b166fd8cbd856b80d1/_posts/2013-07-07-catch-up-subscriptions-with-the-event-store.md

is about EventStore.Client version 1.1.0. It explicitly states that version 2 differs in terms of catch-up subscription. I someone aware of similar code for version 3.0.1.0. The following code just does not work:

class Program

{

static void Main()

{

var ipEndPoint = new IPEndPoint(IPAddress.Loopback, 2113);

var connection = EventStoreConnection.Create(ipEndPoint);

var test = connection.SubscribeToStreamFrom(“FakeEventsStream”, StreamPosition.Start, false, eventAppeared);

}

private static void eventAppeared(EventStoreCatchUpSubscription arg1, ResolvedEvent resolvedEvent)

{

var originalMetaJson = JObject.Parse(Encoding.UTF8.GetString(resolvedEvent.Event.Metadata));

var orignalData = Encoding.UTF8.GetString(resolvedEvent.Event.Data);

var receivedEvent = resolvedEvent.Event;

Console.WriteLine("{0:D4} - {1}", receivedEvent.EventNumber, receivedEvent.EventType);

}

}

Thanks.

You need a Console.ReadLine or your program will exit first.

Thanks, that worked. Just a stupid question. Why did a break-point not work?

because your program immediately exited?

Does a breakpoint not prevent this (at the end of my Main method)?

A breakpoint also causes everything to stop when it hits…?

Sorry maybe you missunderstood. A Console.Readline at the end of the previously posted Main method works but a breakpoint does not.

Yes, this makes perfect sense. If you hit a breakpoint your entire process stops and you shouldn’t expect anything to work. Console.ReadLine blocks the foreground thread, but background threads continue to operate normally.