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

implement bindings and un-bindings #19

Merged
merged 13 commits into from
Jul 15, 2024
Merged

implement bindings and un-bindings #19

merged 13 commits into from
Jul 15, 2024

Conversation

Gsantomaggio
Copy link
Member

No description provided.

Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
@lukebakken lukebakken self-requested a review July 9, 2024 15:38
@lukebakken lukebakken added this to the 0.0.1 milestone Jul 9, 2024
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
@Gsantomaggio Gsantomaggio marked this pull request as ready for review July 11, 2024 13:53
@Gsantomaggio
Copy link
Member Author

@lukebakken, the PR is ready to review ( if you can).

I created a file for testing the bindings trying to cover all the cases with and without bindings arguments.

Copy link
Contributor

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out my latest two commits 😸

@Gsantomaggio
Copy link
Member Author

Thanks @lukebakken
I like the idea of aggregating the BindingSpecification, even if the old version was the same as the Java AMQP Client.
Old version:

 var args = new Dictionary<string, object>() { { "k", "v" } };
        await management.Binding().SourceExchange(source)
            .DestinationQueue(destination)
            .Key(key) /
            .Arguments(args)
            .Bind();

        await management.Unbind().SourceExchange(source).DestinationQueue(destination).Key(key).Arguments(args)
            .UnBind();

That is similar to java:

management.exchange().name("e").type(DIRECT).declare();
                management.binding().sourceExchange("e").destinationQueue("q").
                        key("k").arguments(s).bind();


                management.unbind().sourceExchange("e")
                        .destinationQueue("q").key("k").arguments(s).unbind();

New version with your commit :

var arguments = new Dictionary<string, object> { { key1, value1 }, { key2, value2 } };
await management.CreateBindingSpecification().SourceExchange("exchange_bindings_with_arguments")
            .DestinationQueue("queue_bindings_with_arguments")
            .Key("key")
            .Arguments(arguments)
            .Bind();



await management.CreateBindingSpecification().SourceExchange("exchange_bindings_with_arguments")
            .DestinationQueue("queue_bindings_with_arguments")
            .Key("key").Arguments(arguments).Unbind();

That is far from the Java AMQP client.

I don't have a strong opinion on it; what matters is having the same API for Java and .NET.

We have two ways:
1- restore the old .NET API Version
2- change the Java API

Let me know what you think @acogoluegnes

@lukebakken
Copy link
Contributor

I'll revert the naming change. I think it's unnecessary to duplicate an interface just for a different method.

lukebakken and others added 5 commits July 12, 2024 05:37
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <g.santomaggio@gmail.com>
@Gsantomaggio Gsantomaggio merged commit 930385e into main Jul 15, 2024
1 check passed
@Gsantomaggio Gsantomaggio deleted the declare branch July 15, 2024 12:38
@Gsantomaggio Gsantomaggio mentioned this pull request Jul 15, 2024
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.

2 participants