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

Binding arguments are not set #147

Closed
kwispel0 opened this issue Feb 14, 2019 · 9 comments
Closed

Binding arguments are not set #147

kwispel0 opened this issue Feb 14, 2019 · 9 comments

Comments

@kwispel0
Copy link

kwispel0 commented Feb 14, 2019

I am using hop to configure our RabbitMQ exchanges and queues. Everything is working fine, except exchange-to-exchange bindings. The arguments do not seem to be set when applying declareExchange.

The following example demonstrates the issue I am seeing:

Client client = new Client("http://localhost:15672/api/", "admin", "admin");

client.declareExchange("my_vhost", "e1", new ExchangeInfo("headers", true, false));
client.declareExchange("my_vhost", "e2", new ExchangeInfo("fanout", true, false));

client.bindExchange("my_vhost", "e2", "e1", "#", ImmutableMap.of("my_identifier", "abc"));

Here, I first declare two exchanges e1 (a headers exchange) and e2 (a fanout exchange). Then, I want to bind e1 -> e2 with the header mapping my_identifier to abc. The exchanges are created as expected, but the property my_identifier in the binding does not seem to be set. I verified this by going to the management interface.

When creating these exchanges and binding manually in the management interface, everything is working fine.

RabbitMQ broker: 3.7.11
http-client: 3.1.0-RELEASE

@michaelklishin
Copy link
Member

Looks like the issue is as trivial as this: the body key used to pass arguments is args in Hop and expected to be arguments in the HTTP API. Please submit a PR with a test?

@kwispel0
Copy link
Author

kwispel0 commented Feb 14, 2019

Right, I came to the same conclusion after trying to invoke the HTTP API manually via curl. Thank you for investigating on your behalf.

I will submit a PR.

Note to self: this also applies to https://github.com/rabbitmq/hop/blob/master/src/main/java/com/rabbitmq/http/client/Client.java#L669

@kwispel0
Copy link
Author

kwispel0 commented Feb 14, 2019

I am sorry, I have to correct myself. I won't be able to work on this in the intermediate future, as my Groovy skills are basically non-existing. I currently don't have much time to invest in getting some basic Groovy knowledge.

I might be able to take this up somewhere in the beginning of March, but I would rather not promise anything as of now.

@michaelklishin
Copy link
Member

I pushed a fix without any tests since it's a pretty trivial typo. @acogoluegnes should we reopen to add a test?

@kwispel0
Copy link
Author

@michaelklishin
Copy link
Member

The typo was introduced 4 years ago in b0e3cf0 :)

michaelklishin added a commit that referenced this issue Feb 14, 2019
@acogoluegnes
Copy link
Contributor

@michaelklishin Yes, let's re-open, I'll add a test hopefully before the end of the week.

@acogoluegnes
Copy link
Contributor

This is fixed and tested for both clients. I'll cut a patch release tomorrow.

@kwispel0
Copy link
Author

kwispel0 commented Feb 14, 2019

@michaelklishin and @acogoluegnes: thanks a lot

@kwispel0 kwispel0 changed the title Binding arguments for exchange-to-exchange binding are not set Binding arguments are not set Feb 14, 2019
@acogoluegnes acogoluegnes added this to the 3.1.1 milestone Feb 15, 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