Skip to content

Make Guzzle Options Dynamic by Fetching Values from Configuration #148

Open
@mdzahid-pro

Description

@mdzahid-pro

Currently, the $guzzleOptions array in the class is hardcoded with static values for timeout, max_retry_attempts, default_retry_multiplier, and retry_on_status. We must refactor these options to be dynamically set based on environment variables or configuration files to enhance flexibility and allow environment-specific configurations.

The following items should be made dynamic:

  • timeout: Set from config('basic-api.guzzle.timeout') or .env (default to 100 seconds).
  • max_retry_attempts: Set from config('basic-api.guzzle.max_retry_attempts') (default to 2 attempts).
  • default_retry_multiplier: Set from config('basic-api.guzzle.default_retry_multiplier') (default to 2.0).
  • retry_on_status: Set from config('basic-api.guzzle.retry_on_status'), allowing for dynamic status codes based on configuration (default to [429, 503, 500]).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions