Skip to content
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

[Messenger] Added transport agnostic exception #30375

Merged
merged 5 commits into from Mar 4, 2019
Merged

Conversation

lolmx
Copy link
Contributor

@lolmx lolmx commented Feb 25, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Tests pass? yes
Fixed tickets #30346
License MIT
Doc PR TODO

As described in #30346, client code shouldn't care about which transport is currently used by the message bus. This pr adds a new generic exception that is thrown by the AmqpSender if the message couldn't be delivered.

@kunicmarko20
Copy link

Should it also be added here:

https://github.com/symfony/messenger/blob/0c0e9cfc2fd50a5b6e242204c80855f2f385f9cb/Transport/AmqpExt/AmqpReceiver.php#L70 ?

Didn't check what exception can occur here but I guess it should be consistent.

@lolmx
Copy link
Contributor Author

lolmx commented Feb 27, 2019

I added a catch block whenever the $this->connection->ack($AMQPEnvelope); fails in the receiver, and surrounded $this->connection->reject($AMQPEnvelope); & $this->connection->nack($AMQPEnvelope); because they can fail too.

I did not alter this throw because it's not transport-related.

Although this one is related to transport, I choose to not trow a TransportException because it's an exception manually raised by client code, thus I let client do his stuff :)

@fabpot
Copy link
Member

fabpot commented Mar 3, 2019

Can you rebase your pull request on current master? You merged master and it makes the PR non-mergeable. thank you.

@lolmx
Copy link
Contributor Author

lolmx commented Mar 4, 2019

My bad, here it is :)

@lolmx
Copy link
Contributor Author

lolmx commented Mar 4, 2019

I checked tests errors, it's Component/Debug and Bundle/FrameworkBundle, which are failing on upstream/master too

@fabpot
Copy link
Member

fabpot commented Mar 4, 2019

Thank you @lolmx.

@fabpot fabpot merged commit 7d6a3fa into symfony:master Mar 4, 2019
fabpot added a commit that referenced this pull request Mar 4, 2019
…vnk, lolmx)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Added transport agnostic exception

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30346
| License       | MIT
| Doc PR        | TODO

As described in #30346, client code shouldn't care about which transport is currently used by the message bus. This pr adds a new generic exception that is thrown by the `AmqpSender` if the message couldn't be delivered.

Commits
-------

7d6a3fa Updated changelog to document changes in AmqpReceiver
62a08ee Updated exception message in AmqpSender, updated AmqpReceiver to throw new TransportException
b2b0640 Chain new exception with previous one
06c8404 forgot one backslash, my bad
93c1001 [Messenger] Added new TransportException which is thrown if transport could not send a message
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
@fabpot fabpot mentioned this pull request May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants