/// <summary> /// 建構子 /// </summary> /// <param name="options">連線設定</param> /// <param name="exchange">主路由</param> /// <param name="route">子路由</param> public Publisher(FactoryOptions options, string exchange, string route = "") { if (options == null) { throw new ArgumentException("Factory options can't be null."); } if (string.IsNullOrWhiteSpace(exchange)) { throw new ArgumentException("Exchange must be specified."); } Options = options; Exchange = exchange; Route = route; }
/// <summary> /// 建構子 /// </summary> /// <param name="options">連線設定</param> /// <param name="exchange">主路由</param> /// <param name="routes">子路由</param> public Subscriber(FactoryOptions options, string exchange, string[] routes = null) { if (options == null) { throw new ArgumentException("Factory options can't be null!"); } if (string.IsNullOrWhiteSpace(exchange)) { throw new ArgumentException("Exchange must be specified."); } Options = options; Exchange = exchange; Routes = routes; }