Wednesday, February 18, 2015

How to solve problem "System.AggregateException: One or more errors occured ---> EventStore.ClientAPI.Exceptions.RetriesLimitReachedException" when try to connect to write event to Event Store?

This error happened  after downloaded Event Store 3.0.1 and tried following code for the testing

            string serverIpaddress = "127.0.0.1";
            var connection = EventStoreConnection.Create(new IPEndPoint(IPAddress.Parse(serverIpaddress), 2113));
            connection.ConnectAsync().Wait();
            var myEvent = new EventData(Guid.NewGuid(), "testEvent", false,
                                        Encoding.UTF8.GetBytes("some data1"),
                                        Encoding.UTF8.GetBytes("some metadata"));
            connection.AppendToStreamAsync("test-stream",
                               ExpectedVersion.Any, myEvent).Wait();

On line of AppendToStreamAsync, exception throws:
 "System.AggregateException: One or more errors occured ---> EventStore.ClientAPI.Exceptions.RetriesLimitReachedException"

Cause: .NET API of Event Store goes by TCP port, which default value is 1113, http port number is 2113 by default.

Just change to            
          var connection = EventStoreConnection.Create(new IPEndPoint(IPAddress.Parse(serverIpaddress), 1113));

Reference
https://groups.google.com/forum/#!topic/event-store/5uWEqybibw8

1 comment:

  1. This is an amazing blog,it gives very helpful messages to us.Besides that Wisen has established as Best Dot Net Training in Chennai. or learn thru ASP.NET Online Training . Nowadays Dot Net has tons of job opportunities on various vertical industry.

    ReplyDelete