You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/12 06:06:13 UTC

[GitHub] [apisix] GBXing opened a new issue #2717: request help: how do I get etcd data in a custom plugin

GBXing opened a new issue #2717:
URL: https://github.com/apache/apisix/issues/2717


   ### Issue description
          I save some configuration data to the ETCD, hoping to load the configuration data into local memory when I start Apisix, and then get the configuration data when I develop my custom plugin by requiring ("apisix.xxx").get(). Is there an easy way to do this?
         The way I've been able to do this so far is to add code to the http_init_worker() method of init.lua to load my configuration data when Apisix starts, but it may not be a good idea to change the source code
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 1.5
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #2717: request help: how do I get etcd data in a custom plugin

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2717:
URL: https://github.com/apache/apisix/issues/2717#issuecomment-725938565


   My original suggestion is that you can write your version of plugin_metadata. But your current way is fine too.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] GBXing commented on issue #2717: request help: how do I get etcd data in a custom plugin

Posted by GitBox <gi...@apache.org>.
GBXing commented on issue #2717:
URL: https://github.com/apache/apisix/issues/2717#issuecomment-725924406


   > You can take a look at plugin-metadata API: https://github.com/apache/apisix/blob/master/doc/admin-api.md#plugin-metadata and its relative code.
   
   Sorry, I mean that I want to load configuration data from ETCD to local memory when Apisix is started, and then go to local memory to get data in custom plugin. Is there any way to do this without changing the source code


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander closed issue #2717: request help: how do I get etcd data in a custom plugin

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #2717:
URL: https://github.com/apache/apisix/issues/2717


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #2717: request help: how do I get etcd data in a custom plugin

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2717:
URL: https://github.com/apache/apisix/issues/2717#issuecomment-725874818


   You can take a look at plugin-metadata API: https://github.com/apache/apisix/blob/master/doc/admin-api.md#plugin-metadata and its relative code.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] GBXing commented on issue #2717: request help: how do I get etcd data in a custom plugin

Posted by GitBox <gi...@apache.org>.
GBXing commented on issue #2717:
URL: https://github.com/apache/apisix/issues/2717#issuecomment-725935227


   @spacewander 
   Now I refer to the code of the Consumer module and add a custom init_worker() method in the http_init_worker() of init.lua to load etCD data into local memory. Is there an easier way
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] GBXing closed issue #2717: request help: how do I get etcd data in a custom plugin

Posted by GitBox <gi...@apache.org>.
GBXing closed issue #2717:
URL: https://github.com/apache/apisix/issues/2717


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org