<p></p>
<p>re-updated PR to add callbacks to publisher connections; right now the publisher callbacks are the same as the subscriber callbacks.</p>
<p>Thus, kamailio nats module can make use of nats lib reconnection(e.g. natsOptions_SetRetryOnFailedConnect() function) and not implement a reconnect mechanism by itself.</p>
<p>I will later make a new PR to make the parameters that control nats lib reconnect mechanism, configurable:</p>
<pre><code>        natsOptions_SetMaxReconnect(opts, 10000); // how many times nats lib tries to reconnect before giving up; -1 is forever if i'm not wrong
        natsOptions_SetReconnectWait(opts, 2 * 1000); // the interval between reconnect retries
</code></pre>
<p>Thanks,<br>
Stefan</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/2915#issuecomment-961885703">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZIO62L2EZ5PSYFSKI3UKPKF3ANCNFSM5HI6CVXQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABO7UZN7LWAGGACXFY4LEODUKPKF3A5CNFSM5HI6CVX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHFKTMBY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/2915#issuecomment-961885703",
"url": "https://github.com/kamailio/kamailio/pull/2915#issuecomment-961885703",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>