Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Consumer not reading messages after restart #296

Open
parveenbadoni opened this issue Feb 28, 2020 · 4 comments
Open

Consumer not reading messages after restart #296

parveenbadoni opened this issue Feb 28, 2020 · 4 comments

Comments

@parveenbadoni
Copy link

Following is my Consumer and Producer Script :
Consumer Script
$config = ConsumerConfig::getInstance();
$config->setMetadataRefreshIntervalMs(10000);
$config->setMetadataBrokerList('localhost:9092');
$config->setGroupId('test');
$config->setBrokerVersion('1.1.1');
$config->setTopics(['Request']);
$config->setOffsetReset('earliest');
$consumer = new Consumer();
$consumer->setLogger($logger);
$consumer->start(function($topic, $part, $message) {
var_dump($message);
});

Producer Script
$config = ProducerConfig::getInstance();
$config->setMetadataRefreshIntervalMs(10000);
$config->setMetadataBrokerList('localhost:9092');
$config->setBrokerVersion('1.1.1');
$config->setRequiredAck(1);
$config->setIsAsyn(false);
$config->setProduceInterval(500);
$producer = new \Kafka\Producer(
function() {
return [
[
'topic' => 'Request',
'value' => 'My Test Data',
],
];
}
);
$producer->success(function($result) {
var_dump($result);
});
$producer->error(function($errorCode) {
var_dump($errorCode);
});
$producer->send(true);

It is working fine. When consumer is running and producer is publishing data, consumer is able to read it. But once i stop consumer and then publish data and then start consumer, Consumer does not read that data. What am i doing wrong? Can someone help?

@parveenbadoni
Copy link
Author

@lcobucci Can you please help?

@lcobucci
Copy link
Contributor

lcobucci commented Mar 2, 2020

@parveenbadoni sorry I can't 😞 this lib has some connection management issues that aren't that trivial to fix without big changes (IMHO). I've decided to focus on other projects then.

@parveenbadoni
Copy link
Author

@parveenbadoni sorry I can't 😞 this lib has some connection management issues that aren't that trivial to fix without big changes (IMHO). I've decided to focus on other projects then.

Its ok @lcobucci :)
Can you please recommend someone else who might help me in this issue

@parveenbadoni
Copy link
Author

Hi @nmred, Can you please guide me where i am going wrong.

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

No branches or pull requests

2 participants