Migrate from AWS Java SDK v1 to v2 and KPL 1.x#3
Open
a-bates wants to merge 2 commits into
Open
Conversation
AWS Java SDK 1.x reached end of support on Dec 31, 2025. Port the SNS, SQS, and Kinesis producers off the com.amazonaws namespace to keep receiving security and bug fixes. SNS/SQS move to SnsAsyncClient / SqsAsyncClient with CompletableFuture.whenComplete() in place of the v1 AsyncHandler callbacks; KPL moves to software.amazon.kinesis 1.0.7 (internals already on SDK v2) which is just an import rename. The FilterParser's stray com.amazonaws.util.StringInputStream is replaced with ByteArrayInputStream. Behavior, config flags, and credential chain are preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
KPL 1.x's generated protobuf code requires protobuf-java 4.x's RuntimeVersion class. Without this pin, BigQuery's transitive protobuf-java 3.25.5 wins and KinesisProducerConfiguration fails to load. protobuf-java 4.x is binary-compatible with 3.x generated code, so the BigQuery / PubSub paths still work (verified via their unit tests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
com.amazonaws.*namespace.SnsAsyncClient/SqsAsyncClient) withCompletableFuture.whenComplete()replacing the v1AsyncHandlercallbacks. FIFOmessageGroupId, message attributes, andignoreProducerErrorsemantics preserved.com.amazonaws:amazon-kinesis-producer:0.15.12tosoftware.amazon.kinesis:amazon-kinesis-producer:1.0.7— KPL 1.x is internally on SDK v2 and the public Java API is source-compatible; the change is an import rename.FilterParser's straycom.amazonaws.util.StringInputStreamreplaced withByteArrayInputStream(UTF-8).pom.xml: replacedaws-java-sdk-{core,sns,sqs,sts}@1.12.782with the v2 BOM at2.34.0(sns/sqs/sts), removed a duplicateaws-java-sdk-coreentry.Behavior, CLI flags, config properties, and credential chain are unchanged. SDK v2's
DefaultCredentialsProvidercovers the same sources (env, sys-props, IRSA via STS, profile, IMDS) as v1's chain.Test plan
grep -r com.amazonaws src/ pom.xmlreturns nothingmvn dependency:tree | grep com.amazonawsreturns nothing (zero v1 artifacts remain transitively)mvn -DskipTests packagebuilds cleanlymvn -Dtest=MaxwellSNSProducerTest,KinesisCallbackTest test— 5/5 passmvn -Dtest=FilterTest test— 16/16 pass (exercises the FilterParser change)--producer=sqs→ LocalStack SQS. Insert/update/delete on a test table; all 4 events arrive in the queue with correct payloads (includingoldvalues on update). SDK v2 builder + endpoint override + credential chain code path verified end-to-end against a real SQS-compatible endpoint.🤖 Generated with Claude Code