Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Pragnesh Rathod
    @pragneshrathod

    Hello All,

    Any pointer on how to update/set a specific attribute value in a DynamoDB versioned table using aws-sdk-java-v2?

    Also how one can use enhanced client with timed-series DynamoDB tables (eg. TestResultsOCT2020, TestResultsNOV2020 etc. Here the associated java entity class would be "TestResults" without time-series and not "TestResultsOCT2020" )

    Pragnesh Rathod
    @pragneshrathod

    Hello All,

    Any Idea how I can get GSI (global secondary indexes) associated with @DynamoDbSecondaryPartitionKey using sdkV2 enhanced DynamoDB client?

    TableSchema.fromBean(clazz).tableMetadata().indices() does provide IndexMetadata (name, primary & sortkey), but does not reveal any association with @DynamoDbSecondaryPartitionKey or @DynamoDbSecondarySortKey, either.

    1 reply
    zhenglin.luo
    @ZhenglinLuo_twitter
    Hi @all
    Caused by: java.util.concurrent.CompletionException: java.io.IOException: Server failed to send complete response
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
        at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:943)
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:926)
        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
        at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
        at software.amazon.awssdk.core.internal.http.async.CombinedResponseAsyncHttpResponseHandler.onError(CombinedResponseAsyncHttpResponseHandler.java:67)
        at software.amazon.awssdk.core.internal.http.async.AsyncAfterTransmissionInterceptorCallingResponseHandler.onError(AsyncAfterTransmissionInterceptorCallingResponseHandler.java:72)
        at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage$WrappedErrorForwardingResponseHandler.onError(MakeAsyncHttpRequestStage.java:159)
        at software.amazon.awssdk.http.nio.netty.internal.ResponseHandler.lambda$notifyIfResponseNotCompleted$2(ResponseHandler.java:401)
        at software.amazon.awssdk.http.nio.netty.internal.ResponseHandler.runAndLogError(ResponseHandler.java:180)
        at software.amazon.awssdk.http.nio.netty.internal.ResponseHandler.notifyIfResponseNotCompleted(ResponseHandler.java:401)
        at software.amazon.awssdk.http.nio.netty.internal.ResponseHandler.channelInactive(ResponseHandler.java:152)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
        at io.netty.handler.logging.LoggingHandler.channelInactive(LoggingHandler.java:197)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
        at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:81)
        at io.netty.handler.timeout.IdleStateHandler.channelInactive(IdleStateHandler.java:277)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
        at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelInactive(CombinedChannelDuplexHandler.java:418)
        at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:386)
        at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:351)
        at io.netty.handler.codec.http.HttpClientCodec$Decoder.channelInactive(HttpClientCodec.java:288)
        at io.netty.channel.CombinedChannelDuplexHandler.channelInactive(CombinedChannelDuplexHandler.java:221)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
        at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:386)
        at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:351)
        at io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:1084)
        at io.netty.channel.AbstractChannelHandlerCon
    Bishwajit Vikram
    @bishwajit01

    My table

    Id PID AID
    — ——— ————
    1 2 a
    2 2 b

    I want to delete the row which has AID=a, and i dont know the Id and PID.
    I am trying to delete with dynamodbExpressionAttribute.. but unable to do so in JAVA.
    Can someone help ?

    David Ankin
    @alexanderankin
    how can i increase the http pool size in s3? thanks
    David Ankin
    @alexanderankin
    for now i just added the dependency on the apache client, but thats interesting, it mentions that method but not the class it belongs to?
    if i understand correctly, you cant just attach an "SdkHttpConfigurationOption" to the s3client builder, right?
    so that method is present on the netty client which needs an additional dependency, is @Overrides or anything like that, super intuitive lol
    croudet
    @croudet
    Here is an example for netty http client, you can follow the the same pattern for apache
    final SdkEventLoopGroup sdkEventLoopGroup;
            if (Epoll.isAvailable()) {
                sdkEventLoopGroup = SdkEventLoopGroup.create(new EpollEventLoopGroup(eventLoopGroupThreads), HttpClientConfiguration::createEpollSocketChannel);
            } else {
                sdkEventLoopGroup = SdkEventLoopGroup.create(new NioEventLoopGroup(eventLoopGroupThreads), HttpClientConfiguration::createNioSocketChannel);
            }
            final NettyNioAsyncHttpClient.Builder nettyNioAsyncHttpClientBuilder = NettyNioAsyncHttpClient.builder()
                    .connectionMaxIdleTime(connectionMaxIdleTime)
                    .connectionAcquisitionTimeout(connectionAcquisitionTimeout)
                    .connectionTimeout(connectionTimeout)
                    .readTimeout(readTimeout)
                    .maxConcurrency(maxConnections)
                    .maxPendingConnectionAcquires(maxPendingConnectionAcquires)
                    .eventLoopGroup(sdkEventLoopGroup)
                    .sslProvider(OpenSsl.isAvailable() ? SslProvider.OPENSSL : SslProvider.JDK);
            log.info("Netty async http client - openssl: {} - epoll: {}", OpenSsl.isAvailable(), Epoll.isAvailable());
            if (!OpenSsl.isAvailable()) {
                log.info("OpenSSL reason: {}", OpenSsl.unavailabilityCause().getMessage(), OpenSsl.unavailabilityCause());
            }
            if (!Epoll.isAvailable()) {
                log.info("Epoll reason: {}", NestedExceptionUtils.getMostSpecificCause(Epoll.unavailabilityCause()).getMessage());
            }
            return nettyNioAsyncHttpClientBuilder.build();
    Then with that client:
    final S3AsyncClientBuilder clientBuilder = S3AsyncClient.builder()
                    .httpClient(asyncHttpClient)
                    .region(region);
    Craig Artley
    @cartley_gitlab

    I searched for some online Javadoc and found 2 sources that both claim to be latest, for 2.15.68. For example for StsAssumeRoleCredentialsProvider.Builder:

    https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/sts/auth/StsAssumeRoleCredentialsProvider.Builder.html
    and
    https://javadoc.io/doc/software.amazon.awssdk/sts/latest/software/amazon/awssdk/services/sts/auth/StsAssumeRoleCredentialsProvider.Builder.html

    The first shows it extends Object. The second extends BaseBuilder and obviously supplies more methods.
    Why are they different? What is the correct source?

    2 replies
    Jaspreet Chhabra
    @JaspreetChhabra
    Hi all,
    I am trying to update a single attribute using UpdateItemEnhancedRequest (using the Dynamodb Enhanced Client. - JAVA SDK 2). I am able to build the condition for updating the attribute but it updates the entire item and not just the attribute. Can somebody please guide on how to update a single attribute using DynamoDb Enhanced Client? just like we do using the update expression
    7 replies
    sken
    @sken77
    wen DAX?
    MariemSoussiDev
    @MariemSoussiDev
    Hello,
    How to convert job.json to a JobSettings (AWSMediaConvert)
    lololajoie
    @lololajoie_gitlab

    Hi

    I'm developping a SpringBoot application in java with Intellij and I need to list files from a S3.
    I'm behind a proxy
    I'm using the AWS java sdk V2 and I can't set a proxy for the s3Client to access files on S3

    Does anyone use AWS java sdk (v1 or v2) and may help me configure the proxy (in code or in Intelij configuration) ?

    Thanks

    I tried to use
    SdkHttpClient httpClient = ApacheHttpClient.builder()
    .proxyConfiguration(proxyConfiguration)
    .build();
    but I got
    java.lang.IllegalArgumentException: Proxy endpoint path is not supported.
    lololajoie
    @lololajoie_gitlab
    Nevermind
    I fix the URI for proxy
    now I've got an ssl error
    So, another issue
    Lewis Diamond
    @lewisdiamond
    I'm looking for some DynamoDB examples for aws sdk v2 with partiql. Does anyone have a good reverence handy?
    1 reply
    Lewis Diamond
    @lewisdiamond
    How can I set a limit for a DynamoDB query using new ExecuteStatementRequest()?
    Brad
    @brmenchl

    Hey y'all I'm running into a dead end when trying to used the dynamodb-enhanced client to update only specific fields on an object without doing an extra read.

    Lets say I only have the partition/sort key for an item, and I want to unset one attribute on that item. If I use the enhanced client updateItem, I need to use ignoreNulls(false) so my null attribute gets propagated, but without the rest of the item data, this will unset all the attributes, not just the one in question. The only solution I've found is to first getItem to get all the item data, set the specific field to null, and pass that whole object back into updateItem. It feels wrong to do an entire database read just to satisfy the sdk. Is there a way to blacklist or whitelist certain attributes relating to ignoreNulls?

    I've had to revert back to using the old sdk to use an updateExpression
    2 replies
    KillzoneAgency
    @DanielMBrown

    Hoping someone might be able to provide some clarity as I'm not 100% sure based off of reading the code...

    Does does the S3Client.putObject method stream requests (reading a bit of a file at time and uploading it before grabbing more), or do it all at once (Up to the max file size, which is where multipart uploads would be used)?

    anmolgarg552
    @anmolgarg552
    Is anyone working on the aws/aws-sdk-java-v2#392
    1 reply
    sken
    @sken77
    1 reply
    is this just copying from the sdk1 1?
    pacozaa
    @pacozaa
    Hello guys, I would like to know how to manual pagination the scan method, It seems like the scan will always auto paginated. How to disable the auto paginated feature in dynamo library?
    Reed Passaretti
    @reed53
    Hello, I was working on a pull request for the following issue: aws/aws-sdk-java-v2#2280
    I have completed the changes I wish to make, however I don't have permission to create a branch. How can I get permission to push my code?
    sampathg
    @sampathg
    Hello , i am looking for documentation on using software.amazon.awssdk.services.batch package . Can anyone help me out !
    2 replies
    Scott White
    @kibbled
    How does one list the directories within a prefix?
    ListObjects seems to be recursive and lists objects beneath the prefix requested
    looking for results similar to the cli:
    aws s3 ls
    Bishwajit Vikram
    @bishwajit01
    i am able to store Map<Enum, Enum> enumMap in Dynamodb.
    while retrieving it is giving class cast exception.
    is there any option?
    Gavin McClellan
    @gmcclellan_gitlab
    So reading the docs for S3Client.headBucket() it says that it will return a 200 if the bucket exists and the credentials have access to it, a 404 if the bucket does not exist (globally) and a 403 if the credentials don't have access to it. The return object from this call contains a SdkHttpResponse which contains a statusCode. I expected this to contain the 200, 403, or 404 like every Http response object from all Http clients I have ever used. Instead of getting a 404 when the bucket doesn't exist it throws a NoSuchBucketException. The error message says 404, but what good is it at that point? is this really the intended behavior, the docs are really open to interpretation.
    1 reply
    Thomas Gray
    @thomgray
    Hello all :wave:. I was wondering if there were any plans to create an x-ray-recorder library under v2? I understand that the idea is to use the com.amazonaws:aws-xray-recorder-sdk-* with the aws-xray-recorder-sdk-aws-sdk-v2 module for v2 services integrations, but this library is still itself build on top of com.amazonaws:aws-java-sdk-xray (i.e. v1). Or is there already an alternative to that recorder library that I'm not finding?
    2 replies
    Aleksandr-Filichkin
    @Aleksandr-Filichkin
    Hi all,
    Is dynamodb-enhanced compatible with GraalVM native?
    I'm getting
    Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:315)
    Caused by: java.lang.IllegalArgumentException: Failed to generate method handle.
    at software.amazon.awssdk.enhanced.dynamodb.internal.mapper.LambdaToMethodBridgeBuilder.build(LambdaToMethodBridgeBuilder.java:92)
    at software.amazon.awssdk.enhanced.dynamodb.internal.mapper.ObjectConstructor.create(ObjectConstructor.java:37)
    at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.newObjectSupplierForClass(BeanTableSchema.java:361)
    at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.createStaticTableSchema(BeanTableSchema.java:172)
    at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.create(BeanTableSchema.java:129)
    at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.create(BeanTableSchema.java:121)
    at software.amazon.awssdk.enhanced.dynamodb.TableSchema.fromBean(TableSchema.java:81)
    GraalVm 21.1 supports method handler . but I cannot solve it. Graalvm agent generated reflect-config doesn't help
    shapan dashore
    @shapan1
    Could someone point me to example or reference on how to use embedded dynamoDB local to be for integration testing in Spring Application?
    Currently I have running on testcontainers but unfortunately when I push my code to CI there's an issue where I cannot run a docker container inside a already running container
    Ali Ustek
    @austek
    after upgrading awssdk from 2.11.4to 2.16.56 we get
    Caused by: java.lang.NullPointerException
        at software.amazon.awssdk.core.internal.handler.BaseClientHandler.finalizeSdkHttpFullRequest(BaseClientHandler.java:81)
        at software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.doExecute(BaseAsyncClientHandler.java:196)
        ... 92 more
    7 replies
    above caused by Null metrics collector
    Marcin Szałomski
    @baldram

    Dear AWS Team!
    Please help me to confirm a feature I found by trying. A static execution of "handler" method.
    I'm trying to figure out a feature which I couldn't find documented anywhere, as well as when looking on Github into source code.
    Would you please help me to find a documentation or source code regarding to the following behavior I observed?

    A feature is very helpful, but I would like to double check that I will not rely on some experimental or deprecated functionality.

    According to documentation (https://docs.aws.amazon.com/lambda/latest/dg/java-handler.html) there are two handler formats.
    If we define in template.yml the following...

    MyFeatureLambda
      Type: AWS::Serverless::Function
      Properties:
        ...
        Handler: com.acme.some.MyFeatureLambda
        ...

    ...then a new instance of MyFeatureLambda class is created and a method executed on it.
    Next, something like below is happening on AWS side, under the hood:

    MyFeatureLambda handler = new MyFeatureLambda;
    handler.handleRequest(input, output, context);

    If we define Handler: com.acme.some.MyFeatureLambda::handleRequest it works in a similar way.

    Now, an interesting (undocumented?) feature. When we define handler as following (using apply):

    Handler:  com.acme.some.MyFeatureLambda::apply

    From my observation, I'm guessing that under the hood it is happening something like this:

            MyFeatureLambda.apply(input, output, context);

    Here, it calls an apply directly in a static way without instantiating the class. I tested the functionality by implementing a lambda class without no-arg constructor, so instantiating of a class is not possible, but lambda is correctly executed. Now, I'm able to implement the apply method according to needs and call handleRequest from there myself, what I do. It works well. But... I couldn't find it documented that apply is executed in a static way.

    This is what I need. Please help me make sure about this functionality by pointing to a place in the documentation or code on Github.
    Thanks!

    Marcin Szałomski
    @baldram
    Ok, I think I have it! There is a check that a method is static.
    https://github.com/aws/aws-lambda-java-libs/blob/311f97cc47b414633c62ee96d9df3e8404e14d69/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/EventHandlerLoader.java#L331
    In the case when in template.yml it was defined in a way: Handler: com.acme.some.MyFeatureLambda::handleRequest but a method was not static, this didn't work.
    Now, if my apply method is static, all works fine. So I answered my own question ;-)
    lingting
    @lingting
    Hello everyone, I am using Java software.amazon.awssdk:s3:2.16.59 for development, and I found the last request made by my code (host: s3.ap-southeast-1.amazonaws.com path: /{Bucket) /{Key+}) ;Currently I can use it normally, but I found in the document (https://docs.aws.amazon.com/zh_cn/AmazonS3/latest/userguide/VirtualHosting.html) that this request form will It is deprecated, I have studied for a long time, I did not find how to convert to the recommended request form in the document, I want to rewrite DefaultS3Client; but unfortunately I can't do it, so I want to ask, is there any way to solve my problem ? Thanks!
    2 replies
    PeteStanSmith
    @PeteStanSmith
    Hey everyone. Does anyone have a way to migrate a version 1 SqsListener to version 2.x or is polling the queue my only option? There's issue in the backlog so I don't think there is on inside of the sdk aws/aws-sdk-java-v2#25 and there doesn't appear to be any SQS waiter. Any suggestion would be welcome. Thanks
    bhavin9695
    @bhavin9695
    HI Everyone , is there any aws office sdk support for secret manager caching in java v2 like it has for v1 : https://github.com/aws/aws-secretsmanager-caching-java
    2 replies
    José Luis López Bellido
    @PepeluDev
    Hi everyone! I am trying to set up a "NettyNioAsyncHttpClient" from the aws sdk 2 to request resources from an API gateway using http2. I haven't been able to configure the client properly and haven't been able to make the client work with http2 (yes with http1.1) I haven't found anything in the docs that tells me what i need. I recently figure out that i need to configure SSL but haven't found much about the parameters that i need to use. Do you have any idea of what could i have i missed? Thanks a lot!
    yamini-ban
    @yamini-ban

    Hi, does anyone have any idea what could be the reason I am having this exception?

    Exception encountered when invoking run on a nested suite - software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: Acquire operation took longer than the configured maximum time. This indicates that a request cannot get a connection from the pool within the specified maximum time. This can be due to high request rate.
    Consider taking any of the following actions to mitigate the issue: increase max connections, increase acquire timeout, or slowing the request rate.
    Increasing the max connections can increase client throughput (unless the network interface is already fully utilized), but can eventually start to hit operation system limitations on the number of file descriptors used by the process. If you already are fully utilizing your network interface or cannot further increase your connection count, increasing the acquire timeout gives extra time for requests to acquire a connection before timing out. If the connections doesn't free up, the subsequent requests will still timeout.
    If the above mechanisms are not able to fix the issue, try smoothing out your requests so that large traffic bursts cannot overload the client, being more efficient with the number of times you need to call AWS, or by increasing the number of hosts sending requests.
    java.util.concurrent.CompletionException: software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: Acquire operation took longer than the configured maximum time. This indicates that a request cannot get a connection from the pool within the specified maximum time. This can be due to high request rate.
    Consider taking any of the following actions to mitigate the issue: increase max connections, increase acquire timeout, or slowing the request rate.
    Increasing the max connections can increase client throughput (unless the network interface is already fully utilized), but can eventually start to hit operation system limitations on the number of file descriptors used by the process. If you already are fully utilizing your network interface or cannot further increase your connection count, increasing the acquire timeout gives extra time for requests to acquire a connection before timing out. If the connections doesn't free up, the subsequent requests will still timeout.
    If the above mechanisms are not able to fix the issue, try smoothing out your requests so that large traffic bursts cannot overload the client, being more efficient with the number of times you need to call AWS, or by increasing the number of hosts sending requests.