Skip to content

performOnMasterOnly property doesn't seem to work #167

@tomtimmerman

Description

@tomtimmerman

Hi

I'am trying to create a persistent subscription to a eventstore cluster version 21.10.5. I've set the performOnMasterOnly property but it only tries to connect to follower nodes not to the leader node. The ClusterDnsEndPointDiscoverer always returns the first node it encounters and not the master node.
Below is my client config.

$userCredentials = new UserCredentials($username, $password);
$connectionSettings = ConnectionSettings::create()
    ->setDefaultUserCredentials($userCredentials)
    ->useSslConnection($host, $useSsl)
    ->enableVerboseLogging()
    ->performOnMasterOnly()
    ->build();

$connection = EventStoreConnectionFactory::createFromConnectionString($connectionString, $connectionSettings);

Loop::run( function () use ($connection) {
    yield $connection->connectAsync();
    yield $connection->connectToPersistentSubscriptionAsync(
        'stream-id',
        'subscription-name',
        Closure::fromCallable(static function (EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent): Promise {
            echo 'received event!';
            return new Success();
        }),
        Closure::fromCallable(static function (EventStorePersistentSubscription $subscription, SubscriptionDropReason $reason, Throwable $throwable = null): void {
            echo 'subscription dropped.';
        }),
        1,
        true 
    );
} );

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions