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

[FEATURE] Improve routing key and queue definitions #263

Open
2 tasks done
kvaleev opened this issue Oct 31, 2024 · 0 comments
Open
2 tasks done

[FEATURE] Improve routing key and queue definitions #263

kvaleev opened this issue Oct 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kvaleev
Copy link

kvaleev commented Oct 31, 2024

Why do we need this improvement?

Hello,

Even in simple cases, I am always struggling to define the specification with AMQP bindings. I think either the bindings definitions should be changed, or we need to have documented the correct way to specify it.

Imagine a case: we have a service that sends events to a broker with some routing key that has a parameter (say event.type.{id}) to an exchange Events, and receives other events from some queue queue-for-service-{serviceID}. How can I specify it with current embeddings:

channels:
    sendingEventsChannel:
        address: 'event.type.{id}'
        parameters:
            id:
        ...
        bindings:
            amqp:
                is: routingKey # OK, this means that the address is a routing key
                exchange:
                    name: Events
                    type: topic
        messages:
            eventMessage:
                bindings:
                    amqp:
                        messageType: 'event.type' # Why can't I use parameters here? 
                                                  # Why do I have to write it again if it's already in the address?
        ...
    receivingEventsChannel:
        address: 'queue-for-service-{serviceID}'
        parameters:
            serviceID:
        ...
        bindings:
            amqp:
                is: routingKey # OK, I can assume that the address is a queue name, similar to a routing key.
                queue:
                    name: my-queue-name # But no, I need to set queue name again. 
                                        # What is address then? And again, I can't use parameters here. 
                                        # Also, why can't I define which exchange the queue should bind to?
        messages:
            eventMessage:
                bindings:
                    amqp:
                        messageType: 'event.type' # Why can't I use parameters here?
        ...

To summarise:

  1. Why is the address used for the routing key binding but not for the queue?
  2. What is the purpose of the address for the queue binding if the queue name has to be explicitly set again?
  3. Why can't we use parameters in bindings?
  4. Why can't we specify which exchange the queue should bind to?

How will this change help?

To have a clear and consistent description of routing keys and queues used.

Screenshots

No response

How could it be implemented/designed?

If it helps, I can suggest some changes to the bindings specification that I think might make it clearer.

🚧 Breaking changes

Yes

👀 Have you checked for similar open issues?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

Yes I am willing to submit a PR!

@kvaleev kvaleev added the enhancement New feature or request label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant