net core 2.x - rabbitmq 扩展使用

2.x 中使用

rabbitmq

 

使用方式:任意Service的IService接口对象实现 IConsumerDependency,然后,添加对象 infrastructure.Mq.RabbitMQ的包的引用,同时在Service的对应方法上加上[Consumer("对列名称")]即可。
比如:
public interface ISysDictionaryService : IServiceDependency,IConsumerDependency { bool TestRequest(); bool Test(string msg); } public class SysDictionaryService : ISysDictionaryService { [Consumer("SysDictionaryService.queue.TestRequest")] public bool TestRequest(string msg){return true;} [Consumer("SysDictionaryService.queue.Test")] public bool Test(string msg){return true;} }
 
源码地址:https://gith
posted @ 2020-04-28 17:26  esoftor  阅读(193)  评论(0编辑  收藏  举报