Commit 20d6abcd authored by hangjun83's avatar hangjun83

openapi

parent ad77866d
...@@ -64,11 +64,13 @@ class KafkaService ...@@ -64,11 +64,13 @@ class KafkaService
$consumer = $message->getConsumer(); $consumer = $message->getConsumer();
$kafkaMessage = json_decode($message->getValue(),true); $kafkaMessage = json_decode($message->getValue(),true);
try{ if(!empty($kafkaMessage)){
app($kafkaMessage['consumer'])->{$kafkaMessage['method']}($kafkaMessage['params']); try{
$consumer->ack($message); // 手动提交 app($kafkaMessage['consumer'])->{$kafkaMessage['method']}($kafkaMessage['params']);
}catch(\Exception $exception){ $consumer->ack($message); // 手动提交
$this->errLog($exception); }catch(\Exception $exception){
$this->errLog($exception);
}
} }
$consumer->stop(); $consumer->stop();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment