Skip to content

Conversation

@acogoluegnes
Copy link
Contributor

Fixes #219

* Exception thrown when a channel times out on a RPC call.
* @since 4.1.0
*/
public class ChannelRpcTimeoutException extends IOException {
Copy link
Contributor

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;
Copy link
Contributor

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?

@acogoluegnes acogoluegnes changed the title DO NOT MERGE Add configurable timeout on RPC calls Add configurable timeout on RPC calls Dec 1, 2016
@michaelklishin michaelklishin self-assigned this Dec 3, 2016
/**
* The channel that performed the call.
*/
private final Object channel;
Copy link
Contributor

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?

Copy link
Contributor Author

@acogoluegnes acogoluegnes Dec 5, 2016

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 Channel property in the exception and casting the AMQChannel to Channel when throwing the exception. We risk in theory a ClassCastException.
  • having an AMQChannel property 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.

Copy link
Contributor

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).

@michaelklishin michaelklishin merged commit a8930cc into master Dec 5, 2016
@acogoluegnes acogoluegnes deleted the rabbitmq-java-client-219 branch March 21, 2019 08:24
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.

3 participants