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

Unable to detect broker status when creating connection object #41

Open
SunYour opened this issue Oct 17, 2017 · 0 comments
Open

Unable to detect broker status when creating connection object #41

SunYour opened this issue Oct 17, 2017 · 0 comments

Comments

@SunYour
Copy link

SunYour commented Oct 17, 2017

I'm trying to find a way how to monitor the status of the connection object.
If I shut down my Kafka broker, the response message is still the same as when it is up and running.

                 '_IO_cache' => {
                                  'cau:29092' => {
                                                   'NodeId' => undef,
                                                   'IO' => undef,
                                                   'port' => '29092',
                                                   'host' => 'cau'
                                                 }
                                },
                 '_metadata' => {},
                 'MaxLoggedErrors' => 100,
                 'dont_load_supported_api_versions' => 0,
                 'AutoCreateTopicsEnable' => 0,
                 'ip_version' => undef,
                 'broker_list' => [],
                 '_group_coordinators' => {},
                 'SEND_MAX_ATTEMPTS' => 4,
                 'port' => 29092,
                 'host' => 'cau',
                 '_nonfatal_errors' => [],
                 '_leaders' => {},
                 'timeout' => '1.5',
                 'RETRY_BACKOFF' => 200
               }, 'Kafka::Connection' );

I expect to get some kind of error.

Also, both hashes for cluster errors and non fatal errors are empty.

$VAR1 = {};

Non fatal errors:
$VAR1 = [];

The only way (?) to detect an error is currently by, for example call get_metadata and it will throw an exception

Cannot get metadata: topic='<undef>' (same thing happens if I define an exisiting topic)

Trace begun at /opt/app/xxx/xxx-perl/xxx-perllib/lib/perl5/Kafka/Connection.pm line 1592
Kafka::Connection::_error('Kafka::Connection=HASH(0x1d1aa90)', -1007, 'topic=\'<undef>\'') called at /opt/app/xxx/xxx-perl/xxx-perllib/lib/perl5/Kafka/Connection.pm line 693
Kafka::Connection::get_metadata('Kafka::Connection=HASH(0x1d1aa90)') called at /opt/app/xxx/xxx-perl/xxx-perllib/lib/perl5/Xxx/Kafka/Connector.pm line 79
Xxx::Kafka::Connector::__ANON__ at /opt/app/xxx/xxx-perl/xxx-perllib/lib/perl5/Try/Tiny.pm line 81
eval {...} at /opt/app/xxx/xxx-perl/xxx-perllib/lib/perl5/Try/Tiny.pm line 72
Try::Tiny::try('CODE(0x1d1ae98)', 'Try::Tiny::Catch=REF(0xa00448)') called at /opt/app/xxx/xxx-perl/xxx-perllib/lib/perl5/Xxx/Kafka/Connector.pm line 83

Connection is created using
$connection = Kafka::Connection->new(host => $hostname, port => $port);

Am I missing something?
Thanks

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

1 participant