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
-
The upcoming AWS SDK for Kotlin release, 0.20.0-beta on Jan. 26, 2023, introduces a breaking change to the API definition of
HttpClientEngine
by removing theCloseable
supertype from the interface.Background
The AWS SDK for Kotlin defines the
Closeable
interface asIn the past, the
HttpClientEngine
interface implementedCloseable
as a supertype. This detail has been internalized within the SDK and now only applies to SDK-provided HTTP clients, as only internally-managedHttpClientEngine
s are closed by the SDK.Breaking changes
The interface definition for
HttpClientEngine
is nowIn practice, this now means external implementations are not required to implement cleanup logic via the
Closeable
interface.How to migrate
If your project implements its own
HttpClientEngine
, you will need to remove theoverride
keyword 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