Skip to content

Commit 91ae4cc

Browse files
committed
[dbal] Consumer never fetches messages ordered by published time
1 parent b0b1ad3 commit 91ae4cc

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎pkg/dbal/DbalContext.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function createDataBaseTable()
178178
$table->addColumn('properties', 'text', ['notnull' => false]);
179179
$table->addColumn('redelivered', 'boolean', ['notnull' => false]);
180180
$table->addColumn('queue', 'string');
181-
$table->addColumn('priority', 'smallint');
181+
$table->addColumn('priority', 'smallint', ['notnull' => false]);
182182
$table->addColumn('delayed_until', 'integer', ['notnull' => false]);
183183
$table->addColumn('time_to_live', 'integer', ['notnull' => false]);
184184

‎pkg/dbal/DbalMessage.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct($body = '', array $properties = [], array $headers =
5252
$this->properties = $properties;
5353
$this->headers = $headers;
5454
$this->redelivered = false;
55-
$this->priority = 0;
55+
$this->priority = null;
5656
$this->deliveryDelay = null;
5757
}
5858

‎pkg/dbal/Tests/DbalContextTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testShouldCreateMessage()
5959
$this->assertEquals('body', $message->getBody());
6060
$this->assertEquals(['pkey' => 'pval'], $message->getProperties());
6161
$this->assertEquals(['hkey' => 'hval'], $message->getHeaders());
62-
$this->assertSame(0, $message->getPriority());
62+
$this->assertNull($message->getPriority());
6363
$this->assertFalse($message->isRedelivered());
6464
}
6565

‎pkg/dbal/Tests/DbalMessageTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public function testCouldBeConstructedWithOptionalArguments()
2727
$this->assertSame(['fooHeader' => 'fooHeaderVal'], $message->getHeaders());
2828
}
2929

30-
public function testShouldSetPriorityToZeroInConstructor()
30+
public function testShouldSetPriorityToNullInConstructor()
3131
{
3232
$message = new DbalMessage();
3333

34-
$this->assertSame(0, $message->getPriority());
34+
$this->assertNull($message->getPriority());
3535
}
3636

3737
public function testShouldSetDelayToNullInConstructor()

0 commit comments

Comments
 (0)