Skip to content

Commit bb26a92

Browse files
committed
add missing queue_name to find(id) in doctrine messenger transport
1 parent ffc34fa commit bb26a92

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ public function testFind()
284284
->willReturn($queryBuilder);
285285
$queryBuilder
286286
->method('where')
287+
->with('m.id = ? and m.queue_name = ?')
287288
->willReturn($queryBuilder);
288289
$queryBuilder
289290
->method('getSQL')

src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ public function findAll(int $limit = null): array
291291
public function find($id): ?array
292292
{
293293
$queryBuilder = $this->createQueryBuilder()
294-
->where('m.id = ?');
294+
->where('m.id = ? and m.queue_name = ?');
295295

296-
$stmt = $this->executeQuery($queryBuilder->getSQL(), [$id]);
296+
$stmt = $this->executeQuery($queryBuilder->getSQL(), [$id, $this->configuration['queue_name']]);
297297
$data = $stmt instanceof Result || $stmt instanceof DriverResult ? $stmt->fetchAssociative() : $stmt->fetch();
298298

299299
return false === $data ? null : $this->decodeEnvelopeHeaders($data);

0 commit comments

Comments
 (0)