Closed DuleDimitrov123 closed 9 months ago
Hi, I am trying to create some flexible queue names in RabbitMQ since I am using it with CAP library. I would like to have queue name like: "test".
As I can see, CAP is creating queue name with the Group from [CapSubscribe] attribute and adds version.
If I set [CapSubscribe("someEvent", Group = "test")], I will get queue: test.v1.
Additionaly, if I set version to string.Empty with the following code when registering CAP, I will get: "test." (with "." after test).
services.AddCap(options => { options.Version = string.Empty; options.UseEntityFramework<DbContext>(); options.UseRabbitMQ(options => { ... }); });
Could I somehow set queue name in RabbitMQ to "test" and use it like that?
Thanks!
Hi, You can override this method SetSubscribeAttribute
SetSubscribeAttribute
https://github.com/dotnetcore/CAP/blob/e3cffd1e668aff48715a9c34ce147dbf213c3880/src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs#L169
Thanks @yang-xiaodong. Closing the issue!
Hi, I am trying to create some flexible queue names in RabbitMQ since I am using it with CAP library. I would like to have queue name like: "test".
As I can see, CAP is creating queue name with the Group from [CapSubscribe] attribute and adds version.
If I set [CapSubscribe("someEvent", Group = "test")], I will get queue: test.v1.
Additionaly, if I set version to string.Empty with the following code when registering CAP, I will get: "test." (with "." after test).
Could I somehow set queue name in RabbitMQ to "test" and use it like that?
Thanks!