0

我有一个在 Azure Web App 实例上运行的 Spring Boot 应用程序,它被设置为从应用程序配置中获取外部配置。

我正在使用免费的应用程序配置层,这应该足以满足我的需求,因为我的应用程序不需要频繁更新其配置属性。

该应用程序对应用程序配置服务进行了数千次调用,导致我达到了我的服务配额,因此我经常看到 http 429 错误。

我发现这篇文章解决了如何为我的应用程序属性配置更长的超时时间,但它是特定于 .NET 的,对使用 Spring Boot 的 App Configuration SDK 的人没有帮助。

4

1 回答 1

2

这取决于您使用的 Azure 应用配置库的版本。如果是 2.0.0 或更高版本,您可以在此处找到配置https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/appconfiguration/azure-spring-cloud-starter-appconfiguration-配置#supported-properties。或者,如果它是旧版本https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/appconfiguration/spring-cloud-starter-azure-appconfiguration-config#supported-properties

因此,配置应spring.cloud.azure.appconfiguration.stores[0].monitoring.watch-interval适用于 2.0.0 和spring.cloud.azure.appconfiguration.cache-expiration1.XX 版本。

此外,根据您的情况,如果您使用 2.0.0 库,您可能需要考虑使用基于推送的刷新。

于 2021-08-06T16:10:45.923 回答