private string GetExchangeTypeByEnum(ExchangeTypeEnum type) { switch (type) { case ExchangeTypeEnum.Direct: return(ExchangeType.Direct); case ExchangeTypeEnum.Topic: return(ExchangeType.Topic); case ExchangeTypeEnum.Headers: return(ExchangeType.Headers); case ExchangeTypeEnum.Fanout: return(ExchangeType.Fanout); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public void CreateExchange(string name, ExchangeTypeEnum type) { MqChannel.ExchangeDeclare(name, GetExchangeTypeByEnum(type), Config.Durable, Config.AutoDelete, null); }