andrew4699 commented on code in PR #423:
URL: https://github.com/apache/polaris/pull/423#discussion_r1829832715


##########
polaris-service/src/main/java/org/apache/polaris/service/PolarisApplication.java:
##########
@@ -261,10 +261,7 @@ public void run(PolarisApplicationConfig configuration, 
Environment environment)
         .addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, 
"/*");
 
     if (configuration.getRateLimiter() != null) {
-      environment
-          .servlets()
-          .addFilter("ratelimiter", new 
RateLimiterFilter(configuration.getRateLimiter()))
-          .addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, 
"/*");
+      environment.jersey().register(new 
RateLimiterFilter(configuration.getRateLimiter()));

Review Comment:
   (Please fact check me as I only started working with Java web services 
recently)
   
   I think all of our endpoints are in Jersey, so it shouldn't change the 
scope, but at a minimum it does push rate limiting further into the request 
handling chain.
   
   The fundamental problem seems to be that only Jersey knows how to map a 
request path to its handling method (and thus its metric name). If that mapping 
was available everywhere, most of TimedApplicationEventListener could be 
re-written as a top level filter.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to