Subject: | Kafka Send/Receive Max Retries doesn't allow 0 retries |
Date: | Sat, 17 Jan 2015 18:39:38 +0000 |
To: | bug-Kafka [...] rt.cpan.org |
From: | Hari Sekhon <harisekhon [...] gmail.com> |
Hi,
When using the Kafka Perl API the SEND_MAX_RETRIES and RECEIVE_MAX_RETRIES
arguments to the Kafka::Connection->new() call don't seem to allow 0 as a
valid value.
I am writing code to detect any faults in Kafka brokers and would like to
know if there is any failure at all so need to set retries to zero, but
this results in
Error: Invalid argument: SEND_MAX_RETRIES
or
Error: Invalid argument: RECEIVE_MAX_RETRIES
This forces me to do at least 1 retry which is not optimal for the purposes
of detecting any faults.
I suspect underneath this is doing some logic like
$var or die;
where zero will fail the boolean condition.
If so could the test instead be made to do
defined($var) and $var =~ /^\d+$/ and $var >= 0
so that I can implement the zero retries behaviour in my program?
Best Regards,
Hari Sekhon
http://www.linkedin.com/in/harisekhon