hyperf / hyperf/amqp

hi, hyperf is awesome framework im so thankful, but i have issue when produce message on RabbitMQ, i dont wanna re-declear exchange and queue

Open
#20 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
23
Forks
16
PR merge metrics
No merged PRs in 30d

Description

```
payload = $message;
$this->setRoutingKey('priority' . $priority);
$this->setExchange('ex.priority.' . $priority);
$this->setType('direct');
}

public function getExchange(): string
{
return 'ex.priority.' . $this->getRoutingKeySuffix();
}

public function getRoutingKey(): string
{
return 'priority' . $this->getRoutingKeySuffix();
}

public function getQueue(): string
{
return 'q.priority.' . $this->getRoutingKeySuffix();
}

private function getRoutingKeySuffix(): string
{
return substr($this->routingKey, -1);
}

public function buildExchange(): void
{
// return (new ExchangeBuilder())
// ->withName($this->getExchange())
// ->withType('direct')
// ->withDurable(true);
}

public function buildQueue(): void
{
// return (new QueueBuilder())
// ->withName($this->getQueue())
// ->withDurable(true);
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.