amqp_bytes_t message_bytes; message_bytes.len = strlen(recv.c_str()); message_bytes.bytes = (char *)recv.c_str(); int ret = amqp_basic_publish(conn, 1, amqp_cstring_bytes(this->exchageName.c_str()), // amqp_cstring_bytes(queue_name.c_str()), 0, 0, NULL, message_bytes);...
string strExchange = CConfig::instance()->GetRabbitMqAMQPSendInfo().m_strExchange; amqp_exchange_declare(m_mqPublishConn, 1, amqp_cstring_bytes(strExchange.c_str()), amqp_cstring_bytes("direct"), 0, 1, 0, 0, amqp_empty_table); m_mqReply = amqp_get_rpc_reply(m_mqPublishConn); ...
_bytes_malloc_dup(r->queue); if (m_mqQueuename.bytes == NULL) { FIRE_ERROR("Out of memory while copying queue name\n"); return iRetVal; } //绑定队列到exchange amqp_queue_bind(m_mqConsumConn, 1, amqp_empty_bytes, amqp_cstring_bytes(strExchange.c_str()), amqp_cstring_bytes(str...
(m_Connection, m_nChannelIdSend, amqp_cstring_bytes("ping") , Type,100,1,0,0, amqp_empty_table);//绑定交换器 amqp_cstring_bytes("ping")1112m_strExchange ="ping";13m_strRoutingkey ="rpc";14m_pProducer1 =newCMqProducerThread(m_Connection, m_nChannelIdSend, m_strExchange, m_str...
conn) die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel"); die_on_amqp_error(conn, 1, amqp_cstring_bytes(exchange), amqp_cstring_bytes(routingkey), 0, 0, &props, amqp_cstring_bytes*r 浏览5提问于2017-09-08得票数 0 ...
lib: switch to StringToBytes from amqp_cstring_bytes 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191...
amqp_bytes_t ex = amqp_cstring_bytes(m_Exchanger.data()); amqp_bytes_t extype = amqp_cstring_bytes(m_ExType.data()); 1. 2. 3. 4. passive 检测exchange是否存在,设为true,若存在则命令成功返回,若不存在不会创建exchange,返回错误。设为false,如果exchange不存在则创建exchange,调用成功返回,如果...
amqp_boolean_tif_empty=AMQP_TRUE;// 检查队列是否为空 amqp_queue_delete(conn,channel,amqp_cstring_bytes(queue_name),if_unused,if_empty); 这样就可以使用 rabbitmq-c 库来关闭(删除)指定名称的队列了。请注意,在执行关闭操作前,请确保已经备份了需要保留的数据,并且谨慎考虑可能引起的影响。 最后,关闭连...
amqp_basic_publish(conn,KChannel,exchangeName,amqp_cstring_bytes(routing_key.c_str()),false,false,nullptr,amqp_cstring_bytes(message.c_str()));std::cout<<" [x] Sent "<<routing_key<<":"<<message<<std::endl;amqp_channel_close(conn,KChannel,AMQP_REPLY_SUCCESS);amqp_connection_close(con...
amqp_exchange_declare(conn, KChannel, exchangeName, amqp_cstring_bytes("fanout"), false, false, false, false, amqp_empty_table); //这行代码声明了一个新的队列。由于队列名称参数为空,RabbitMQ会生成一个随机的,唯一的队列名称。这个队列是非持久的,独占的,非自动删除的。 amqp_queue_declare_ok_t...