-
Notifications
You must be signed in to change notification settings - Fork 586
Add configurable timeout on RPC calls #220
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
Conversation
| * Exception thrown when a channel times out on a RPC call. | ||
| * @since 4.1.0 | ||
| */ | ||
| public class ChannelRpcTimeoutException extends IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this to ChannelContinuation…. RPC will mislead those who use higher level libraries that may claim to support "RPC".
| public static final int DEFAULT_SHUTDOWN_TIMEOUT = 10000; | ||
|
|
||
| /** The default timeout for RPC calls in channels: no timeout */ | ||
| public static final int DEFAULT_CHANNEL_RPC_TIMEOUT = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we make it, say, 10 minutes instead of infinity?
| /** | ||
| * The channel that performed the call. | ||
| */ | ||
| private final Object channel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be Channel or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This exception is thrown from AMQChannel, which is not a Channel. There are several other solutions:
- having a
Channelproperty in the exception and casting theAMQChanneltoChannelwhen throwing the exception. We risk in theory aClassCastException. - having an
AMQChannelproperty in the exception, but the implementation leaks up to error handling. - having just the channel number and the connection in the exception, which should be enough to diagnose any error.
I think the third solution is a good compromise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a channel number field (we can keep the field we have with a comment).
Fixes #219