|
@@ -122,6 +122,7 @@ Error_manager Rabbitmq_base::rabbitmq_init_from_protobuf(Rabbitmq_proto::Rabbitm
|
|
|
|
|
|
//创建通道队列消费者, (交换机和永久队列不在代码里创建,请在服务器上手动创建)
|
|
//创建通道队列消费者, (交换机和永久队列不在代码里创建,请在服务器上手动创建)
|
|
t_error = rabbitmq_new_channel_queue_consume(rabbitmq_parameter_all);
|
|
t_error = rabbitmq_new_channel_queue_consume(rabbitmq_parameter_all);
|
|
|
|
+ std::cout<<"rabbitmq config: "<<rabbitmq_parameter_all.DebugString()<<std::endl;
|
|
if ( t_error != Error_code::SUCCESS )
|
|
if ( t_error != Error_code::SUCCESS )
|
|
{
|
|
{
|
|
return t_error;
|
|
return t_error;
|
|
@@ -848,6 +849,14 @@ Error_manager Rabbitmq_base::encapsulate_task_msg(std::string message, int vecto
|
|
//手动封装状态消息, 系统会使用rabbitmq.proto的配置参数,
|
|
//手动封装状态消息, 系统会使用rabbitmq.proto的配置参数,
|
|
Error_manager Rabbitmq_base::encapsulate_status_msg(std::string message, int vector_index)
|
|
Error_manager Rabbitmq_base::encapsulate_status_msg(std::string message, int vector_index)
|
|
{
|
|
{
|
|
|
|
+ if(m_rabbitmq_parameter_all.rabbitmq_parameters().rabbitmq_sender_status_vector_size() <= vector_index)
|
|
|
|
+ {
|
|
|
|
+ std::cout<<"msg vector size error: "<<m_rabbitmq_parameter_all.rabbitmq_parameters().rabbitmq_sender_status_vector_size()<<std::endl;
|
|
|
|
+ return Error_manager(Error_code::PARAMETER_ERROR, Error_level::MINOR_ERROR,
|
|
|
|
+ (std::string(" Communication_socket_base::encapsulate_msg vector index limit ")
|
|
|
|
+ +std::to_string(m_rabbitmq_parameter_all.rabbitmq_parameters().rabbitmq_sender_status_vector_size())).c_str());
|
|
|
|
+ }
|
|
|
|
+
|
|
int channel = m_rabbitmq_parameter_all.rabbitmq_parameters().rabbitmq_sender_status_vector(vector_index).channel();
|
|
int channel = m_rabbitmq_parameter_all.rabbitmq_parameters().rabbitmq_sender_status_vector(vector_index).channel();
|
|
std::string exchange_name = m_rabbitmq_parameter_all.rabbitmq_parameters().rabbitmq_sender_status_vector(vector_index).exchange_name();
|
|
std::string exchange_name = m_rabbitmq_parameter_all.rabbitmq_parameters().rabbitmq_sender_status_vector(vector_index).exchange_name();
|
|
std::string routing_key = m_rabbitmq_parameter_all.rabbitmq_parameters().rabbitmq_sender_status_vector(vector_index).routing_key();
|
|
std::string routing_key = m_rabbitmq_parameter_all.rabbitmq_parameters().rabbitmq_sender_status_vector(vector_index).routing_key();
|