GoogleCloudPlatform / GoogleCloudPlatform/spring-cloud-gcp
Option to add Storage Options through the config instead of having to create a custom Storage Bean
- Dominant language
- Java
- Stars
- 551
- Forks
- 349
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
**Is your feature request related to a problem? Please describe.**
Currently in order to customize the Storage Bean for things like retries and timeouts, the only way seems to be to initialize a custom bean like so
```
@Bean
public Storage storage() {
RetrySettings retrySettings = RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.parse(initialRetryDelay))
.setRetryDelayMultiplier(retryDelayMultiplier)
.setMaxRetryDelay(Duration.parse(maxRetryDelay))
.setMaxAttempts(maxAttempts)
.setTotalTimeout(Duration.parse(totalTimeout))
.build();
return StorageOptions.newBuilder()
.setRetrySettings(retrySettings)
.build()
.getService();
}
```
**Describe the solution you'd like**
It would be super convenient to have the ability to provide these configurations in the application.properties file itself to be picked up during auto-configuration of the bean. For eg.
```
gcp:
storage:
retry:
initial-retry-delay: 1s
retry-delay-multiplier: 2.0
max-retry-delay: 10s
max-attempts: 5
total-timeout: 1m
```
Contributor guide
Research direction
Start by locating the Storage auto-configuration and its existing application property bindings. Compare the requested retry settings with the StorageOptions configuration shown in the issue; done means the listed properties are accepted from application.properties and applied when the Storage bean is auto-configured.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, java, spring-boot
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100