-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* 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
- Loading branch information
1 parent
6498219
commit f69f54e
Showing
5 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
spring-amqp/src/main/java/org/springframework/amqp/AmqpResourceNotAvailableException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2018 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.amqp; | ||
|
||
/** | ||
* The {@link AmqpException} thrown when some resource can't be accessed. | ||
* For example when {@code channelMax} limit is reached and connect can't | ||
* create a new channel at the moment. | ||
* | ||
* @author Artem Bilan | ||
* | ||
* @since 1.7.7 | ||
*/ | ||
public class AmqpResourceNotAvailableException extends AmqpException { | ||
|
||
public AmqpResourceNotAvailableException(String message) { | ||
super(message); | ||
} | ||
|
||
public AmqpResourceNotAvailableException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
public AmqpResourceNotAvailableException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters