Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple notices when sending messages #10

Open
exu opened this issue Feb 21, 2019 · 2 comments
Open

Multiple notices when sending messages #10

exu opened this issue Feb 21, 2019 · 2 comments

Comments

@exu
Copy link

exu commented Feb 21, 2019

Hi,

When sending messages I've receiving multiple notices

❯ php pub.php 100                                                                                                                                    
PHP Notice:  Undefined index: auth_required in /home/exu/src/kinguin.io/architecture/eventsourcing-nats/php/vendor/repejota/nats/src/Nats/ServerInfo.
php on line 105                                                                                                                                      
PHP Notice:  Undefined index: tls_required in /home/exu/src/kinguin.io/architecture/eventsourcing-nats/php/vendor/repejota/nats/src/Nats/ServerInfo.p
hp on line 106                                                                                                                                       
PHP Notice:  Undefined index: tls_verify in /home/exu/src/kinguin.io/architecture/eventsourcing-nats/php/vendor/repejota/nats/src/Nats/ServerInfo.ph$
 on line 107                                                                                                                                         
Got ACK(0) = 1                                                                                                                                       
Got ACK(1) = 1                                                                                                                                       
...

Does II missing someting ?

and the code.

<?php
require 'vendor/autoload.php';

$options = new \NatsStreaming\ConnectionOptions();
$options->setClientID("test");
$options->setClusterID("test-cluster");

$c = new \NatsStreaming\Connection($options);
$c->connect();

$count = 1;
if (isset($argv, $argv[1])) {
    $count = (int) $argv[1];
}

for ($i = 0; $i < $count; $i++) {
    $r = $c->publish('dupa', json_encode(['nats' => 'example','a'=>rand()]));
    echo "Got ACK($i) = " . $r->wait() . "\n";
}

$c->close();
@byrnedo
Copy link
Owner

byrnedo commented Feb 21, 2019

Hi @exu.

Looks like an issue in php-nats.
Basically some headers aren't received after connecting.

Could be that you connect to something other than a nats server?
You sure it's running on localhost:4222?

@dimatock
Copy link

dimatock commented Mar 2, 2019

ServerInfo message of NATS server was changed. For check, enable debug on client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants