These are chat archives for arnaud-lb/php-rdkafka

17th
Sep 2018
Muhammad Ilyas
@milyas-sugarcrm
Sep 17 2018 11:03

Hi Guys

I'm new to confluent, kafka stuff. I installed confluent 5.0 with kafka 2.0.0-cp1 on a server. From CLI tool of confluent, I successfully created the consumer, producer and topic.
Now I'm working with php library and no success yet. (https://github.com/arnaud-lb/php-rdkafka). My php code is on my local machine whereas kafka is installed on some other server.

rdkafka = 3.05
librdkafka = 0.8.6

I'm trying the examples and in addBrokers function, I think I'm doing something wrong.

Code:

$rk = new RdKafka\Producer();
$rk->setLogLevel(LOG_DEBUG);
$rk->addBrokers("westeros.rolustech.com:44319");

$topic = $rk->newTopic("test");

for ($i = 0; $i < 10; $i++) {
$topic->produce(RD_KAFKA_PARTITION_UA, 0, "Message $i");
}

Error:

%4|1537179479.416|METADATA|rdkafka#producer-2| westeros.rolustech.com:44319/bootstrap: Metadata request failed: Local: Broker transport failure
%3|1537179479.738|FAIL|rdkafka#producer-2| westeros.rolustech.com:44319/bootstrap: Receive failed: Disconnected
%3|1537179479.738|ERROR|rdkafka#producer-2| westeros.rolustech.com:44319/bootstrap: Receive failed: Disconnected
%3|1537179479.738|ERROR|rdkafka#producer-2| 1/1 brokers are down

Looking forward to response.

Thanks.

karavzeka
@karavzeka
Sep 17 2018 12:15
I don't see problems in your code. Looks like problem in broker.
Muhammad Ilyas
@milyas-sugarcrm
Sep 17 2018 12:16
I also think same but unable to find it out. Can I share the credentials of kafka server with you?
karavzeka
@karavzeka
Sep 17 2018 12:17
Oh no, please. I've never worked with confluent. I don't have time to explore it.
Muhammad Ilyas
@milyas-sugarcrm
Sep 17 2018 12:18
ok alright. Anyone else?
karavzeka
@karavzeka
Sep 17 2018 12:20
Is topic "test" exist?
May be there is forbidden auto creation in config?
Muhammad Ilyas
@milyas-sugarcrm
Sep 17 2018 12:24
no but If I use the existing topic then also getting the same error
karavzeka
@karavzeka
Sep 17 2018 12:30
Then I don't know... It's rather administrative issue then programming. May be anybody else can help you.
Muhammad Ilyas
@milyas-sugarcrm
Sep 17 2018 12:30
May be. I'm actually checking to get the exact broker ip/address. May be I'm using the wrong one