Skip to content

Commit

Permalink
[dbal] Consumer never fetches messages ordered by published time
Browse files Browse the repository at this point in the history
  • Loading branch information
f7h committed Jan 22, 2018
1 parent b0b1ad3 commit 91ae4cc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/dbal/DbalContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function createDataBaseTable()
$table->addColumn('properties', 'text', ['notnull' => false]);
$table->addColumn('redelivered', 'boolean', ['notnull' => false]);
$table->addColumn('queue', 'string');
$table->addColumn('priority', 'smallint');
$table->addColumn('priority', 'smallint', ['notnull' => false]);
$table->addColumn('delayed_until', 'integer', ['notnull' => false]);
$table->addColumn('time_to_live', 'integer', ['notnull' => false]);

Expand Down
2 changes: 1 addition & 1 deletion pkg/dbal/DbalMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct($body = '', array $properties = [], array $headers =
$this->properties = $properties;
$this->headers = $headers;
$this->redelivered = false;
$this->priority = 0;
$this->priority = null;
$this->deliveryDelay = null;
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/dbal/Tests/DbalContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testShouldCreateMessage()
$this->assertEquals('body', $message->getBody());
$this->assertEquals(['pkey' => 'pval'], $message->getProperties());
$this->assertEquals(['hkey' => 'hval'], $message->getHeaders());
$this->assertSame(0, $message->getPriority());
$this->assertNull($message->getPriority());
$this->assertFalse($message->isRedelivered());
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/dbal/Tests/DbalMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public function testCouldBeConstructedWithOptionalArguments()
$this->assertSame(['fooHeader' => 'fooHeaderVal'], $message->getHeaders());
}

public function testShouldSetPriorityToZeroInConstructor()
public function testShouldSetPriorityToNullInConstructor()
{
$message = new DbalMessage();

$this->assertSame(0, $message->getPriority());
$this->assertNull($message->getPriority());
}

public function testShouldSetDelayToNullInConstructor()
Expand Down

0 comments on commit 91ae4cc

Please sign in to comment.