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

make routing key dynamic in queue bind #70

Merged
merged 1 commit into from
May 7, 2019
Merged

make routing key dynamic in queue bind #70

merged 1 commit into from
May 7, 2019

Conversation

bkielbasa
Copy link
Contributor

The problem

We use the routing key in bindings.
image

The routing key is dynamic and in our example is an event name. Because the routing key is static, we don't have the flexibility we need.

In this PR, I change the variable to a function similar to routing keys in PublishConfig etc

@sagikazarmark
Copy link
Contributor

Would be nice to have a static and a non-static version, where the function takes precedence.

@roblaszczak
Copy link
Member

@sagikazarmark you can always use

func(topic string) string {
	return "something_static"
}

we have already pattern like this in some places and it is pretty good because it is flexible and simple (if it will be a static option we need to always remember to call both, with adds complexity)

@roblaszczak roblaszczak merged commit 7ee3f6c into ThreeDotsLabs:master May 7, 2019
@roblaszczak
Copy link
Member

@bkielbasa thanks 🍻

@sagikazarmark
Copy link
Contributor

@roblaszczak Yeah, I know, but I still think it would be nice to have a shorthand for that syntax.

@bkielbasa bkielbasa deleted the make-routing-key-dynamic branch May 7, 2019 10:00
@alfiesal
Copy link

alfiesal commented Nov 19, 2020

@roblaszczak It is possible to bind the queue to exchange by multiple routing keys?

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.

4 participants