We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<?php declare(strict_types=1); namespace App\Amqp\Producer; use Hyperf\Amqp\Message\ProducerMessage; use Hyperf\Amqp\Annotation\Producer; /** * @Producer(exchange="ex.priority", routingKey="priority", exchangeType="direct", durable=true) */ class SmsProducer extends ProducerMessage { public function __construct($priority, $message) { $this->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); } }
The text was updated successfully, but these errors were encountered:
You can try removed annotation #[Producer] from you class.
#[Producer]
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: