diff --git a/src/support/src/Bus/PendingAsyncQueueDispatch.php b/src/support/src/Bus/PendingAsyncQueueDispatch.php index 50aa8cf8e..e206c4c90 100644 --- a/src/support/src/Bus/PendingAsyncQueueDispatch.php +++ b/src/support/src/Bus/PendingAsyncQueueDispatch.php @@ -20,7 +20,7 @@ class PendingAsyncQueueDispatch { use Conditionable; - public string $pool = 'default'; + public ?string $pool = null; public int $delay = 0; @@ -32,7 +32,7 @@ public function __destruct() { ApplicationContext::getContainer() ->get(DriverFactory::class) - ->get($this->pool) + ->get($this->pool ?? 'default') ->push($this->job, $this->delay); } diff --git a/src/support/src/Bus/PendingKafkaProducerMessageDispatch.php b/src/support/src/Bus/PendingKafkaProducerMessageDispatch.php index 8ce23e4d9..13671f111 100644 --- a/src/support/src/Bus/PendingKafkaProducerMessageDispatch.php +++ b/src/support/src/Bus/PendingKafkaProducerMessageDispatch.php @@ -26,7 +26,7 @@ class PendingKafkaProducerMessageDispatch { use Conditionable; - public string $pool = 'default'; + public ?string $pool = null; public function __construct(protected ProduceMessage $message) { @@ -36,7 +36,7 @@ public function __destruct() { ApplicationContext::getContainer() ->get(ProducerManager::class) - ->getProducer($this->pool) + ->getProducer($this->pool ?? 'default') ->sendBatch([$this->message]); } diff --git a/tests/Support/DispatchTest.php b/tests/Support/DispatchTest.php index b2d615ebd..1360d01f0 100644 --- a/tests/Support/DispatchTest.php +++ b/tests/Support/DispatchTest.php @@ -447,7 +447,7 @@ public function testBackwardCompatibilityWithBasicDispatch() $pending = dispatch($job); // Verify defaults - $this->assertEquals('default', $this->getProperty($pending, 'pool')); + $this->assertNull($this->getProperty($pending, 'pool')); $this->assertEquals(0, $this->getProperty($pending, 'delay')); // Trigger destruct