op:多节点监听异常抑制
This commit is contained in:
parent
4710f9c6ea
commit
dc2fccbc55
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace tm\xls\rocketMq\thinkphp\consumer;
|
||||
|
||||
use Exception;
|
||||
use React\EventLoop\Loop;
|
||||
use tm\xls\rocketMq\thinkphp\consumer\contract\ListenerInterface;
|
||||
use tm\xls\rocketMq\thinkphp\consumer\message\Message;
|
||||
|
@ -38,7 +39,12 @@ class Consumer
|
|||
]);
|
||||
if ($handler instanceof ListenerInterface) {
|
||||
if ($handler->enable()) {
|
||||
$handler->handle();
|
||||
try {
|
||||
$handler->handle();
|
||||
} catch (Exception $exception) {
|
||||
//todo 记录日志
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new ConsumerException('Consumer needs to implement ListenerInterface');
|
||||
|
|
Loading…
Reference in New Issue
Block a user