相关疑难解决方法(0)

订阅类别流,事件永远不会出现在订阅客户端中

作为GetEventStore的第一次用户并阅读了文档,我遇到了一个问题,即事件从未出现在我的订阅客户端上。

由于我错过了一个配置步骤,这是可能的。

拥有此控制台应用程序客户端:

public class EventStoreSubscriptionClient : ISubscriptionClient
{
    private const string GroupName = "liner";
    private const string StreamName = "$ce-happening";

    private readonly IProvideEventStoreConnection _eventStoreConnection;
    private readonly UserCredentials _userCredentials;

    private EventStorePersistentSubscriptionBase EventStorePersistentSubscriptionBase { get; set; }

    public EventStoreSubscriptionClient(IProvideEventStoreConnection eventStoreConnection, UserCredentials userCredentials)
    {
        _eventStoreConnection = eventStoreConnection;
        _userCredentials = userCredentials;
    }

    public void Connect()
    {
        var connection = _eventStoreConnection.ConnectAsync().Result;
        EventStorePersistentSubscriptionBase = connection.ConnectToPersistentSubscription(
               StreamName,
               GroupName,
               EventAppeared,
               SubscriptionDropped,
               _userCredentials,
               10,
               false
        );
    }

    private void SubscriptionDropped(EventStorePersistentSubscriptionBase subscription, SubscriptionDropReason reason, Exception ex)
    { …
Run Code Online (Sandbox Code Playgroud)

c# cqrs event-sourcing eventstoredb

4
推荐指数
1
解决办法
718
查看次数

标签 统计

c# ×1

cqrs ×1

event-sourcing ×1

eventstoredb ×1