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 2021/08/16 10:31:37 UTC

[GitHub] [apisix-java-plugin-runner] Rdebu opened a new issue #59: request help: I want to update the filter by code. How can i do

Rdebu opened a new issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59


   ### Issue description
    I want to update the filter by code. How can i do
   ### Environment
   apisix 2.7
   * your apisix-java-plugin-runner version 0.1
   
   I can get the A6ConfigHandler from spring applicationContext. So i can get the filterMapper , but when i update the filterMapper . The updated filter does not work. 
   ![image](https://user-images.githubusercontent.com/58921097/129549978-7ea2e059-486c-4de0-ac3d-92cb7d37d99a.png)
   
   I think because it has cache , how can i  get the A6conf to update the property PluginFilterChain
   ![image](https://user-images.githubusercontent.com/58921097/129550087-d4ce29b9-c7c8-499b-8a09-9260b66b65d4.png)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-902449848


   > > Since the expired token has been deleted from the Cache, why do you say that the token is still in memory?
   > 
   > I didn't say that. `Expired tokens in memory do not affect the access of new tokens` is ok, but it doesn't mean much.
   > 
   > To learn more about cache expiration issues, refer here:
   > 
   > https://github.com/apache/apisix-java-plugin-runner/blob/df69b2ebd24860d2c9effc5aeaed6d1b7e8a176d/runner-core/src/main/java/org/apache/apisix/plugin/runner/service/CacheConfiguration.java#L33-L35
   > 
   > The cache library we use is Guava Cache, you can read their documentation to find out when an expired key is deleted.
   
   Ah..  That's why I think expired tokens are not in Cache<token,A6Config> but elsewhere in memory  
   【啊。。,您当时回复了下面这句话,所以我才认为过期的token不在Cache<token,A6Config>中但是在内存中其他位置的】
   ![image](https://user-images.githubusercontent.com/58921097/130186040-421c3582-b99f-461e-9c30-4deab4031a6a.png)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-901621823


   > > The 'token' seems to be obtained from response , but response is invoked only when the request is rejected. Is there another way to get a token?
   > 
   > When the runner receives the A6ConfigRequest from APISIX, it generates the `token`.
   > 
   > here:
   > 
   > https://github.com/apache/apisix-java-plugin-runner/blob/df69b2ebd24860d2c9effc5aeaed6d1b7e8a176d/runner-core/src/main/java/org/apache/apisix/plugin/runner/handler/A6HandlerConfiguration.java#L70-L73
   
   what's the logic of this,Will a token be generated every time the apisix-java-plugin-runner is accessed, or will a token be shared when certain conditions are met (for example, one token is shared for the same IP access)  
   【它的逻辑是怎么样的呢,是每次访问到apisix-java-plugin-runner都会生成一个token,还是满足某个条件则共用一个token(比如同一个ip访问则公用一个token)】


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-899624413


   Find a way to get the `config_id` and get the cache based on the `config_id`. 
   
   But I don't know why you would want to do that.
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-900786105


   > The 'token' seems to be obtained from response , but response is invoked only when the request is rejected. Is there another way to get a token?
   
   When the runner receives the A6ConfigRequest from APISIX, it generates the `token`.
   
   here: https://github.com/apache/apisix-java-plugin-runner/blob/df69b2ebd24860d2c9effc5aeaed6d1b7e8a176d/runner-core/src/main/java/org/apache/apisix/plugin/runner/handler/A6HandlerConfiguration.java#L70-L73


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-903081604


   > > it is only in Guava Cache
   > 
   > It is only managed by Guava Cache.
   
   I get the token when it created, and hence the Cache<token, A6Conf> in A6ConfigHandler, and the PluginFilterChain object in A6Conf. To get the List in the PluginFilterChain object; In addition, I can modify the Map<String, PluginFilter> in A6ConfigHandler. However, I overwrite the corresponding Filter in the List and Map<String, PluginFilter> with my Filter object, but I still can't get my Filter to Apisix. What happens when I make sure my filter is in the List and the Map<String, PluginFilter>
   【我在创建时获取到了token,也因此获取到了A6ConfigHandler中的Cache<token, A6Conf>对应的A6Conf,也获取到了a6Conf中的PluginFilterChain对象,从而获取到了PluginFilterChain对象中的List;另外A6ConfigHandler中的Map<String, PluginFilter>我也能修改了。但是我将自己的Filter对象去覆盖List与Map<String, PluginFilter>中对应的filter,依然不能够让apisix获取到我自己的filter,我确定自己的filter已经放入List与Map<String, PluginFilter>中,这种是什么情况】
   ![image](https://user-images.githubusercontent.com/58921097/130315802-1dc5238a-3cbe-4f3f-a71b-486051725253.png)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-902446776


   > Since the expired token has been deleted from the Cache, why do you say that the token is still in memory?
   
   I didn't say that. `Expired tokens in memory do not affect the access of new tokens` is ok, but it doesn't mean much.
   
   To learn more about cache expiration issues, refer here:https://github.com/apache/apisix-java-plugin-runner/blob/df69b2ebd24860d2c9effc5aeaed6d1b7e8a176d/runner-core/src/main/java/org/apache/apisix/plugin/runner/service/CacheConfiguration.java#L33-L35
   
   The cache library we use is Guava Cache, you can read their documentation to find out when an expired key is deleted.
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-902438646


   > > Expired tokens in memory do not affect the access of new tokens
   > 
   > yes
   
   emmmmmmmmm I don't understand the expired token in memory, because token is the key in Cache  。Since the expired token has been deleted from the Cache, why do you say that the token is still in memory?  
   【emmmmmm 那过期的token在内存中我不太理解,因为token是Cache中的key。既然Cache中已经把过期的token删除了,那为什么您说token还在内存中呢。】


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-905113017


   same as: https://github.com/apache/apisix-java-plugin-runner/issues/62


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-902569123


   > sorry, I didn't make that clear. Guava Cache is one of memory cache. In this project, the memory cache is the Guava Cache by default.
   
   no probleam.In short, an expired token has no effect on subsequent access, it is only in Guava Cache.  Am I getting this right  
   嗯嗯,总的来说,过期的token不会对后续的访问有任何影响,他只是在Guava Cache中而已。我这样理解对吗


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu edited a comment on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu edited a comment on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-903081604


   > > it is only in Guava Cache
   > 
   > It is only managed by Guava Cache.
   
   I got the token at creation time, so I got A6Conf for Cache<token, A6Conf> in A6ConfigHandler, and I got the PluginFilterChain object in A6Conf.  We get the List in the PluginFilterChain object;  In addition, I can modify the Map<String, PluginFilter> in A6ConfigHandler.  However, I overwrite the corresponding Filter in the List and Map<String, PluginFilter> with my Filter object, but I still can't get my Filter to Apisix.  I am sure that my filter has been placed in the List and Map<String, PluginFilter>, sometimes the effect is the filter that was previously overwritten, sometimes the error 503 is directly reported(After that, error 503 will always be reported), what is the case  
   【我在创建时获取到了token,也因此获取到了A6ConfigHandler中的Cache<token, A6Conf>对应的A6Conf,也获取到了a6Conf中的PluginFilterChain对象,从而获取到了PluginFilterChain对象中的List;另外A6ConfigHandler中的Map<String, PluginFilter>我也能修改了。但是我将自己的Filter对象去覆盖List与Map<String, PluginFilter>中对应的filter,依然不能够让apisix获取到我自己的filter,我确定自己的filter已经放入List与Map<String, PluginFilter>中,有时候效果是之前被覆盖的filter,有时候直接报错误码503(这之后将一直报错误码503),这种是什么情况】
   ![image](https://user-images.githubusercontent.com/58921097/130315802-1dc5238a-3cbe-4f3f-a71b-486051725253.png)
   ![image](https://user-images.githubusercontent.com/58921097/130316059-d6d4d02a-16dd-46c8-a463-59cee2bbb41c.png)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu removed a comment on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu removed a comment on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-903075418


   > > it is only in Guava Cache
   > 
   > It is only managed by Guava Cache.
   
   I get the token, and hence the Cache<token, A6Conf> in A6ConfigHandler, and the PluginFilterChain object in A6Conf.  To get the List<PluginFilter> in the PluginFilterChain object;  In addition, I can modify the Map<String, PluginFilter> in A6ConfigHandler.  However, I overwrite the corresponding Filter in the List<PluginFilter> and Map<String, PluginFilter> with my Filter object, but I still can't get my Filter to Apisix.  What happens when I make sure my filter is in the List<PluginFilter> and the Map<String, PluginFilter>  
   【我获取到了token,也因此获取到了A6ConfigHandler中的Cache<token, A6Conf>对应的A6Conf,也获取到了a6Conf中的PluginFilterChain对象,从而获取到了PluginFilterChain对象中的List<PluginFilter>;另外A6ConfigHandler中的Map<String, PluginFilter>我也能修改了。但是我将自己的Filter对象去覆盖List<PluginFilter>与Map<String, PluginFilter>中对应的filter,依然不能够让apisix获取到我自己的filter,我确定自己的filter已经放入List<PluginFilter>与Map<String, PluginFilter>中,这种是什么情况】
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-901791972


   > what's the logic of this,Will a token be generated every time the apisix-java-plugin-runner is accessed, or will a token be shared when certain conditions are met (for example, one token is shared for the same IP access)
   
   In short, the token is generated in two cases:
   1. Before APISIX sends the `HttpRequest` for the first time
   2. When the token cache expires in APISIX


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-900756284


   > > > Find a way to get the `config_id` and get the cache based on the `config_id`.
   > > > But I don't know why you would want to do that.
   > > 
   > > 
   > > Did you say config_id is the key of Cache? Now i dont know how to get the cache's key . When is the value added to cache
   > 
   > here:
   > 
   > https://github.com/apache/apisix-java-plugin-runner/blob/df69b2ebd24860d2c9effc5aeaed6d1b7e8a176d/runner-core/src/main/java/org/apache/apisix/plugin/runner/handler/A6ConfigHandler.java#L54-L55
   > 
   > `token` is `config_id`, and is generated by APISIX.
   
   The 'token' seems to be obtained from response  , but response is invoked only when the request is rejected.  Is there another way to get a token?
   [https://github.com/apache/apisix-java-plugin-runner/blob/main/docs/en/latest/development.md#rewrite-request](https://github.com/apache/apisix-java-plugin-runner/blob/main/docs/en/latest/development.md#rewrite-request)


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass edited a comment on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass edited a comment on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-900328954


   > > Find a way to get the `config_id` and get the cache based on the `config_id`.
   > > But I don't know why you would want to do that.
   > 
   > Did you say config_id is the key of Cache? Now i dont know how to get the cache's key . When is the value added to cache
   
   here: https://github.com/apache/apisix-java-plugin-runner/blob/df69b2ebd24860d2c9effc5aeaed6d1b7e8a176d/runner-core/src/main/java/org/apache/apisix/plugin/runner/handler/A6ConfigHandler.java#L54-L55
   
   `token` is `config_id`, and is generated by APISIX.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-903141660


   I don't know.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-902360091


   > Expired tokens in memory do not affect the access of new tokens
   
   yes


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-899940909


   > Find a way to get the `config_id` and get the cache based on the `config_id`.
   > 
   > But I don't know why you would want to do that.
   
   Did you say config_id is the key of Cache? Now i dont know how to get the cache's key .  When is the value added to cache


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-903075418


   > > it is only in Guava Cache
   > 
   > It is only managed by Guava Cache.
   
   I get the token, and hence the Cache<token, A6Conf> in A6ConfigHandler, and the PluginFilterChain object in A6Conf.  To get the List<PluginFilter> in the PluginFilterChain object;  In addition, I can modify the Map<String, PluginFilter> in A6ConfigHandler.  However, I overwrite the corresponding Filter in the List<PluginFilter> and Map<String, PluginFilter> with my Filter object, but I still can't get my Filter to Apisix.  What happens when I make sure my filter is in the List<PluginFilter> and the Map<String, PluginFilter>  
   【我获取到了token,也因此获取到了A6ConfigHandler中的Cache<token, A6Conf>对应的A6Conf,也获取到了a6Conf中的PluginFilterChain对象,从而获取到了PluginFilterChain对象中的List<PluginFilter>;另外A6ConfigHandler中的Map<String, PluginFilter>我也能修改了。但是我将自己的Filter对象去覆盖List<PluginFilter>与Map<String, PluginFilter>中对应的filter,依然不能够让apisix获取到我自己的filter,我确定自己的filter已经放入List<PluginFilter>与Map<String, PluginFilter>中,这种是什么情况】
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-903514341


   > I don't know.
   
   Where is the new token generated after the token expires
   【token过期后,新的token是在哪生成的】


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-900786105


   > The 'token' seems to be obtained from response , but response is invoked only when the request is rejected. Is there another way to get a token?
   
   When the runner receives the A6ConfigRequest from APISIX, it generates the `token`.
   
   here: https://github.com/apache/apisix-java-plugin-runner/blob/df69b2ebd24860d2c9effc5aeaed6d1b7e8a176d/runner-core/src/main/java/org/apache/apisix/plugin/runner/handler/A6HandlerConfiguration.java#L70-L73


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-900756284


   > > > Find a way to get the `config_id` and get the cache based on the `config_id`.
   > > > But I don't know why you would want to do that.
   > > 
   > > 
   > > Did you say config_id is the key of Cache? Now i dont know how to get the cache's key . When is the value added to cache
   > 
   > here:
   > 
   > https://github.com/apache/apisix-java-plugin-runner/blob/df69b2ebd24860d2c9effc5aeaed6d1b7e8a176d/runner-core/src/main/java/org/apache/apisix/plugin/runner/handler/A6ConfigHandler.java#L54-L55
   > 
   > `token` is `config_id`, and is generated by APISIX.
   
   The 'token' seems to be obtained from response  , but response is invoked only when the request is rejected.  Is there another way to get a token?
   [https://github.com/apache/apisix-java-plugin-runner/blob/main/docs/en/latest/development.md#rewrite-request](https://github.com/apache/apisix-java-plugin-runner/blob/main/docs/en/latest/development.md#rewrite-request)


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-900328954


   > > Find a way to get the `config_id` and get the cache based on the `config_id`.
   > > But I don't know why you would want to do that.
   > 
   > Did you say config_id is the key of Cache? Now i dont know how to get the cache's key . When is the value added to cache
   
   here: https://github.com/apache/apisix-java-plugin-runner/blob/main/runner-core/src/main/java/org/apache/apisix/plugin/runner/handler/A6ConfigHandler.java#L54-L55
   
   `token` is `config_id`, and is generated by APISIX.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-902547082


    sorry, I didn't make that clear. Guava Cache is one of memory cache. In this project, the memory cache is the Guava Cache by default.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-901776958


   hi @Rdebu ,pls take a look at this mail list:https://lists.apache.org/thread.html/r7524b2622fbdf152a83b48e8c9d680075fbe64cb0f3591e0bf3212e9%40%3Cdev.apisix.apache.org%3E ,the operating mechanism is described here.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-902739480


   
   > it is only in Guava Cache
   
   It is only managed by Guava Cache.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu edited a comment on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu edited a comment on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-903081604


   > > it is only in Guava Cache
   > 
   > It is only managed by Guava Cache.
   
   I got the token at creation time, so I got A6Conf for Cache<token, A6Conf> in A6ConfigHandler, and I got the PluginFilterChain object in A6Conf.  We get the List in the PluginFilterChain object;  In addition, I can modify the Map<String, PluginFilter> in A6ConfigHandler.  However, I overwrite the corresponding Filter in the List and Map<String, PluginFilter> with my Filter object, but I still can't get my Filter to Apisix.  I am sure that my filter has been placed in the List and Map<String, PluginFilter>, sometimes the effect is the filter that was previously overwritten, sometimes the error 503 is directly reported, what is the case  
   【我在创建时获取到了token,也因此获取到了A6ConfigHandler中的Cache<token, A6Conf>对应的A6Conf,也获取到了a6Conf中的PluginFilterChain对象,从而获取到了PluginFilterChain对象中的List;另外A6ConfigHandler中的Map<String, PluginFilter>我也能修改了。但是我将自己的Filter对象去覆盖List与Map<String, PluginFilter>中对应的filter,依然不能够让apisix获取到我自己的filter,我确定自己的filter已经放入List与Map<String, PluginFilter>中,有时候效果是之前被覆盖的filter,有时候直接报错误码503,这种是什么情况】
   ![image](https://user-images.githubusercontent.com/58921097/130315802-1dc5238a-3cbe-4f3f-a71b-486051725253.png)
   ![image](https://user-images.githubusercontent.com/58921097/130316059-d6d4d02a-16dd-46c8-a463-59cee2bbb41c.png)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu edited a comment on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu edited a comment on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-903081604


   > > it is only in Guava Cache
   > 
   > It is only managed by Guava Cache.
   
   I got the token at creation time, so I got A6Conf for Cache<token, A6Conf> in A6ConfigHandler, and I got the PluginFilterChain object in A6Conf.  We get the List in the PluginFilterChain object;  In addition, I can modify the Map<String, PluginFilter> in A6ConfigHandler.  However, I overwrite the corresponding Filter in the List and Map<String, PluginFilter> with my Filter object, but I still can't get my Filter to Apisix.  I am sure that my filter has been placed in the List and Map<String, PluginFilter>, sometimes the effect is the filter that was previously overwritten, sometimes the error 503 is directly reported, what is the case  
   【我在创建时获取到了token,也因此获取到了A6ConfigHandler中的Cache<token, A6Conf>对应的A6Conf,也获取到了a6Conf中的PluginFilterChain对象,从而获取到了PluginFilterChain对象中的List;另外A6ConfigHandler中的Map<String, PluginFilter>我也能修改了。但是我将自己的Filter对象去覆盖List与Map<String, PluginFilter>中对应的filter,依然不能够让apisix获取到我自己的filter,我确定自己的filter已经放入List与Map<String, PluginFilter>中,有时候效果是之前被覆盖的filter,有时候直接报错误码503,这种是什么情况】
   ![image](https://user-images.githubusercontent.com/58921097/130315802-1dc5238a-3cbe-4f3f-a71b-486051725253.png)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-902013096


   > > Will expired tokens still exist in Cache<token,A6Config>
   > 
   > not exist if expired. It is in the memory cache.
   
   In memory cache?  When a token becomes invalid, a new token is generated,  The new token should be supposed to replace the expired token。After a new token is generated  ,Do all subsequent requests have the new token used as the Cache key。Expired tokens in memory do not affect the access of new tokens
   【在内存缓存中?当一个token失效时生成一个新的token,那新的token理应是为了替代过期的token。新的token生成后,是不是往后的请求都已新的token作为Cache的key了。过期的token在内存中不影响新的token被访问】


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] Rdebu commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
Rdebu commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-901957774


   > > what's the logic of this,Will a token be generated every time the apisix-java-plugin-runner is accessed, or will a token be shared when certain conditions are met (for example, one token is shared for the same IP access)
   > 
   > In short, the token is generated in two cases:
   > 
   > 1. Before APISIX sends the `HttpRequest` for the first time
   > 2. When the token cache expires in APISIX
   
   Will expired tokens still exist in Cache<token,A6Config>  Or the token is deleted after it has expired, and the Cache has only one token
   【那过期的token还会存在于Cache<token,A6Config>中吗?或者是过期了就被删除,Cache中的token只有一个】


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass commented on issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59#issuecomment-901968960


   > Will expired tokens still exist in Cache<token,A6Config>
   
   not exist if expired. It is in the memory cache.
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-java-plugin-runner] tzssangglass closed issue #59: request help: I want to update the filter by code. How can i do

Posted by GitBox <gi...@apache.org>.
tzssangglass closed issue #59:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/59


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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