diff --git a/src/helpers.php b/src/helpers.php index 140d618..e22bdca 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -18,7 +18,7 @@ function sync_publish(FastBuilder $builder, string $body, ?array $headers = null { $message = $builder->getMessage(); if( - ($message->getExchangeType() !== Constants::DELAYED and $headers['x-delay'] ?? 1) or + ($message->getExchangeType() !== Constants::DELAYED and $headers['x-delay'] ?? 0) or ($message->getExchangeType() === Constants::DELAYED and !($headers['x-delay'] ?? 0)) ){ throw new WebmanRabbitMQException('Invalid publish. '); @@ -42,7 +42,7 @@ function async_publish(FastBuilder $builder, string $body, ?array $headers = nul { $message = $builder->getMessage(); if( - ($message->getExchangeType() !== Constants::DELAYED and $headers['x-delay'] ?? 1) or + ($message->getExchangeType() !== Constants::DELAYED and $headers['x-delay'] ?? 0) or ($message->getExchangeType() === Constants::DELAYED and !($headers['x-delay'] ?? 0)) ){ throw new WebmanRabbitMQException('Invalid publish. ');