You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ability to reload the gateway options (server.Options.gateway) when running the nats-server embedded.
Currently if you clone the Options, modify the settings in Gateway and then call server.ReloadOptions(opts) you are returned an error such as: config reload not supported for Gateway: <GATEWAY STRUCTS HERE>.
Use case
This could be useful for projects where new gateways can be created or removed dynamically, and you don't want nodes to continuously try reconnecting to a gateway that no longer exists, and won't exist.
For example:
Cluster A is created and is listening for gateway connections.
Cluster B is created, listening for gateway connections, and is configured to connect to cluster A via a gateway.
Then, cluster A is spun down and removed. All nodes in cluster B will continuously, as configured, try to reconnect to cluster A until they are restarted with a new configuration that doesn't have that gateway.
For my specific use case, I am trying to create a library that adds platform functionality to embedding NATS into Go projects. So for example if you deploy on Fly.io the library will automatically cluster nodes in the same region, and super cluster every region an app is deployed in. But, if in the example you remove "cluster A" (a specific region), the nodes in cluster B will try to connect ad infinitum.
Contribution
No response
The text was updated successfully, but these errors were encountered:
Proposed change
The ability to reload the gateway options (
server.Options.gateway
) when running the nats-server embedded.Currently if you clone the
Options
, modify the settings inGateway
and then callserver.ReloadOptions(opts)
you are returned an error such as:config reload not supported for Gateway: <GATEWAY STRUCTS HERE>
.Use case
This could be useful for projects where new gateways can be created or removed dynamically, and you don't want nodes to continuously try reconnecting to a gateway that no longer exists, and won't exist.
For example:
A
is created and is listening for gateway connections.B
is created, listening for gateway connections, and is configured to connect to clusterA
via a gateway.A
is spun down and removed. All nodes in clusterB
will continuously, as configured, try to reconnect to clusterA
until they are restarted with a new configuration that doesn't have that gateway.For my specific use case, I am trying to create a library that adds platform functionality to embedding NATS into Go projects. So for example if you deploy on Fly.io the library will automatically cluster nodes in the same region, and super cluster every region an app is deployed in. But, if in the example you remove "cluster
A
" (a specific region), the nodes in clusterB
will try to connect ad infinitum.Contribution
No response
The text was updated successfully, but these errors were encountered: