-
Notifications
You must be signed in to change notification settings - Fork 0
[Chore&Feature] Add external dependency resilience and degraded fallbacks #144
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
52cad83
[Fix] Remove Blooming Cache
char-yb 50b6a80
[Feature] Add external dependency resilience and degraded fallbacks
char-yb 70459b9
Update pida-clients/oauth-client/src/main/kotlin/com/pida/client/oautโฆ
char-yb d462d93
Update pida-core/core-api/src/main/kotlin/com/pida/config/resilience/โฆ
char-yb 4b76eea
[Test] Fix core-domain suspend mocking and event publisher assertions
char-yb aeb94eb
[Fix] Harden FlowerSpotFacade preview image fallback
char-yb 42c37fb
Merge branch 'develop' into chore/circuit-breaker
char-yb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐งฉ Analysis chain
๐ Script executed:
Repository: Team-PIDA/Pida-Server
Length of output: 5146
๐ Web query:
AWS SDK v2 httpClient vs httpClientBuilder ownership lifecycle๐ก Result:
In AWS SDK for Java 2.x, SdkHttpClient instances (like ApacheHttpClient) manage connection pools and resources that must be closed explicitly. There are two primary patterns for using HttpClient and HttpClientBuilder: 1. Dedicated HTTP client (recommended best practice): Use serviceClient.builder.httpClientBuilder(HttpClientType.builder.config).build. The service client creates, owns, and manages the lifecycle of the HTTP client. When serviceClient.close is called, it automatically closes the HTTP client, preventing resource leaks. 2. Shared HTTP client: Build the client separately with HttpClientType.builder.config.build, then pass it to multiple serviceClient.builder.httpClient(sharedClient).build. You (the application) own the lifecycle and must explicitly call sharedClient.close after closing all service clients that use it. The SDK does not close shared clients automatically. All SdkHttpClient implementations (ApacheHttpClient, Apache5HttpClient, UrlConnectionHttpClient, etc.) follow this ownership model. Service clients are thread-safe and should be reused where possible; always close them when done to release HTTP resources. Examples from docs: Dedicated: S3Client s3Client = S3Client.builder .httpClientBuilder(ApacheHttpClient.builder.maxConnections(100)) .build; s3Client.close; // Closes embedded HTTP client Shared: SdkHttpClient httpClient = ApacheHttpClient.builder.maxConnections(100).build; S3Client s3 = S3Client.builder.httpClient(httpClient).build; DynamoDbClient ddb = DynamoDbClient.builder.httpClient(httpClient).build; s3.close; ddb.close; httpClient.close; // Required
Citations:
๐ Web query:
AWS SDK S3Client close() httpClient lifecycle management behavior๐ก Result:
In the AWS SDK for Java 2.x, both S3Client (synchronous) and S3AsyncClient (asynchronous) implement AutoCloseable and SdkAutoCloseable. Calling close on these service clients releases resources such as threads and the HTTP connection pool managed by the embedded HTTP client (ApacheHttpClient for sync S3Client by default, NettyNioAsyncHttpClient for async). Key behaviors: - Each service client maintains its own HTTP connection pool for performance (reusing connections avoids establishment overhead). - Service clients are thread-safe and intended for reuse across requests. - close should be called on unused clients to prevent resource leaks (threads, connections). - If you provide a custom/external HTTP client via S3Client.builder.httpClient(yourHttpClient), the service client's close does NOT close the shared HTTP client; you must close it explicitly after all service clients using it are closed. - Default/embedded HTTP clients are managed and closed by the service client. - Post-close, the client should not be used; attempts may fail (no isClosed method exists). Best practice: Reuse a single client instance application-wide; close only at shutdown. For short-lived clients, always close explicitly or use try-with-resources. Example (default embedded HTTP client): S3Client s3 = S3Client.builder.build; // Use s3... s3.close; // Releases embedded ApacheHttpClient connection pool & threads Example (shared external HTTP client): SdkHttpClient httpClient = ApacheHttpClient.builder.build; S3Client s3 = S3Client.builder.httpClient(httpClient).build; DynamoDbClient ddb = DynamoDbClient.builder.httpClient(httpClient).build; // Use clients... s3.close; // Does NOT close httpClient ddb.close; httpClient.close; // Explicitly close shared client last
Citations:
Use
.httpClientBuilder()to ensure HTTP client lifecycle is managed by the SDK.With AWS SDK v2,
.httpClient()requires the application to own and manage the HTTP client lifecycle. Passing a builtUrlConnectionHttpClientorNettyNioAsyncHttpClientinline means the SDK will not close them when theS3ClientorS3AsyncClientbeans are closed. Only the service clients themselves are closed viadestroyMethod = "close", leaving the HTTP clients' connection pools and threads unreleased.Prefer
.httpClientBuilder()insteadโthe SDK will create, own, and automatically close the HTTP client when the service client is destroyed.โป๏ธ Suggested direction
Also applies to: 78-89
๐ค Prompt for AI Agents