コード例 #1
0
amqp_channel_t ChannelImpl::GetConsumerChannel(const std::string& consumer_tag)
{
    std::map<std::string, amqp_channel_t>::const_iterator it = m_consumer_channel_map.find(consumer_tag);
    if (it == m_consumer_channel_map.end())
    {
        throw ConsumerTagNotFoundException();
    }
    return it->second;
}
コード例 #2
0
ファイル: Channel.cpp プロジェクト: alanxz/SimpleAmqpClient
bool Channel::BasicConsumeMessage(Envelope::ptr_t &message, int timeout) {
  m_impl->CheckIsConnected();

  std::vector<amqp_channel_t> channels = m_impl->GetAllConsumerChannels();

  if (0 == channels.size()) {
    throw ConsumerTagNotFoundException();
  }

  return m_impl->ConsumeMessageOnChannel(channels, message, timeout);
}
コード例 #3
0
amqp_channel_t ChannelImpl::RemoveConsumer(const std::string& consumer_tag)
{
    std::map<std::string, amqp_channel_t>::iterator it = m_consumer_channel_map.find(consumer_tag);
    if (it == m_consumer_channel_map.end())
    {
        throw ConsumerTagNotFoundException();
    }

    amqp_channel_t result = it->second;

    m_consumer_channel_map.erase(it);

    return result;
}