@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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/786#issuecomment-252180828
_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to