Spring AMQP
  1. Spring AMQP
  2. AMQP-143

Fluent Binding API unclear: change "from(Queue)" to "bind(Queue)"

    Details

    • Type: Refactoring Refactoring
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.RC2
    • Component/s: Core
    • Labels:
      None

      Description

      The Binding Builder works like this: BindingBuilder.from(fanOutQueue).to(fanoutExchange)
      I would argue that the message are sent from the Exchange to the Queue and therefore the API should be:
      BindingBuilder.from(fanoutExchange).to(fanOutQueue)

        Activity

        Hide
        Mark Fisher added a comment -

        Eberhard, Good point. I think it's the word "from" that is confusing. The terminology seems correct in this regard: a Queue is bound to an Exchange. What's confusing is that a Message is routed from an Exchange to a Queue. That, however, is the direction of Messages at runtime, while binding is a configuration time role. Do you think the following would be more clear? (just removing the word "from"):

        BindingBuilder.bind(myQueue).to(myExchange).with("some.routing.key")
        

        Thanks,
        Mark

        Show
        Mark Fisher added a comment - Eberhard, Good point. I think it's the word "from" that is confusing. The terminology seems correct in this regard: a Queue is bound to an Exchange. What's confusing is that a Message is routed from an Exchange to a Queue. That, however, is the direction of Messages at runtime, while binding is a configuration time role. Do you think the following would be more clear? (just removing the word "from"): BindingBuilder.bind(myQueue).to(myExchange).with( "some.routing.key" ) Thanks, Mark
        Hide
        Eberhard Wolff added a comment -

        Hi Mark,
        I agree, the "from" is what confused me. I think your suggestion is the way to go.
        Thanks,
        Eberhard

        Show
        Eberhard Wolff added a comment - Hi Mark, I agree, the "from" is what confused me. I think your suggestion is the way to go. Thanks, Eberhard
        Hide
        Dave Syer added a comment -

        The recommended domain language from Rabbit is "source" (the Exchange in this case) and "destination" (the Queue in this case) - i.e. nouns following the direction of travel of the Message. It's especially important these days to get it right because the destination can also be an Exchange. But I also like Mark's suggestion because we don't need nouns here, rather verbs and prepositions (and it works for Exchange-Exchange bindings even if we don't quite support that yet).

        Show
        Dave Syer added a comment - The recommended domain language from Rabbit is "source" (the Exchange in this case) and "destination" (the Queue in this case) - i.e. nouns following the direction of travel of the Message. It's especially important these days to get it right because the destination can also be an Exchange. But I also like Mark's suggestion because we don't need nouns here, rather verbs and prepositions (and it works for Exchange-Exchange bindings even if we don't quite support that yet).

          People

          • Assignee:
            Dave Syer
            Reporter:
            Eberhard Wolff
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: