awslabs / aws-sdk-kotlin

Multiplatform AWS SDK for Kotlin
Apache License 2.0
398 stars 49 forks source link

Call the Kotlin SDK from Java #433

Open kggilmer opened 2 years ago

kggilmer commented 2 years ago

Community Note

Describe the Feature

Support the ability to use the Kotlin SDK (JVM platform) from Java programs.

Is your Feature Request related to a problem?

Currently the Kotlin SDK does not provide a way of calling service operations in a way that is compatible with Java. Additionally, the model type builders, while technically usable, are not simple or obvious to use when coming from a Java builder perspective.

Proposed Solution

Provide a capability in the SDK such that SDK functionality can be used from Java. This may be built-in or as an additional add-on layer.

Describe alternatives you've considered

Due to inherent compatibility issues between Kotlin and Java concurrency, there is not a way of enabling Java interop without updating the codegen on service client interfaces and their implementations.

Additional Context

cloudshiftchris commented 1 year ago

Use the AWS Java SDK, which is idiomatic for Java usage. The Kotlin SDK is idiomatic for Kotlin, and includes things that don't exist in Java - DSL builders, coroutines (suspend functions) - why expend effort bridging all those when you can just import the Java SDK.

aajtodd commented 1 year ago

This is just a feature request to track/gauge interest. One of the reasons this may be important for people is if they are migrating a large Java codebase to Kotlin. I don't think this would be part of the core SDK IF we offered anything here at all.