Skip to content

[dbal] Use concurrent fetch message approach (no transaction, no pessimistic lock) #613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use uuid v4 to prevent collisions
  • Loading branch information
makasim committed Nov 6, 2018
commit 2445ef2bed312b6bc01a4efffd1ae6eca4bd4730
2 changes: 1 addition & 1 deletion pkg/dbal/DbalConsumerHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function fetchMessage(array $queues, int $redeliveryDelay): ?DbalMessa
}

$now = time();
$deliveryId = Uuid::uuid1();
$deliveryId = Uuid::uuid4();

$endAt = microtime(true) + 0.2; // add 200ms

Expand Down
2 changes: 1 addition & 1 deletion pkg/dbal/DbalProducer.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function send(Destination $destination, Message $message): void
}

$body = $message->getBody();
$uuid = Uuid::uuid1();
$uuid = Uuid::uuid4();

$publishedAt = null !== $message->getPublishedAt() ?
$message->getPublishedAt() :
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbal/Tests/DbalConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testAcknowledgeShouldThrowIfInstanceOfMessageIsInvalid()

public function testShouldDeleteMessageOnAcknowledge()
{
$deliveryId = Uuid::uuid1();
$deliveryId = Uuid::uuid4();

$queue = new DbalDestination('queue');

Expand Down Expand Up @@ -127,7 +127,7 @@ public function testRejectShouldThrowIfInstanceOfMessageIsInvalid()

public function testShouldDeleteMessageFromQueueOnReject()
{
$deliveryId = Uuid::uuid1();
$deliveryId = Uuid::uuid4();

$queue = new DbalDestination('queue');

Expand Down