示例#1
0
文件: MqBuilder.cs 项目: qiuyk/MqDemo
        /// <summary>
        /// 获取监听RoutingKey
        /// </summary>
        /// <returns></returns>
        private List <string> GetListeningRoutingKey(MqEnum mqEnum)
        {
            List <string> listRoutingKey = new List <string>();

            switch (mqEnum)
            {
            case MqEnum.Fanout:
                listRoutingKey.Add("all");
                break;

            case MqEnum.Topic:
                listRoutingKey.Add("*." + receiver);
                listRoutingKey.Add(role + ".*");
                break;

            case MqEnum.Direct:
                listRoutingKey.Add(receiver);
                break;

            default:
                break;
            }

            return(listRoutingKey);
        }
示例#2
0
文件: MqBuilder.cs 项目: qiuyk/MqDemo
 public MqBuilder withType(MqEnum type = MqEnum.Topic)
 {
     this.type = type;
     return(this);
 }