Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handling publish subscribe fanout #15

Open
xtwoend opened this issue May 11, 2022 · 0 comments
Open

handling publish subscribe fanout #15

xtwoend opened this issue May 11, 2022 · 0 comments

Comments

@xtwoend
Copy link

xtwoend commented May 11, 2022

hyperf is awesome framework but i have problem when using amqp on rabbitmq, when i want to use fanout in Publish/Subscribe implementation but when doing queue_declare queue name cannot be null.

/**
 * @Consumer(exchange="broadcast", routingKey="", queue="", name="SubribeMessage", nums=1)
 */
#[Consumer(exchange: 'broadcast', routingKey: '', queue: '', name: "SubribeMessage", nums: 1)]
class SubribeMessage extends ConsumerMessage
{
    protected $type = Type::FANOUT;

    public function consumeMessage($data, AMQPMessage $message): string
    {
        var_dump($data);
        return Result::ACK;
    }
}

 public function setQueue(string $queue): self
    {
        $this->queue = $queue;
        return $this;
    }

    public function getQueue(): string
    {
        return $this->queue;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant