diff --git a/include/exchangetype.h b/include/exchangetype.h index 8392153..5ef5c7a 100644 --- a/include/exchangetype.h +++ b/include/exchangetype.h @@ -24,7 +24,8 @@ enum ExchangeType fanout, direct, topic, - headers + headers, + consistent_hash }; /** diff --git a/src/channelimpl.cpp b/src/channelimpl.cpp index e285385..77f7a63 100644 --- a/src/channelimpl.cpp +++ b/src/channelimpl.cpp @@ -219,10 +219,13 @@ Deferred &ChannelImpl::declareExchange(const std::string &name, ExchangeType typ { // convert exchange type std::string exchangeType; - if (type == ExchangeType::fanout) exchangeType = "fanout"; - if (type == ExchangeType::direct) exchangeType = "direct"; - if (type == ExchangeType::topic) exchangeType = "topic"; - if (type == ExchangeType::headers)exchangeType = "headers"; + + // convert the exchange type into a string + if (type == ExchangeType::fanout) exchangeType = "fanout"; + else if (type == ExchangeType::direct) exchangeType = "direct"; + else if (type == ExchangeType::topic) exchangeType = "topic"; + else if (type == ExchangeType::headers) exchangeType = "headers"; + else if (type == ExchangeType::consistent_hash) exchangeType = "x-consistent-hash"; // send declare exchange frame return push(ExchangeDeclareFrame(_id, name, exchangeType, (flags & passive) != 0, (flags & durable) != 0, false, arguments));