std::string queue_name = "hello"; AmqpClient::Channel::ptr_t channel = AmqpClient::Channel::Create("10.10.22.105", 5672, "admin", "1234568888"); //创建channel channel->DeclareQueue(queue_name, false, true, false, false); //创建队列,第一个参数为队列名称,其余后续会提到。 boost::uint32_t message_count = 0; boost::uint32_t consumer_count = 0; std::string retstr(""); retstr = channel->DeclareQueueWithCounts("hello3", message_count, consumer_count, false, false, true, true); std::string message = "mfc tet test"; channel->BasicPublish("", queue_name, AmqpClient::BasicMessage::Create(message)); HANDLE handle = CreateThread(NULL, 0, monitorThread, NULL, 0, NULL); system("PAUSE");