You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 10, 2022. It is now read-only.
class Kafka extends Component
{
public $url;
public function logger($topic, $value){
//$logger = new Logger('my_logger');
//$logger->pushHandler(new StdoutHandler());
$config = \Kafka\ProducerConfig::getInstance();
//$config->setMetadataRefreshIntervalMs(10000);
$config->setMetadataBrokerList($this->url);
//$config->setBrokerVersion('1.0.0');
//$config->setRequiredAck(1);
$config->setIsAsyn(false);
//$config->setProduceInterval(500);
$producer = new \Kafka\Producer(
function() use ($topic, $value) {
return [
[
'topic' => $topic,
'value' => $value,
],
];
}
);
// $producer->setLogger($logger);
/* $producer->success(function($result) {
var_dump($result);
});
$producer->error(function($errorCode) {
// var_dump($errorCode);
});*/
$producer->send(true);
...
$resp = \Yii::$app->kafka->logger('sendMails', json_encode($kafka));
We had some troubles when using sync requests after pushing first msg our producer cyclically sends and "ddos" our consumer. Only restart help.
When we use async requests after send first msg consumer get it normaly first time, when we send next msg consumer get first msg and stop working.
What we do wrong?
P.S.
As you see we use Kafka 1.0.0.0. PHP 7.1
Consumers on Java
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, we use this code for logging email delivery.
We had some troubles when using sync requests after pushing first msg our producer cyclically sends and "ddos" our consumer. Only restart help.
When we use async requests after send first msg consumer get it normaly first time, when we send next msg consumer get first msg and stop working.
What we do wrong?
P.S.
As you see we use Kafka 1.0.0.0. PHP 7.1
Consumers on Java
The text was updated successfully, but these errors were encountered: