Reduce requests made to App Configuration from Spring Boot application

Nathan Quirk 1 Reputation point
2021-08-06T01:02:24.073+00:00

I have a Spring Boot application deployed as a web app and this is configured to fetch externalized properties from my App Configuration resource.

I do not need my configuration properties to be reset often, yet my app is making thousands of calls, which is causing my app to get 429 errors. I can't seem to find a way to configure my Spring app to make these calls less often.

I have seen the article here about limiting requests to App Configuration but the solution is .NET specific and doesn't help me.

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
210 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,039 questions
{count} votes

1 answer

Sort by: Most helpful
  1. BhargaviAnnadevara-MSFT 5,461 Reputation points
    2021-08-06T22:05:50.32+00:00

    @Nathan Quirk Thanks for reaching out. App Configuration has two libraries for Spring: azure-spring-cloud-appconfiguration-config and azure-spring-cloud-appconfiguration-config-web. Here are some Spring Boot alternatives to match the guidance provided to reduce the number of requests made:

    • To increase the refresh timeout, you can specify a new refresh timeout using the spring.cloud.azure.appconfiguration.stores[0].monitoring.watch-interval property for the v2.0.0 library, or spring.cloud.azure.appconfiguration.cache-expiration for earlier versions.
    • Watch a single sentinel key, rather than watching individual keys. Refresh all configuration only if the sentinel key changes. See Use dynamic configuration in a Java Spring app for an example.
    • If you don't want to constantly poll for any changes, you may consider using a Push refresh model to detect changes in configuration. Once App Configuration is set up to send key value change events with Azure Event Grid, with a Web Hook, the application can use these events to optimize the total number of requests needed to keep the configuration updated. For more information, see Use dynamic configuration using push refresh in a Java Spring app.

    API References:

    Hope this helps. Do let us know if you have further questions.

    ----------

    If an answer is helpful, please "Accept answer" and/or "Up-Vote" which might help other community members reading this thread.

    0 comments No comments