BREAKING: HttpClientEngine no longer implements Closeable #818
lucix-aws
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The upcoming AWS SDK for Kotlin release, 0.20.0-beta on Jan. 26, 2023, introduces a breaking change to the API definition of
HttpClientEngineby removing theCloseablesupertype from the interface.Background
The AWS SDK for Kotlin defines the
Closeableinterface asIn the past, the
HttpClientEngineinterface implementedCloseableas a supertype. This detail has been internalized within the SDK and now only applies to SDK-provided HTTP clients, as only internally-managedHttpClientEngines are closed by the SDK.Breaking changes
The interface definition for
HttpClientEngineis nowIn practice, this now means external implementations are not required to implement cleanup logic via the
Closeableinterface.How to migrate
If your project implements its own
HttpClientEngine, you will need to remove theoverridekeyword from itsclose()declaration, as the function no longer overrides anything. You are free to leave the method as-is or move resource cleanup elsewhere within your codebase.Alternatively, you can change your implementation's supertype to
CloseableHttpClientEngine, which is a new interface included in this release that SDK-provided clients implement. As always, the SDK will NOT callclose()or manage the lifecycle of any resources passed explicitly to an SDK client's config by the caller.If you have any questions or concerns regarding this change, please don't hesitate to engage with us in this discussion thread.
Beta Was this translation helpful? Give feedback.
All reactions