繁体   English   中英

等待识别客户端超时 (ReadStreamEventsForwardAsync)

[英]Timed out waiting for client to be identified (ReadStreamEventsForwardAsync)

我正在尝试使用 4.0.0 C# 客户端 API (EventStore.ClientAPI.dll) 连接到 GetEventStore 3.2.2 版。 我已经在 LINQPad 5 中将此作为示例编写,以便我可以弄清楚出了什么问题。 LINQPad 查询是为 C# 语句设置的。 这是我迄今为止编写的用户查询。

var localHostAddressses = Dns.GetHostAddresses(Dns.GetHostName());
var localAddress = localHostAddressses.FirstOrDefault(ha => ha.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) ?? IPAddress.Loopback;
var endPoint = new IPEndPoint(localAddress, 1113);
var userCredentials = new EventStore.ClientAPI.SystemData.UserCredentials("admin", "changeit");

var settings = EventStore.ClientAPI.ConnectionSettings.Create();
settings.SetDefaultUserCredentials(userCredentials);
settings.UseConsoleLogger();
settings.WithConnectionTimeoutOf(TimeSpan.FromSeconds(2));
settings.LimitReconnectionsTo(1);
settings.SetOperationTimeoutTo(TimeSpan.FromSeconds(2));

using (var client = EventStore.ClientAPI.EventStoreConnection.Create(settings, endPoint))
{
    client.ConnectAsync().Wait();

    var streamName = "SpecialStreamName42";     
    var task = client.ReadStreamEventsForwardAsync(streamName, 0, 10, false);
    task.Wait();

    task.Result.Dump();
}

它产生以下输出

[19,14:05:27.126,DEBUG] TcpPackageConnection: connected to [192.168.15.201:1113, L192.168.15.201:28239, {c4f69c94-254f-475c-883a-06e427fd4610}].
[08,14:05:29.176,INFO] ClientAPI TcpConnection closed [14:05:29.176: N192.168.15.201:1113, L192.168.15.201:28239, {c4f69c94-254f-475c-883a-06e427fd4610}]:
[08,14:05:29.176,INFO] Received bytes: 116, Sent bytes: 124
[08,14:05:29.176,INFO] Send calls: 3, callbacks: 3
[08,14:05:29.176,INFO] Receive calls: 4, callbacks: 3
[08,14:05:29.176,INFO] Close reason: [Success] Timed out waiting for client to be identified
[08,14:05:29.176,DEBUG] TcpPackageConnection: connection [192.168.15.201:1113, L192.168.15.201:28239, {c4f69c94-254f-475c-883a-06e427fd4610}] was closed cleanly.
[11,14:05:29.377,DEBUG] TcpPackageConnection: connected to [192.168.15.201:1113, L192.168.15.201:28240, {9373790b-6f43-4d3f-bf66-77325b529bd0}].
[19,14:05:31.427,INFO] ClientAPI TcpConnection closed [14:05:31.427: N192.168.15.201:1113, L192.168.15.201:28240, {9373790b-6f43-4d3f-bf66-77325b529bd0}]:
[19,14:05:31.427,INFO] Received bytes: 116, Sent bytes: 124
[19,14:05:31.427,INFO] Send calls: 3, callbacks: 3
[19,14:05:31.427,INFO] Receive calls: 4, callbacks: 3
[19,14:05:31.427,INFO] Close reason: [Success] Timed out waiting for client to be identified
[19,14:05:31.427,DEBUG] TcpPackageConnection: connection [192.168.15.201:1113, L192.168.15.201:28240, {9373790b-6f43-4d3f-bf66-77325b529bd0}] was closed cleanly.

我的task.Wait(); 第 19 行永远不会完成,最终查询以发生一个或多个错误的 AggregateException 结束。 内部异常显示“连接'ES-7a7e3dfb-db11-4a5c-872c-100ad7724ba2'已关闭。”。 我正在遵循我所看到的示例,但似乎没有取得任何进展。 希望这是一些愚蠢的事情,我只是没有设置它可以让我的客户得到通知。 如果您有任何想法,请告诉我。

4.0.0 客户端兼容 ES 3.9.4 及以上版本。 客户端 3.9.5 兼容两种方式。

在他们的公告中提到了这一点,请参阅 Breaking Changes。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM