首页 > 其他 > 详细

rabbit 独占队列

时间:2019-06-16 16:49:46      阅读:155      评论:0      收藏:0      [点我收藏+]
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");

 

rabbit 独占队列

原文:https://www.cnblogs.com/hshy/p/11031691.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!