mynatsclient icon indicating copy to clipboard operation
mynatsclient copied to clipboard

Feature: Configure automatic reconnection

Open watfordgnf opened this issue 4 years ago • 1 comments

As a consumer of MyNatsClient in a collection of microservices, I would like more detailed control over the automatic reconnection behavior.

The following options should be configurable at the client level:

  • Maximum reconnection attempts
    • Including: reconnect forever
  • Reconnection delay between attempts

Additionally, an event should be raised when the client is reconnecting.

watfordgnf avatar Aug 21 '20 15:08 watfordgnf

MyNatsClient has been created with the idea of being simple. As in not becoming to complex in the sense of starting to queue messages etc if not connected etc. But instead be able to let the user handle this in their code by wrapping and handling the events of the client.

This although is probably a good suggestion that should be in. In the meantime, you should be able to handle this by turning of auto reconnect and react to the event your self.

danielwertheim avatar Aug 23 '20 17:08 danielwertheim