Am I being an idiot here? Can connect but publising event fails. Eventstore does not seems to print anything about something failing.
module test.Main
open System
open System.Net
open System.Text
open EventStore.ClientAPI
[]
let main args =
let credentials = new IPEndPoint(IPAddress.Loopback, 2113)
let connection = EventStoreConnection.Create(credentials)
let startTask = connection.ConnectAsync()
let result = Async.AwaitIAsyncResult startTask |> Async.RunSynchronously
if result = true then
let message1 = “”"{ “hello”: “world” }"""
let data = Encoding.UTF8.GetBytes(message1)
let events = [| new EventData((Guid.NewGuid()), “first.event”, true, data, [||]) |]
let task = Async.AwaitTask (connection.AppendToStreamAsync(“TestStream”, 1, events))
Async.RunSynchronously task |> ignore
0
The result is this:
Stopped due to error
System.AggregateException: One or more errors occured —> EventStore.ClientAPI.Exceptions.RetriesLimitReachedException: Item Operation AppendToStreamOperation ({ee79b5e5-1e95-4225-9892-ee099df21b22}): Stream: TestStream, ExpectedVersion: 1, retry count: 10, created: 09:06:26.325, last updated: 09:06:38.126 reached retries limit : 10
— End of inner exception stack trace —
at Microsoft.FSharp.Control.AsyncBuilderImpl.commit[WriteResult] (Microsoft.FSharp.Control.Result1 res) [0x00000] in <filename unknown>:0 at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[WriteResult] (CancellationToken token, Microsoft.FSharp.Control.FSharpAsync
1 computation, Microsoft.FSharp.Core.FSharpOption1 timeout) [0x00000] in <filename unknown>:0 at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[WriteResult] (Microsoft.FSharp.Control.FSharpAsync
1 computation, Microsoft.FSharp.Core.FSharpOption1 timeout, Microsoft.FSharp.Core.FSharpOption
1 cancellationToken) [0x00000] in :0
at <StartupCode$FSI_0030>.$FSI_0030.main@ () [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
–> (Inner exception 0) EventStore.ClientAPI.Exceptions.RetriesLimitReachedException: Item Operation AppendToStreamOperation ({ee79b5e5-1e95-4225-9892-ee099df21b22}): Stream: TestStream, ExpectedVersion: 1, retry count: 10, created: 09:06:26.325, last updated: 09:06:38.126 reached retries limit : 10
Stopped due to error