Skip to content

Commit e6ba3a5

Browse files
committed
bug #39674 [Messenger] fix postgres transport when the retry table is the same (lyrixx)
This PR was merged into the 5.1 branch. Discussion ---------- [Messenger] fix postgres transport when the retry table is the same | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | --- I noticed messenger do not consume all messages when there is a retry and when I'm using only one table for everything. To reproduce, use the following configuration + use PG + throw an exception in the handler ```yaml framework: messenger: failure_transport: failed transports: async: '%env(MESSENGER_TRANSPORT_DSN)%' failed: 'doctrine://default?queue_name=failed' routing: 'App\Message\Foobar': async ``` The real issue is PG does not notify messenger when we `UPDATE` the message. --- ping @dunglas Commits ------- 2b4d471 fix postgres transport when the retry table is the same
2 parents 46ea622 + 2b4d471 commit e6ba3a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function getTriggerSql(): array
123123
, $this->configuration['table_name']),
124124
// register trigger
125125
sprintf('DROP TRIGGER IF EXISTS notify_trigger ON %s;', $this->configuration['table_name']),
126-
sprintf('CREATE TRIGGER notify_trigger AFTER INSERT ON %1$s FOR EACH ROW EXECUTE PROCEDURE notify_%1$s();', $this->configuration['table_name']),
126+
sprintf('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON %1$s FOR EACH ROW EXECUTE PROCEDURE notify_%1$s();', $this->configuration['table_name']),
127127
'COMMIT;',
128128
];
129129
}

0 commit comments

Comments
 (0)