diff --git a/src/Rejection.php b/src/Rejection.php index f7f6859..5842026 100644 --- a/src/Rejection.php +++ b/src/Rejection.php @@ -72,7 +72,8 @@ public static function withAuthentication( public function reject(object|array $rejection, ?\Throwable $exception = null): void { - $this->channel->publish( + $this->connection->publish( + $this->channel->getChannelId(), json_encode([ 'item' => $rejection, 'exception' => $exception, @@ -84,6 +85,8 @@ public function reject(object|array $rejection, ?\Throwable $exception = null): $this->exchange, $this->topic, ); + + $this->connection->run(0); } public function initialize(): void