Difficulties while upgrading the AWS JAVA SDK from 1.x.x to 2.x.x #3536
Replies: 33 comments 7 replies
-
Hello @pjonnlagadda , Thank you very much for your submission. There exists multiple changes between the two versions. You would need to update your code appropriately while migrating from v1 to v2. The Developer Guide describes the main changes to be aware of when converting an application from using the AWS SDK for Java version 1.x to version 2.x. The 1.11 to 2.0 Changelog is also a good resource to see changes between the two versions. If your application depends on libraries that have not yet been released in version 2.x, see Using both SDKs side-by-side to learn how to configure your pom.xml to use both 1.x and 2.x. Best, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi @yasminetalby , |
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda , Thank you very much for the information. You will need to update your code based on the changes between the two version of the SDK. Another good resource to look at for an overview of the use of different services in AWS Java SDK v2 is in aws-docs/aws-doc-sdk-examples/javav2/example_code. This does not seems like a bug but more a documentation question so I will change the label on the issue. Sincerely, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi @yasminetalby, So the final conclusion you mean, As I we have policy related classed in V1 com.amazonaws.auth.policy are found in the V2 test folder. But not all. Any idea where I can found them all or any examples like how can we start using them in the V2? Thanks in Advance. |
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda , Yes exactly! This is the V1 package com.amazonaws.auth.policy Here is the V2 package software.amazon.awssdk.core.auth.policy If you need example for a specific use case you can also submit a documentation request to the aws-docs team to ask for new documentation of a specific use case here under feature-request. I hope these resources help! Is there any way we can improve the documentation provided on the migration guide to facilitate migration from AWS Java SDK V1 to V2 on your end? We would love to have any feedback on your experience and what you would find helpful/valuable to support you through this process. Sincerely, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi @yasminetalby, Thanks in Afvance |
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda, Of course. Could you please provide the code sample you are trying to migrate to v2? Best, Yasmine |
Beta Was this translation helpful? Give feedback.
-
It looks like this issue has not been active for more than five days. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please add a comment to prevent automatic closure, or if the issue is already closed please feel free to reopen it. |
Beta Was this translation helpful? Give feedback.
-
Hi Yasminetalby, S3Client s3 = S3Client.builder() Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda ,
Let me know if you have any further questions! Best, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi Yasmine,
|
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda , Here is the documentation covering DeleteMessageBatchRequestRequest.Builder and DeleteMessageBatchEntry.Builder Here is also all the AWS Java SDK v2 documentation for usage of SQS. It doesn't go over DeleteMessageBatchRequestEntry.builder however the example on Send a batch of message to queue should give you enough guidance on how to use the DeleteMessageBatchRequest.builder and DeleteMessageBatchRequest.builder. Documentation on full example of the usage of SQS in AWS Java SDK v2 can also be found in the aws-docs repository here. This documentation can be helpful to further your knowledge on how to use the sdk v2 for SQS. Let me know if you have any further questions! Best, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi Yasmine, In V2 migration to the below class i am not able to find any thing related to end point configuration except the "endpointOverride" where we cannot set the region and for .statndared also bydefault support? |
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda , Of course! This is documented in the1.11 to 2.0 Changelog provided earlier. You can find this information under : AWS Client Configuration: Custom Regions, Credentials and Endpoints The example provided is for DynamoDBClient but this documentation is relevant for general endpoint configuration. See the v1.11.x endpoint configuration syntax:
And the v2.0 endpoint configuration syntax:
Looking at the documentation for the KinesisClientBuilder in v2 you can find both region and endpointOverride method used in the syntax above. Best, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi @yasminetalby,
What i see in the V1 log In V2 `_
_` What i see in the V2 log Not understanding what went wrong, is headers part something missing in the V2 where as compare to V1?, Can you please help on make this further?. |
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda , I hope that you are doing well. I was wondering if you would be ok for me to transfer this GitHub Issue to General Discussion. Let me know if that is ok with you! Best, Yasmine |
Beta Was this translation helpful? Give feedback.
-
I am OK to make it general. But i want to continue this thread for my further migration activities also. |
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda , Thank you very much for your response. Sincerely, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi @yasminetalby, When i unzip the jar file it has been observed that below structure
Thanks in advance. Regards, |
Beta Was this translation helpful? Give feedback.
-
Hello Praveen, I can confirm that is the structure for the Best, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi @yasminetalby |
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda , Unfortunately we do not have documentation in the AWS SDK Java V2 on shading external jars as this is a general question. We provide guidance documentation regarding SDK specific information.
Sincerely, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi @yasminetalby, |
Beta Was this translation helpful? Give feedback.
-
Hi @yasminetalby, Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Hello @pjonnlagadda , Thank you very much for reaching out! Unfortunately, this feature is not yet available in v2. #272 is the right place to look for update regarding the issue release. Per the feature-request prompt, the current work around is to use the v1 SDK on the side until this feature is released. Best regards, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hi @yasminetalby, Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Thank you @debora-ito. Can you have any code examples to set the Client configuration options in S3Client, especially i want to set the The maximum number of open connections (ClientConfiguration.withMaxConnections(xxx))? i am following this for my synchronized threads and referring the Client Configuration section in https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/migration-whats-different.html Regards, |
Beta Was this translation helpful? Give feedback.
-
Hi @debora-ito, But V1 for the same code it is working as expected. Is that the calling of "EC2MetadataUtils.getInstanceInfo().getAccountId()" results the same awsAccountId irrespective of the internal implementation between the V1 & V2??
Thanks in advance |
Beta Was this translation helpful? Give feedback.
-
HI @debora-ito, Right now i am trying with below code, But i dont see any default values for maxConnections=50 for the sqs client configuration?? Thanks in Advance |
Beta Was this translation helpful? Give feedback.
-
Hi @debora-ito / @yasminetalby I don't see any S3ObjectResource from the package software.amazon.awssdk.core.auth.policy to create the resource with S3ObjectResource. Can you help me on completing the creation of Statement withResources provided parameters? Ex:- Question #2: What are replacements of V1 Enums like SQSActions, IAMAction, S3Actions etc in V2?? |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
As i am trying to migrate aws-sdk-java from V1 to V2,
to make start i have replaced the artifacts in pom.xml accordingly for S3, STS, SQS and IAM etc.. . Later when i am trying to build, getting few of the compile errors saying that, classes like AmazonSQS, SQSActions are missing and many other compile errors for few other classes. Seems the package "com.amazonaws.auth.policy" is missing.
Ex:-
constructor S3BucketResource in class com.amazonaws.auth.policy.resources.S3BucketResource cannot be applied to given types;
required: java.lang.String
found: java.lang.String,java.lang.String
Expected Behavior
Is there any smooth way to replace V2 from V1?
Current Behavior
getting few of the compile errors saying that, classes like AmazonSQS, SQSActions are missing
Reproduction Steps
Replace the artifacts in pom.xml accordingly for S3, STS, SQS and IAM etc.
Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
AWS SDK for Java 2.0
JDK version used
java 1.8
Operating System and version
Windows 11 Enterprise
Beta Was this translation helpful? Give feedback.
All reactions