Comments (1)
What if RetryableResource#handleCommonMethods
will return Object
and not void, and add the common method "isOpen" with a return value
Object handleCommonMethods(Object delegate, Method method, Object[] args) throws Throwable {
if ("abort".equals(method.getName()) || "close".equals(method.getName())) {
try {
Reflection.invoke(delegate, method, args);
return true;
} finally {
closed = true;
afterClosure();
interruptWaiters();
}
} else if ("isOpen".equals(method.getName()))
return Reflection.invoke(delegate, method, args);
else if ("addShutdownListener".equals(method.getName()) && args[0] != null)
shutdownListeners.add((ShutdownListener) args[0]);
else if ("removeShutdownListener".equals(method.getName()) && args[0] != null)
shutdownListeners.remove((ShutdownListener) args[0]);
return null;
}
and in the ChannelHandler#invoke method:
@Override
public Object invoke(Object ignored, final Method method, final Object[] args) throws Throwable {
Object result = handleCommonMethods(delegate, method, args);
if (result != null)
return result;
if (closed && method.getDeclaringClass().isAssignableFrom(Channel.class))
throw new AlreadyClosedException(delegate.getCloseReason());
.......
It seems to work, and handles the isOpen()
after close()
.
Also, handles calling close()
after a close()
throws en exception.
But, I cant change the ChannelHandlerTest#shouldThrowOnAlreadyClosedChannelInvocation
to throw the exception.
any ideas?
from lyra.
Related Issues (20)
- Reconnection after RabbitMQ shutdown is not successful HOT 5
- when java.net.UnknownHostException is thrown the recovery failed
- What about moving to the latest 'amqp-client' version?
- Forgotten copying of automaticRecovery in ConnectionOptions.copy() HOT 1
- Documentation on ConnectionFactory used in ConnectionOptions HOT 2
- support withUri() in ConnectionOptions HOT 5
- Moving to latest RabbitMQ Java Client 4.0 HOT 5
- Why to copy ConnectionFactory on each create HOT 7
- No communication after recovery HOT 4
- Consumers not getting messages after broker restart HOT 8
- Connection name is not passed HOT 8
- RabbitMQ flooded by new connections HOT 5
- Lyra recover mechanism can prevent from the JVM to shutdown HOT 6
- Get rid of static executor service HOT 2
- Rapid growth of connections when network conditions are unreliable HOT 3
- retryableExceptions configuration and implementation HOT 3
- Use a `Predicate` for retry exception strategy
- Getting Rabbitmq HeartBeat Exception HOT 3
- Lyra is no longer under active development. HOT 1
- Connection recovery fails and gives up even though recovery policy is recoverAlways() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lyra.