I want to know correct way to detect network issues while polling messages from consumer. I noticed that when network had issue consumer keeps returning null message. Also when there is no message on server side, it is returning null message too. So it is not possible whether it is network issue or no message. I have following code.
while (true) {
Message msg = consumer.poll();
if (!msg) {
** This condition is executed when there is no message or network has issues**
continue;
}
if (msg.get_error()) {
if (!msg.is_eof()) {
}
continue;
}
cout << "Received message" << msg.get_payload() << endl;
}
Hello,
I want to know correct way to detect network issues while polling messages from consumer. I noticed that when network had issue consumer keeps returning null message. Also when there is no message on server side, it is returning null message too. So it is not possible whether it is network issue or no message. I have following code.