mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
Fixed amqp consumer does not works when using fanout exchange. (#2820)
* amqp 类型fanout情况下 routing_key不存在的情况 * Update CHANGELOG-2.0.md Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
parent
d5f7d289ad
commit
6a4fbc8044
@ -1,5 +1,9 @@
|
||||
# v2.0.20 - TBD
|
||||
|
||||
## Fixed
|
||||
|
||||
- [#2820](https://github.com/hyperf/hyperf/pull/2820) Fixed amqp consumer does not works when using fanout exchange.
|
||||
|
||||
# v2.0.19 - 2020-11-17
|
||||
|
||||
## Added
|
||||
|
@ -18,6 +18,7 @@ use Hyperf\Amqp\Event\WaitTimeout;
|
||||
use Hyperf\Amqp\Exception\MessageException;
|
||||
use Hyperf\Amqp\Message\ConsumerMessageInterface;
|
||||
use Hyperf\Amqp\Message\MessageInterface;
|
||||
use Hyperf\Amqp\Message\Type;
|
||||
use Hyperf\Amqp\Pool\PoolFactory;
|
||||
use Hyperf\Contract\ConfigInterface;
|
||||
use Hyperf\ExceptionHandler\Formatter\FormatterInterface;
|
||||
@ -132,6 +133,10 @@ class Consumer extends Builder
|
||||
$channel->queue_bind($message->getQueue(), $message->getExchange(), $routingKey);
|
||||
}
|
||||
|
||||
if (empty($routineKeys) && $message->getType() === Type::FANOUT) {
|
||||
$channel->queue_bind($message->getQueue(), $message->getExchange());
|
||||
}
|
||||
|
||||
if (is_array($qos = $message->getQos())) {
|
||||
$size = $qos['prefetch_size'] ?? null;
|
||||
$count = $qos['prefetch_count'] ?? null;
|
||||
|
Loading…
Reference in New Issue
Block a user