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

Ability to dynamically set route key in UseConventionalRouting #1130

Open
saithis opened this issue Nov 14, 2024 · 1 comment
Open

Ability to dynamically set route key in UseConventionalRouting #1130

saithis opened this issue Nov 14, 2024 · 1 comment

Comments

@saithis
Copy link

saithis commented Nov 14, 2024

Is your feature request related to a problem? Please describe.

Currently I have to add a config line per message dto to specify the route key.

            opts.PublishMessage<DummyEvent1>().ToRabbitRoutingKey("my.app", "my.app.events.dummy1");
            opts.PublishMessage<DummyEvent2>().ToRabbitRoutingKey("my.app", "my.app.events.dummy2");

Describe the solution you'd like

Similar to ExchangeNameForSending I would like a RouteKeyForSending in UseConventionalRouting.
I'm not hung up on the name of this method, maybe RabbitRoutingKeyForSending would be better to keep the similarity to ToRabbitRoutingKey.

Describe alternatives you've considered

  • Not use wolverine - but I want to
  • Don't use route keys, but that seems like a bad idea
  • Specify each and every Dto manually in the config... feels error prone if you forget one and it isn't a convention anymore
  • Do reflection magic to dynamically build the opts.PublishMessage<DummyEvent2>().ToRabbitRoutingKey("my.app", "my.app.events.dummy2"); calls. This would probably be my go to, if the feature request is rejected.

Additional context

I'm using the RabbitMQ transport and want to use topics with route keys

@jeremydmiller
Copy link
Member

@saithis I'm happy to take a pull request for this if it's important to you. Within the next couple weeks, we'll add better documentation on "build your own message routing conventions and just do whatever the hell you want". The capability is there, just not doc'd.

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

No branches or pull requests

2 participants