This commit is contained in:
34
app/Amqp/Consumer/AliSlsConsumer.php
Normal file
34
app/Amqp/Consumer/AliSlsConsumer.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Amqp\Consumer;
|
||||
|
||||
use App\Service\AliLogsSignService;
|
||||
use Hyperf\Amqp\Result;
|
||||
use Hyperf\Amqp\Annotation\Consumer;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2025/6/3
|
||||
* Time: 下午7:18
|
||||
* Description: 阿里日志消费.
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
#[Consumer(exchange: 'wh_ali_sls', routingKey: 'wh_ali_sls_key', queue: 'wh_ali_sls_queue', name: "AliSlsConsumer", nums: 5)]
|
||||
class AliSlsConsumer extends BaseConsumer
|
||||
{
|
||||
#[Inject]
|
||||
protected AliLogsSignService $aliLogsSignService;
|
||||
public function handle($data): Result
|
||||
{
|
||||
$this->aliLogsSignService->putWebTracking($data);
|
||||
|
||||
return Result::ACK;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user