AnsweredAssumed Answered

Handle rate limiting errors when using a proxy for all requests to the map service

Question asked by greenkarmic on May 15, 2017
Latest reply on May 15, 2017 by greenkarmic



Following some script bot data mining abuse of our map services recently, we now use a proxy to throttle requests to our map services. We are using the Java version of the resource-proxy.


It works fine so far, all ArcGIS requests now go through the proxy and we enabled a few security features in the proxy configuration including rate limiting (throttling).


I modified the proxy so that only "query" requests are throttled. This way the map rendering is not affected for actual human users and it protects us against data mining by scripts. When a query request is rejected because of throttling, the response has HTTP status code 429 (too many requests).


In rare cases where a human user exceeds the number of allowed requests set by the proxy, I was wondering if it's possible (using the error handler of the queryTask in the ArcGIS API) to know the status code of the query failure. For instance if it's 429 I would display a different message to the human user in our GUI.


I parsed through the error object returned by the error handler of QueryTask, but I haven't found anything so far.


Many thanks,