We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a83ede2 commit 767fb4cCopy full SHA for 767fb4c
1 file changed
src/Protocols/Amqp.php
@@ -82,15 +82,21 @@ public function disconnect(): void
82
* @throws \AMQPChannelException
83
* @throws \AMQPConnectionException
84
* @throws \AMQPExchangeException
85
+ * @throws \AMQPException
86
*/
87
public function send(string $destination, string $message, array $settings = []): bool
88
{
89
$this->checkConnection();
90
91
$exchange = new AMQPExchange($this->channel);
- $exchange->setName($destination);
92
93
- return $exchange->publish($message, null, AMQP_NOPARAM, $settings);
+ $result = $exchange->publish($message, $destination, AMQP_NOPARAM, $settings);
94
+
95
+ if (!$result) {
96
+ throw new \AMQPException('Failed to publish content.');
97
+ }
98
99
+ return $result;
100
}
101
102
/**
0 commit comments