8000 [Messenger] Add a middleware that wraps all handlers in one Doctrine transaction. by Nyholm · Pull Request #26647 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] Add a middleware that wraps all handlers in one Doctrine transaction. #26647

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

Closed
wants to merge 24 commits into from
Closed
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
Next Next commit
cs and minors
  • Loading branch information
Nyholm committed Mar 27, 2018
commit 09e5daf988decda2f70e3bb07962d67942671b80
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder

if ($config['doctrine_transaction']['enabled']) {
if (!class_exists(DoctrineTransactionMiddleware::class)) {
throw new LogicException('You must install symfony/doctrine-bridge to use the "DoctrineTransactionMiddleware"');
throw new LogicException('The Doctrine transaction middleware is only available when the doctrine bridge is installed. Try running "composer require symfony/doctrine-bridge".');
}
$container->getDefinition('messenger.middleware.doctrine_transaction')->replaceArgument(1, $config['doctrine_transaction']['entity_manager_name']);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,7 @@
</xsd:complexType>

<xsd:complexType name="messenger_doctrine_transaction">
<xsd:sequence>
<xsd:element name="entity-manager-name" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="entity-manager-name" type="xsd:string" />
<xsd:attribute name="enabled" type="xsd:boolean" />
</xsd:complexType>
</xsd:schema>
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<framework:config>
<framework:messenger>
<framework:routing message-class="App\Bar">
<framework:sender service="sender.bar"></framework:sender>
<framework:sender service="sender.biz"></framework:sender>
<framework:sender service="sender.bar" />
<framework:sender service="sender.biz" />
</framework:routing>
<framework:routing message-class="App\Foo">
<framework:sender service="sender.foo"></framework:sender>
<framework:sender service="sender.foo" />
</framework:routing>
</framework:messenger>
</framework:config>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

<framework:config>
<framework:messenger>
<framework:doctrine-transaction>
<framework:entity-manager-name>foobar</framework:entity-manager-name>
</framework:doctrine-transaction>
<framework:doctrine-transaction entity-manager-name="foobar" />
</framework:messenger>
</framework:config>
</container>
0