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

Add option to make RpcClient fail early if there are no bindings #417

Closed
janssk1 opened this issue Oct 23, 2018 · 4 comments
Closed

Add option to make RpcClient fail early if there are no bindings #417

janssk1 opened this issue Oct 23, 2018 · 4 comments
Assignees
Milestone

Comments

@janssk1
Copy link

janssk1 commented Oct 23, 2018

I have noticed that the RpcClient utiltity has no way of using the 'mandatory' flag.
I would like my RPC call to fail 'fast' in case nobody is listening to the request. Wihout it, i have to wait for the RPC to timeout.

  • RabbitMQ client version 5.5.0
@michaelklishin michaelklishin changed the title Add support for 'mandatory' delivery in RpcClient An option to make RpcClient fail early if there are no bindings Oct 23, 2018
@michaelklishin
Copy link
Member

A return handler can be registered and either throw/etc or do nothing depending on user-provided values. @acogoluegnes WDYT?

@acogoluegnes
Copy link
Contributor

This should be possible as-is:

  • register a ReturnListener to the Channel instance used for the creation of the RpcClient.
  • subclass RpcClient and override the publish method to publish with the mandatory flag set to true.

@michaelklishin
Copy link
Member

Arguably the key part here is the ReturnListener implementation. If we could come up with a reasonably opinionated implementation that can be used by default the users would appreciate it.

@acogoluegnes
Copy link
Contributor

It's straightforward to correlate the original blocking cell in the return listener, so we could unblock the blocking cell and throw an exception or do something else.

@acogoluegnes acogoluegnes self-assigned this Oct 23, 2018
@acogoluegnes acogoluegnes added this to the 4.10.0 milestone Oct 23, 2018
acogoluegnes added a commit that referenced this issue Oct 26, 2018
acogoluegnes added a commit that referenced this issue Oct 26, 2018
acogoluegnes added a commit that referenced this issue Oct 29, 2018
[#161476914]

Fixes #417

(cherry picked from commit 47caa43)
acogoluegnes added a commit that referenced this issue Oct 29, 2018
[#161476914]

Fixes #417

(cherry picked from commit 7f89b26)
acogoluegnes added a commit that referenced this issue Oct 29, 2018
[#161476914]

Fixes #417

(cherry picked from commit 47caa43)

Conflicts:
	src/main/java/com/rabbitmq/client/RpcClient.java
	src/test/java/com/rabbitmq/client/test/RpcTest.java
acogoluegnes added a commit that referenced this issue Oct 29, 2018
[#161476914]

Fixes #417

(cherry picked from commit 7f89b26)
acogoluegnes added a commit that referenced this issue Oct 29, 2018
acogoluegnes added a commit that referenced this issue Nov 6, 2018
acogoluegnes added a commit that referenced this issue Nov 6, 2018
[#161476914]

References #417

(cherry picked from commit 9993273)
@acogoluegnes acogoluegnes changed the title An option to make RpcClient fail early if there are no bindings Add option to make RpcClient fail early if there are no bindings Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants