Skip to content

Allow configurable correlatorId generation in RpcClient #637

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

Closed
janssk1 opened this issue Jan 29, 2020 · 3 comments
Closed

Allow configurable correlatorId generation in RpcClient #637

janssk1 opened this issue Jan 29, 2020 · 3 comments

Comments

@janssk1
Copy link

janssk1 commented Jan 29, 2020

The RpcClient class has a hardcoded algorithm for unique correlatorId generation. This works in most cases. However, i recently hit an issue where the 'correlatorId' was used (or misused) to encode some extra information needed by the receiver. It would be great if the RpcClient could be configured with a 'strategy' to generate unqiue correlatorIds.
Alternatively, the RpcClient should not touch the correlatorId if it is already provided in the arguments.

  • RabbitMQ client version
    5.8.0
@michaelklishin
Copy link
Contributor

This sounds like a great opportunity to contribute. This is open-source software after all ;)

@acogoluegnes
Copy link
Contributor

This should be easy to add in a non-breaking way, especially now there's a RpcClient constructor with RpcClientParams. We've already done that in the Reactor extension, with a Supplier<String> to create the correlation ids.

A contribution would be indeed welcome.

@acogoluegnes
Copy link
Contributor

acogoluegnes commented Feb 17, 2020

Fixed in #638.

acogoluegnes added a commit that referenced this issue Feb 17, 2020
acogoluegnes added a commit that referenced this issue Feb 17, 2020
References #637

(cherry picked from commit 96b24b3)

Conflicts:
	src/main/java/com/rabbitmq/client/RpcClient.java
	src/main/java/com/rabbitmq/client/RpcClientParams.java
	src/test/java/com/rabbitmq/client/test/RpcTest.java
acogoluegnes added a commit that referenced this issue Feb 17, 2020
acogoluegnes added a commit that referenced this issue Feb 17, 2020
References #637

(cherry picked from commit 52c0643)
acogoluegnes added a commit that referenced this issue Feb 17, 2020
References #637
@acogoluegnes acogoluegnes added this to the 5.9.0 milestone Feb 17, 2020
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