Commit 20d6abcd authored by hangjun83's avatar hangjun83

openapi

parent ad77866d
...@@ -64,12 +64,14 @@ class KafkaService ...@@ -64,12 +64,14 @@ class KafkaService
$consumer = $message->getConsumer(); $consumer = $message->getConsumer();
$kafkaMessage = json_decode($message->getValue(),true); $kafkaMessage = json_decode($message->getValue(),true);
if(!empty($kafkaMessage)){
try{ try{
app($kafkaMessage['consumer'])->{$kafkaMessage['method']}($kafkaMessage['params']); app($kafkaMessage['consumer'])->{$kafkaMessage['method']}($kafkaMessage['params']);
$consumer->ack($message); // 手动提交 $consumer->ack($message); // 手动提交
}catch(\Exception $exception){ }catch(\Exception $exception){
$this->errLog($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