prooph / event-store-http-client

PHP 7.2 Event Store HTTP Client Implementation
BSD 3-Clause "New" or "Revised" License
25 stars 5 forks source link

subscribeToStreamFrom() is not resolving linkTos? #45

Closed burzum closed 5 years ago

burzum commented 5 years ago

I'm using the built in by $by_category projection of the event store.

The events in this stream look like this:

{
  "$v": "2:-1:1:3",
  "$c": 303378,
  "$p": 303378,
  "$causedBy": "296c90a3-3ddd-e248-8c97-b2c8fa515edf"
}

I'm trying to use a catchup subscription with this stream. I assume that the resolveLinkTos argument should somehow resolve the above to the original link? If this is correct then it doesn't work. I'm just getting the above link back.

The client version is the master branch at c996ad3086299bab0cc829cde8f39625a0fe617c.

/**
 * @var $eventStore \Prooph\EventStore\EventStoreConnection
 */
$eventStore = ConnectionManager::get('eventStore');

$stream = '$category-Account';
$settings = new \Prooph\EventStore\CatchUpSubscriptionSettings(
    50,
    50,
    false,
    true // resolveLinkTos
);
$subscription = $eventStore->subscribeToStreamFrom(
    $stream,
    null,
    $settings,
    new \App\Infrastructure\Projection\AccountProjection(
        true
    )
);

echo 'Processing stream ' . $stream . PHP_EOL;

$subscription->start();
prolic commented 5 years ago

There are unit tests proving this feature is working. So the problem must be on your side. Maybe you can share your custom classes that are missing in your example code?

On Mon, Sep 23, 2019, 04:30 Florian Krämer notifications@github.com wrote:

I'm using the built in by $by_category projection https://eventstore.org/docs/projections/system-projections/index.html?tabs=tabid-5#by-category of the event store.

The events in this stream look like this:

{ "$v": "2:-1:1:3", "$c": 303378, "$p": 303378, "$causedBy": "296c90a3-3ddd-e248-8c97-b2c8fa515edf" }

I'm trying to use a catchup subscription with this stream. I assume that the resolveLinkTos argument should somehow resolve the above to the original link? If this is correct then it doesn't work. I'm just getting the above link back.

The client version is the master branch at c996ad3 https://github.com/prooph/event-store-http-client/commit/c996ad3086299bab0cc829cde8f39625a0fe617c .

/* @var $eventStore \Prooph\EventStore\EventStoreConnection */$eventStore = ConnectionManager::get('eventStore');$stream = '$category-Account';$settings = new \Prooph\EventStore\CatchUpSubscriptionSettings( 50, 50, false, true // resolveLinkTos);$subscription = $eventStore->subscribeToStreamFrom( $stream, null, $settings, new \App\Infrastructure\Projection\AccountProjection( true ));echo 'Processing stream ' . $stream . PHP_EOL;$subscription->start();

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/prooph/event-store-http-client/issues/45?email_source=notifications&email_token=AADAJPGMOGWWYY46R4AQP2LQLB5BTA5CNFSM4IZH2I72YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HM7ACMQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AADAJPENJBC2WBZU2FF2TXTQLB5BTANCNFSM4IZH2I7Q .

burzum commented 5 years ago

I'm using this right now to debug what's going on.

<?php
declare(strict_types = 1);

namespace App\Infrastructure\Projection;

use Throwable;
use Prooph\EventStore\EventAppearedOnCatchupSubscription;
use Prooph\EventStore\EventStoreCatchUpSubscription;
use Prooph\EventStore\RecordedEvent;
use Prooph\EventStore\ResolvedEvent;

/**
 * Abstract Projection
 */
class AbstractCatchupProjection implements EventAppearedOnCatchupSubscription
{
    /**
     * @var bool
     */
    protected $verbose = false;

    /**
     * Constructor
     *
     * @param \TestApp\Infrastructure\Projection\PDO\ArticleReadModel $articleReadModel Article Read Model
     */
    public function __construct(
        bool $verbose = false
    ) {
        $this->verbose = $verbose;
    }

    /**
     * @inheritDoc
     */
    public function __invoke(
        EventStoreCatchUpSubscription $subscription,
        ResolvedEvent $resolvedEvent
    ): void {
        /**
         * @var $event \Prooph\EventStore\RecordedEvent
         */
        $event = $resolvedEvent->event();

        if ($this->verbose) {
            $date = $event->created()->format('Y-m-d H:i:s.u');
            $output = $date . ' [' . $event->eventNumber() . '] ' . $event->eventType() . PHP_EOL;
            fwrite(STDOUT, $output);
        }

        $type = $event->eventType();
        $method = str_replace('.', '', $type);

        if (method_exists($this, $method)) {
            try {
                $this->{$method}($event, $resolvedEvent);
            } catch (Throwable $e) {
                if ($this->verbose) {
                    $output = $date . ' [' . $event->eventNumber() . '] ' . $event->eventType() . PHP_EOL;
                    $output .= $e->getMessage() . PHP_EOL;
                    fwrite(STDOUT, $output);
                }
            }
        }
    }
}
<?php
declare(strict_types = 1);

namespace App\Infrastructure\Projection;

use App\Infrastructure\Persistence\PdoHelper;
use Envms\FluentPDO\Query;
use Psa\Infrastructure\DataStorage\ConnectionManager;
use Throwable;
use Prooph\EventStore\EventAppearedOnCatchupSubscription;
use Prooph\EventStore\EventStoreCatchUpSubscription;
use Prooph\EventStore\RecordedEvent;
use Prooph\EventStore\ResolvedEvent;

/**
 * Account Projection
 */
class AccountProjection extends AbstractCatchupProjection
{
    /**
     *
     */
    public function accountingAccountCreated(RecordedEvent $event, ResolvedEvent $resolvedEvent)
    {
        //var_dump($resolvedEvent->originalEvent());
    }
}
burzum commented 5 years ago

Also retrieving a single event gives me the same results. It doesn't look like its resolving the original event correctly?

var_dump($eventStore->readEvent('$category-Account', 0, true)->event()->originalEvent());
die();
class Prooph\EventStore\RecordedEvent#54 (8) {
  protected $eventStreamId =>
  string(17) "$category-Account"
  protected $eventNumber =>
  int(0)
  protected $eventId =>
  class Prooph\EventStore\EventId#53 (1) {
    private $uuid =>
    class Ramsey\Uuid\Uuid#69 (3) {
      protected $codec =>
      class Ramsey\Uuid\Codec\GuidStringCodec#66 (1) {
        ...
      }
      protected $fields =>
      array(6) {
        ...
      }
      protected $converter =>
      class Ramsey\Uuid\Converter\Number\DegradedNumberConverter#72 (0) {
        ...
      }
    }
  }
  protected $eventType =>
  string(2) "$@"
  protected $isJson =>
  bool(false)
  protected $data =>
  string(44) "Account-b89c7426-0f7b-4b70-942b-fc2f1e28e45a"
  protected $metadata =>
  string(112) "{
  "$v": "2:-1:1:3",
  "$c": 77363,
  "$p": 77363,
  "$causedBy": "f8a030d6-989f-d04f-a4aa-7f7d03d50f04"
}"
  protected $created =>
  class DateTimeImmutable#64 (3) {
    public $date =>
    string(26) "2019-09-19 12:41:08.609277"
    public $timezone_type =>
    int(2)
    public $timezone =>
    string(1) "Z"
  }
}
prolic commented 5 years ago

Ah that's http client. Why don't you use the async client for projections?

On Mon, Sep 23, 2019, 09:12 Florian Krämer notifications@github.com wrote:

Also retrieving a single event gives me the same results. It doesn't look like its resolving the original event correctly?

var_dump($eventStore->readEvent('$category-Account', 0, true)->event()->originalEvent());die();

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prooph/event-store-http-client/issues/45?email_source=notifications&email_token=AADAJPFAPFXSODHUSQ4AEQ3QLC6CVA5CNFSM4IZH2I72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7KZUWA#issuecomment-534092376, or mute the thread https://github.com/notifications/unsubscribe-auth/AADAJPGMYF7Z2MXKBFFEKZLQLC6CVANCNFSM4IZH2I7Q .

burzum commented 5 years ago

@prolic well, it returns the same result as the HTTP store:

<?php
declare(strict_types=1);

namespace Prooph\EventStoreClient;

use Amp\Loop;
use Amp\Promise;
use Amp\Success;
use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription;
use Prooph\EventStore\Async\EventAppearedOnSubscription;
use Prooph\EventStore\Async\EventStoreCatchUpSubscription;
use Prooph\EventStore\CatchUpSubscriptionSettings;
use Prooph\EventStore\EndPoint;
use Prooph\EventStore\EventStoreSubscription;
use Prooph\EventStore\ResolvedEvent;
use Prooph\EventStore\SubscriptionDropped;
use Prooph\EventStore\SubscriptionDropReason;
use Prooph\EventStore\UserCredentials;
use Prooph\EventStoreClient\Internal\VolatileEventStoreSubscription;
use Throwable;

require_once './vendor/autoload.php';
require_once './config/bootstrap.php';
require_once './config/connections.php';

Loop::run(function () {
    $connection = EventStoreConnectionFactory::createFromEndPoint(
        new EndPoint('127.0.0.1', 1113)
    );
    $connection->onConnected(function (): void {
        echo 'connected' . PHP_EOL;
    });
    $connection->onClosed(function (): void {
        echo 'connection closed' . PHP_EOL;
    });
    yield $connection->connectAsync();

    $settings = new CatchUpSubscriptionSettings(
        50,
        50,
        false,
        true,
        '$category-Account'
    );

    $subscription = yield $connection->subscribeToStreamFromAsync(
        '$category-Account',
        0,
        $settings,
        new class() implements EventAppearedOnCatchupSubscription {
            public function __invoke(
                EventStoreCatchUpSubscription $subscription,
                ResolvedEvent $resolvedEvent): Promise
            {
                echo 'incoming event: ' . $resolvedEvent->originalEventNumber() . '@' . $resolvedEvent->originalStreamName() . PHP_EOL;
                echo 'data: ' . $resolvedEvent->originalEvent()->data() . PHP_EOL;
                var_dump($resolvedEvent);
                var_dump($resolvedEvent->originalEvent());
                return new Success();
            }
        }
    );
});
λ php .\eventstore.php                                                                                                                        
connected                                                                                                                                     
incoming event: 1@$category-Account                                                                                                           
data: Account-1f67421b-f806-4632-8a2e-35c0a5b6d4b1                                                                                            
C:\xampp\htdocs\wa-next-app\eventstore.php:57:                                                                                                
class Prooph\EventStore\ResolvedEvent#1190 (5) {                                                                                              
  private $event =>                                                                                                                           
  class Prooph\EventStore\RecordedEvent#1202 (8) {                                                                                            
    protected $eventStreamId =>                                                                                                               
    string(17) "$category-Account"                                                                                                            
    protected $eventNumber =>                                                                                                                 
    int(1)                                                                                                                                    
    protected $eventId =>                                                                                                                     
    class Prooph\EventStore\EventId#1200 (1) {                                                                                                
      private $uuid =>                                                                                                                        
      class Ramsey\Uuid\Uuid#566 (3) {                                                                                                        
        ...                                                                                                                                   
      }                                                                                                                                       
    }                                                                                                                                         
    protected $eventType =>                                                                                                                   
    string(2) "$@"                                                                                                                            
    protected $isJson =>                                                                                                                      
    bool(false)                                                                                                                               
    protected $data =>                                                                                                                        
    string(44) "Account-1f67421b-f806-4632-8a2e-35c0a5b6d4b1"                                                                                 
    protected $metadata =>                                                                                                                    
    string(92) "{"$v":"2:-1:1:3","$c":303378,"$p":303378,"$causedBy":"296c90a3-3ddd-e248-8c97-b2c8fa515edf"}"                                 
    protected $created =>                                                                                                                     
    class DateTimeImmutable#1201 (3) {                                                                                                        
      public $date =>                                                                                                                         
      string(26) "2019-09-19 12:46:53.186000"                                                                                                 
      public $timezone_type =>                                                                                                                
      int(1)                                                                                                                                  
      public $timezone =>                                                                                                                     
      string(6) "+00:00"                                                                                                                      
    }                                                                                                                                         
  }                                                                                                                                           
  private $link =>                                                                                                                            
  NULL                                                                                                                                        
  private $originalEvent =>                                                                                                                   
  class Prooph\EventStore\RecordedEvent#1202 (8) {                                                                                            
    protected $eventStreamId =>                                                                                                               
    string(17) "$category-Account"                                                                                                            
    protected $eventNumber =>                                                                                                                 
    int(1)                                                                                                                                    
    protected $eventId =>                                                                                                                     
    class Prooph\EventStore\EventId#1200 (1) {                                                                                                
      private $uuid =>                                                                                                                        
      class Ramsey\Uuid\Uuid#566 (3) {                                                                                                        
        ...                                                                                                                                   
      }                                                                                                                                       
    }                                                                                                                                         
    protected $eventType =>                                                                                                                   
    string(2) "$@"                                                                                                                            
    protected $isJson =>                                                                                                                      
    bool(false)                                                                                                                               
    protected $data =>                                                                                                                        
    string(44) "Account-1f67421b-f806-4632-8a2e-35c0a5b6d4b1"                                                                                 
    protected $metadata =>                                                                                                                    
    string(92) "{"$v":"2:-1:1:3","$c":303378,"$p":303378,"$causedBy":"296c90a3-3ddd-e248-8c97-b2c8fa515edf"}"                                 
    protected $created =>                                                                                                                     
    class DateTimeImmutable#1201 (3) {                                                                                                        
      public $date =>                                                                                                                         
      string(26) "2019-09-19 12:46:53.186000"                                                                                                 
      public $timezone_type =>                                                                                                                
      int(1)                                                                                                                                  
      public $timezone =>                                                                                                                     
      string(6) "+00:00"                                                                                                                      
    }                                                                                                                                         
  }                                                                                                                                           
  private $isResolved =>                                                                                                                      
  bool(false)                                                                                                                                 
  private $originalPosition =>                                                                                                                
  NULL                                                                                                                                        
}                                                                                                                                             
C:\xampp\htdocs\wa-next-app\eventstore.php:58:                                                                                                
class Prooph\EventStore\RecordedEvent#1202 (8) {                                                                                              
  protected $eventStreamId =>                                                                                                                 
  string(17) "$category-Account"                                                                                                              
  protected $eventNumber =>                                                                                                                   
  int(1)                                                                                                                                      
  protected $eventId =>                                                                                                                       
  class Prooph\EventStore\EventId#1200 (1) {                                                                                                  
    private $uuid =>                                                                                                                          
    class Ramsey\Uuid\Uuid#566 (3) {                                                                                                          
      protected $codec =>                                                                                                                     
      class Ramsey\Uuid\Codec\GuidStringCodec#68 (1) {                                                                                        
        ...                                                                                                                                   
      }                                                                                                                                       
      protected $fields =>                                                                                                                    
      array(6) {                                                                                                                              
        ...                                                                                                                                   
      }                                                                                                                                       
      protected $converter =>                                                                                                                 
      class Ramsey\Uuid\Converter\Number\DegradedNumberConverter#66 (0) {                                                                     
        ...                                                                                                                                   
      }                                                                                                                                       
    }                                                                                                                                         
  }                                                                                                                                           
  protected $eventType =>                                                                                                                     
  string(2) "$@"                                                                                                                              
  protected $isJson =>                                                                                                                        
  bool(false)                                                                                                                                 
  protected $data =>                                                                                                                          
  string(44) "Account-1f67421b-f806-4632-8a2e-35c0a5b6d4b1"                                                                                   
  protected $metadata =>                                                                                                                      
  string(92) "{"$v":"2:-1:1:3","$c":303378,"$p":303378,"$causedBy":"296c90a3-3ddd-e248-8c97-b2c8fa515edf"}"                                   
  protected $created =>                                                                                                                       
  class DateTimeImmutable#1201 (3) {                                                                                                          
    public $date =>                                                                                                                           
    string(26) "2019-09-19 12:46:53.186000"                                                                                                   
    public $timezone_type =>                                                                                                                  
    int(1)                                                                                                                                    
    public $timezone =>                                                                                                                       
    string(6) "+00:00"                                                                                                                        
  }                                                                                                                                           
}                                                                                                                                             
prolic commented 5 years ago

originalEvent() will return the link. this is correct. call event() instead. Sascha-Oliver Prolic

Am Mo., 23. Sept. 2019 um 09:30 Uhr schrieb Florian Krämer < notifications@github.com>:

@prolic https://github.com/prolic well, it returns the same result as the HTTP store:

<?phpdeclare(strict_types=1);namespace Prooph\EventStoreClient;use Amp\Loop;use Amp\Promise;use Amp\Success;use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription;use Prooph\EventStore\Async\EventAppearedOnSubscription;use Prooph\EventStore\Async\EventStoreCatchUpSubscription;use Prooph\EventStore\CatchUpSubscriptionSettings;use Prooph\EventStore\EndPoint;use Prooph\EventStore\EventStoreSubscription;use Prooph\EventStore\ResolvedEvent;use Prooph\EventStore\SubscriptionDropped;use Prooph\EventStore\SubscriptionDropReason;use Prooph\EventStore\UserCredentials;use Prooph\EventStoreClient\Internal\VolatileEventStoreSubscription;use Throwable;require_once './vendor/autoload.php';require_once './config/bootstrap.php';require_once './config/connections.php';Loop::run(function () { $connection = EventStoreConnectionFactory::createFromEndPoint( new EndPoint('127.0.0.1', 1113) ); $connection->onConnected(function (): void { echo 'connected' . PHP_EOL; }); $connection->onClosed(function (): void { echo 'connection closed' . PHP_EOL; }); yield $connection->connectAsync(); $settings = new CatchUpSubscriptionSettings( 50, 50, false, true, '$category-Account' ); $subscription = yield $connection->subscribeToStreamFromAsync( '$category-Account', 0, $settings, new class() implements EventAppearedOnCatchupSubscription { public function __invoke( EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent): Promise { echo 'incoming event: ' . $resolvedEvent->originalEventNumber() . '@' . $resolvedEvent->originalStreamName() . PHP_EOL; echo 'data: ' . $resolvedEvent->originalEvent()->data() . PHP_EOL; var_dump($resolvedEvent); var_dump($resolvedEvent->originalEvent()); return new Success(); } } );});

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/prooph/event-store-http-client/issues/45?email_source=notifications&email_token=AADAJPFF44BXTSGGSN7XBT3QLDAGDA5CNFSM4IZH2I72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7K3KGQ#issuecomment-534099226, or mute the thread https://github.com/notifications/unsubscribe-auth/AADAJPH4FXRBXFXJ3RFDCM3QLDAGDANCNFSM4IZH2I7Q .

burzum commented 5 years ago

Changed the above code to:

            {
                //echo 'incoming event: ' . $resolvedEvent->originalEventNumber() . '@' . $resolvedEvent->originalStreamName() . PHP_EOL;
                //echo 'data: ' . $resolvedEvent->originalEvent()->data() . PHP_EOL;
                var_dump($resolvedEvent->event());
                return new Success();
            }

And the result is still:

λ php .\eventstore.php
connected
C:\xampp\htdocs\wa-next-app\eventstore.php:57:
class Prooph\EventStore\RecordedEvent#1202 (8) {
  protected $eventStreamId =>
  string(17) "$category-Account"
  protected $eventNumber =>
  int(1)
  protected $eventId =>
  class Prooph\EventStore\EventId#1200 (1) {
    private $uuid =>
    class Ramsey\Uuid\Uuid#566 (3) {
      protected $codec =>
      class Ramsey\Uuid\Codec\GuidStringCodec#68 (1) {
        ...
      }
      protected $fields =>
      array(6) {
        ...
      }
      protected $converter =>
      class Ramsey\Uuid\Converter\Number\DegradedNumberConverter#66 (0) {
        ...
      }
    }
  }
  protected $eventType =>
  string(2) "$@"
  protected $isJson =>
  bool(false)
  protected $data =>
  string(44) "Account-1f67421b-f806-4632-8a2e-35c0a5b6d4b1"
  protected $metadata =>
  string(92) "{"$v":"2:-1:1:3","$c":303378,"$p":303378,"$causedBy":"296c90a3-3ddd-e248-8c97-b2c8fa515edf"}"
  protected $created =>
  class DateTimeImmutable#1201 (3) {
    public $date =>
    string(26) "2019-09-19 12:46:53.186000"
    public $timezone_type =>
    int(1)
    public $timezone =>
    string(6) "+00:00"
  }
}
burzum commented 5 years ago

@prolic if I debug this in the callable

dd($resolvedEvent->isResolved());

I'm getting false. So the event has not been resolved at the time I'm debugging it and because of this resolvedEvent->link() is null and I guess even() returning the "link" event data instead of the true linked event?

prolic commented 5 years ago

What version of event store are you using?

Sascha-Oliver Prolic

Am Mo., 23. Sept. 2019 um 11:24 Uhr schrieb Florian Krämer notifications@github.com:

@prolic if I debug this in the callable

dd($resolvedEvent->isResolved());

I'm getting false. So the event has not been resolved at the time I'm debugging it and because of this resolvedEvent->link() is null and I guess even() returning the "link" event data instead of the true linked event?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

burzum commented 5 years ago

@prolic I just thought about this possibility. Version 5.0.1.0

Edit: Same behavior with 4.x.

Here is the whole code again just in case it is my fault:

<?php
declare(strict_types=1);

namespace Prooph\EventStoreClient;

use Amp\Loop;
use Amp\Promise;
use Amp\Success;
use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription;
use Prooph\EventStore\Async\EventAppearedOnSubscription;
use Prooph\EventStore\Async\EventStoreCatchUpSubscription;
use Prooph\EventStore\CatchUpSubscriptionSettings;
use Prooph\EventStore\EndPoint;
use Prooph\EventStore\EventStoreSubscription;
use Prooph\EventStore\ResolvedEvent;
use Prooph\EventStore\SubscriptionDropped;
use Prooph\EventStore\SubscriptionDropReason;
use Prooph\EventStore\UserCredentials;
use Prooph\EventStoreClient\Internal\VolatileEventStoreSubscription;
use Throwable;

require_once './vendor/autoload.php';
require_once './config/bootstrap.php';
require_once './config/connections.php';

Loop::run(function () {
    $connection = EventStoreConnectionFactory::createFromEndPoint(
        new EndPoint('127.0.0.1', 1113)
    );
    $connection->onConnected(function (): void {
        echo 'connected' . PHP_EOL;
    });
    $connection->onClosed(function (): void {
        echo 'connection closed' . PHP_EOL;
    });
    yield $connection->connectAsync();

    $settings = new CatchUpSubscriptionSettings(
        50,
        50,
        true,
        true,
        '$category-Account'
    );

    $subscription = yield $connection->subscribeToStreamFromAsync(
        '$category-Account',
        0,
        $settings,
        new class() implements EventAppearedOnCatchupSubscription {
            public function __invoke(
                EventStoreCatchUpSubscription $subscription,
                ResolvedEvent $resolvedEvent): Promise
            {
                echo 'incoming event: ' . $resolvedEvent->event()->eventNumber() . '@' . $resolvedEvent->originalStreamName() . PHP_EOL;
                echo 'data: ' . $resolvedEvent->event()->data() . PHP_EOL;

                var_dump($resolvedEvent->event());

                return new Success();
            }
        }
    );
});

Output:

λ php .\eventstore.php                                                                                                  
connected                                                                                                               
incoming event: 1@$category-Account                                                                                     
data: Account-5c4afa4c-09e5-4639-bc2e-b3ea11f5ed7e                                                                      
C:\xampp\htdocs\wa-next-app\eventstore.php:58:                                                                          
class Prooph\EventStore\RecordedEvent#77 (8) {                                                                          
  protected $eventStreamId =>                                                                                           
  string(17) "$category-Account"                                                                                        
  protected $eventNumber =>                                                                                             
  int(1)                                                                                                                
  protected $eventId =>                                                                                                 
  class Prooph\EventStore\EventId#1182 (1) {                                                                            
    private $uuid =>                                                                                                    
    class Ramsey\Uuid\Uuid#131 (3) {                                                                                    
      protected $codec =>                                                                                               
      class Ramsey\Uuid\Codec\GuidStringCodec#68 (1) {                                                                  
        ...                                                                                                             
      }                                                                                                                 
      protected $fields =>                                                                                              
      array(6) {                                                                                                        
        ...                                                                                                             
      }                                                                                                                 
      protected $converter =>                                                                                           
      class Ramsey\Uuid\Converter\Number\DegradedNumberConverter#66 (0) {                                               
        ...                                                                                                             
      }                                                                                                                 
    }                                                                                                                   
  }                                                                                                                     
  protected $eventType =>                                                                                               
  string(2) "$@"                                                                                                        
  protected $isJson =>                                                                                                  
  bool(false)                                                                                                           
  protected $data =>                                                                                                    
  string(44) "Account-5c4afa4c-09e5-4639-bc2e-b3ea11f5ed7e"                                                             
  protected $metadata =>                                                                                                
  string(98) "{"$v":"2:-1:1:3","$c":660451877,"$p":660451877,"$causedBy":"b16e435c-1364-514d-b905-2f26e1975565"}"       
  protected $created =>                                                                                                 
  class DateTimeImmutable#166 (3) {                                                                                     
    public $date =>                                                                                                     
    string(26) "2019-09-23 16:23:34.215000"                                                                             
    public $timezone_type =>                                                                                            
    int(1)                                                                                                              
    public $timezone =>                                                                                                 
    string(6) "+00:00"                                                                                                  
  }                                                                                                                     
}                                                                                                                                                                                                                                           
burzum commented 5 years ago

@prolic maybe the problem is in the versions we're using?

"prooph/event-store": "dev-master as v8.0.0-RC-1",
"prooph/event-store-client": "^1.0@RC",
"prooph/event-store-http-client": "dev-master",
prolic commented 5 years ago

You can try latest master branch and see there. If you take a look at the tests, there are tests covering linked events.

I can't tell you more right now, as I would need to replicate your setup locally, and I don't have time for it right now. Maybe the next few days.

On Mon, Sep 23, 2019, 12:38 Florian Krämer notifications@github.com wrote:

@prolic https://github.com/prolic maybe the problem is in the versions we're using?

"prooph/event-store": "dev-master as v8.0.0-RC-1", "prooph/event-store-client": "^1.0@RC", "prooph/event-store-http-client": "dev-master",

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/prooph/event-store-http-client/issues/45?email_source=notifications&email_token=AADAJPDKUQVAQVVX56DPUGDQLDWIRA5CNFSM4IZH2I72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7LPL7Y#issuecomment-534181375, or mute the thread https://github.com/notifications/unsubscribe-auth/AADAJPG2V2ZAXKHQ2ZAWWSLQLDWIRANCNFSM4IZH2I7Q .

burzum commented 5 years ago

@prolic I've created a test app for you.

https://github.com/burzum/prooph-event-store-test

Run generate.php to create some events. Each run will create a new stream prefixed with "Foo-".

Running eventstore.php will trigger the subscription. There is no other code than this involved. I'm using the same version constraints as we do in our app and I'm getting the same results as pasted above.

I've also tried to upgrade the event store to 5.0.2.0.

netstyler commented 5 years ago

@prolic

I did test the https://github.com/burzum/prooph-event-store-test Same behavior on my osx setup with event store 5.0.2.

prolic commented 5 years ago

ping @burzum @netstyler

burzum commented 5 years ago

This has been "fixed" - The damn stream name was wrong and has to be prefixed with $ce instead of #category. See https://github.com/burzum/prooph-event-store-test/pull/1