SimpleAmqpClient
SimpleAmqpClient copied to clipboard
connection disappeared on management plugin, but channel still BasicConsume
Hi alanxz, I'm using your lib SimpleAmqpClient in my project, but I met an issue as the Title.
after I created the channel, declare queue, and then:
`std::string consumer_command = channel->BasicConsume(my_queue_name, "",true, false, false);
while (1)
{
AmqpClient::Envelope::ptr_t envelope;
if(!channel->BasicConsumeMessage(consumer_command, envelope,30000) )
continue;
....
}`
my APP runs fine in the loop, but after 20 mins or more, when I go to check on the management plugin, the connection of my app disappeared, also the channel. but when I go back to my app, it still in the loop, and the channel works 'fine', keeping receive messages from the server( in fact, it can't receive any information anymore.)
the Rabbitmq server version is 3.6.10
no exception, don't know why
any idea?
Regards, Peter
Maybe it's a bit late since this issue is from 2018 but if anyone happened to face the same issue, i have a fix for it.
You need to overwrite the #define BROKER_HEARTBEAT 0
to #define BROKER_HEARTBEAT "any positive integer > 0"
in ChannelImpl.cpp before compiling the library.
Unfortunately, the library does not supply any way to set the heartbeat mecanism through its APIs.