Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
ConsumerMessageInterface::getNums()
to change the number of a…
…mqp consumer by dynamically. (#4909) Co-authored-by: 李铭昕 <715557344@qq.com>
- Loading branch information
1 parent
13ab808
commit 8b67301
Showing
7 changed files
with
94 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Hyperf. | ||
* | ||
* @link https://www.hyperf.io | ||
* @document https://hyperf.wiki | ||
* @contact group@hyperf.io | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
namespace HyperfTest\Amqp\Stub; | ||
|
||
use Hyperf\Amqp\Message\ConsumerMessage; | ||
use Hyperf\Amqp\Result; | ||
|
||
class NumsConsumer extends ConsumerMessage | ||
{ | ||
protected string $exchange = 'hyperf'; | ||
|
||
protected array|string $routingKey = [ | ||
'hyperf1', | ||
'hyperf2', | ||
]; | ||
|
||
protected ?string $queue = 'hyperf'; | ||
|
||
public function consume($data): string | ||
{ | ||
return Result::ACK; | ||
} | ||
|
||
public function getNums(): int | ||
{ | ||
return 10; | ||
} | ||
} |