Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to add Storage Options through the config instead of having to create a custom Storage Bean #3093

Open
a1shadows opened this issue Aug 8, 2024 · 1 comment
Labels
priority: p2 type: enhancement New feature or request

Comments

@a1shadows
Copy link

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
@a1shadows
Copy link
Author

I would love to help implement something like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants