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

GH-723: Add AmqpResourceNotAvailableException #737

Merged
merged 2 commits into from
Apr 3, 2018

Conversation

artembilan
Copy link
Member

Fixes #723

To avoid an NPE when connection returns null for the
createChannel() in case of channelMax is reached, throw newly
introduced AmqpResourceNotAvailableException.
This exception can be used in the RetryPolicy to retry the original
operation after some back-off - the channel permit may be released in
between

Cherry-pick to 2.0.x and 1.7.x

Fixes spring-projects#723

To avoid an `NPE` when connection returns `null` for the
`createChannel()` in case of `channelMax` is reached, throw newly
introduced `AmqpResourceNotAvailableException`.
This exception can be used in the `RetryPolicy` to retry the original
operation after some back-off - the channel permit may be released in
between

**Cherry-pick to 2.0.x and 1.7.x**
@garyrussell
Copy link
Contributor

Travis failed


org.springframework.amqp.rabbit.connection.CachingConnectionFactoryTests > testCloseInvalidConnection FAILED
    org.springframework.amqp.AmqpResourceNotAvailableException
org.springframework.amqp.rabbit.connection.SingleConnectionFactoryTests > testCloseInvalidConnection FAILED
    org.springframework.amqp.AmqpResourceNotAvailableException

Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's all (except the travis failures).

@@ -377,6 +377,9 @@ Starting with _version 2.0.2_, the `RabbitTemplate` has a configuration option t
See <<separate-connection>> for more information.
The `ConnectionNameStrategy` for the publisher connection is the same as the primary strategy with `.publisher` appended to the result of calling the method.

Starting with _version 1.7.7_, an `AmqpResourceNotAvailableException` is provided, which is thrown now when `SimpleConnection.createChannel()` can't create a `Channel` because a `channelMax` limit is reached.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/can't create a Channel because a channelMax limit is reached./can't create a Channel, for example, because the channelMax limit is reached and there are no available channels in the cache./

* Fix `amqp.adoc` according PR comments
@garyrussell garyrussell merged commit 6f72cf6 into spring-projects:master Apr 3, 2018
garyrussell pushed a commit that referenced this pull request Apr 3, 2018
* GH-723: Add AmqpResourceNotAvailableException

Fixes #723

To avoid an `NPE` when connection returns `null` for the
`createChannel()` in case of `channelMax` is reached, throw newly
introduced `AmqpResourceNotAvailableException`.
This exception can be used in the `RetryPolicy` to retry the original
operation after some back-off - the channel permit may be released in
between

**Cherry-pick to 2.0.x and 1.7.x**

* * Fix `AbstractConnectionFactoryTests` for proper mock
* Fix `amqp.adoc` according PR comments
garyrussell pushed a commit that referenced this pull request Apr 3, 2018
* GH-723: Add AmqpResourceNotAvailableException

Fixes #723

To avoid an `NPE` when connection returns `null` for the
`createChannel()` in case of `channelMax` is reached, throw newly
introduced `AmqpResourceNotAvailableException`.
This exception can be used in the `RetryPolicy` to retry the original
operation after some back-off - the channel permit may be released in
between

**Cherry-pick to 2.0.x and 1.7.x**

* * Fix `AbstractConnectionFactoryTests` for proper mock
* Fix `amqp.adoc` according PR comments
@garyrussell
Copy link
Contributor

...and cherry-picked to 2.0.x and 1.7.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants