@gaaf there are actually 2 conditions that consider breaking out of reconnect loop on success:
1'st one, on success, will succeed opening channel, thus will never go further: ``` // open channel - failed if (log_ret != AMQP_RESPONSE_NORMAL) { ... } ```
2'nd one: ``` // reconnect if (reconnect_attempts < max_reconnect_attempts) { ... } ```
I tried again this scenario using kamailio with 1 spawned child and I can see only 1 "LM_ERR("SUCCESS: rabbitmq_reconnect()\n");" for multiple calls, after reconnect.
The reason you may see multiple logs of that kind is because the amqp connection is **per child process**. However, the reconnect is tried only for a specific child, when it tries to _publish()/publish_consume().
Hope this was helpful.