go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

Does the gateway provide a capability to add upstream dynamically?

Open gongluck opened this issue 2 years ago • 8 comments
trafficstars

We need to dynamically add upstream to an already running gateway service, without modifying the configuration file and restarting the gateway.

gongluck avatar Oct 25 '23 09:10 gongluck

QQ图片20231025173911

add this upstream configuration

gongluck avatar Oct 25 '23 09:10 gongluck

Right now, it's better to restart the gateway.

But it's a good idea to reload the config on the fly. I might work on it later.

kevwan avatar Oct 25 '23 14:10 kevwan

Right now, it's better to restart the gateway.

But it's a good idea to reload the config on the fly. I might work on it later.

Thank you for your reply and look forward to the implementation of this feature.

gongluck avatar Oct 25 '23 15:10 gongluck

We need to dynamically add upstream to an already running gateway service, without modifying the configuration file and restarting the gateway.

Without changing the config file, how to add upstreams?

kevwan avatar Nov 06 '23 14:11 kevwan

We need to dynamically add upstream to an already running gateway service, without modifying the configuration file and restarting the gateway.

Without changing the config file, how to add upstreams?

Detecting changes to the configuration file is actually enough. I was thinking about having an api to dynamically modify upstreams after run, but that would be too complicated and uncontrollable.

gongluck avatar Nov 13 '23 06:11 gongluck

Same Concern. It is also acceptable to send a signal to trigger the update, such as sending SIGUSER2, or the gateway provides a admin port. Maybe the best way is to store the configuration in a configuration system, such as Nacos, etc.

eyjian avatar Jan 18 '24 02:01 eyjian

Same Concern. It is also acceptable to send a signal to trigger the update, such as sending SIGUSER2, or the gateway provides a admin port. Maybe the best way is to store the configuration in a configuration system, such as Nacos, etc.

In addition to "add", "delete" and "modify" also need to be supported.

eyjian avatar Jan 18 '24 02:01 eyjian

Look forward to progress.

eyjian avatar Jan 24 '24 06:01 eyjian