Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subscribe to category stream, event never appears in subscription client

Being a first time user of GetEventStore and having read the docs, I have an issue where events never appears on my subscription client.

This is possible due to a configuration step I've missed.

Having this console application client:

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)
    {
        Connect();
    }

    private async void EventAppeared(EventStorePersistentSubscriptionBase subscription, ResolvedEvent resolvedEvent)
    {
        Console.WriteLine("Event appeared: " + resolvedEvent.Event.EventId);
    }

    public void Dispose()
    {
        EventStorePersistentSubscriptionBase.Stop(TimeSpan.FromSeconds(15));
    }
}

Upon starting this console application, the connection goes fine to http://myserver:1113. In the administration panel of my event store I can see there is a connection to this stream/group on the competing consumers tab:

Image of event store administation

But if I send a event like to happening-<guid> it shows up on the stream browser, but my subscription client never gets an event appeared event:

Image of event store received event

Have I misunderstood on how subscriptions, streams and groups works? Please enlighten me.

like image 625
janhartmann Avatar asked Mar 06 '16 14:03

janhartmann


1 Answers

The answer here is that projections for the Event Store was disabled.

Start the store with --run-projections=all

like image 108
janhartmann Avatar answered Nov 04 '22 00:11

janhartmann