Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Scott White
    @kibbled
    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
    Ghost
    @ghost~5cc594f1d73408ce4fbee018
    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.

    Aditya Bhansali
    @AdityaBhansali1

    Hello, we have a micronaut PUT endpoint which takes an application/zip input as a Flowable<ByteBuffer> object. The endpoint pushes the zip to S3 using awssdk:s3:2.13.13 library and the fromPublisher with code as below.

    open fun put(@SpanTag key: String, @SpanTag contentLength: Long, bytes: Flowable<ByteBuffer<*>>) = s3.putObject(
            PutObjectRequest.builder()
                    .bucket(bucket)
                    .key(key)
                    .contentLength(contentLength)
                    .build(),
            AsyncRequestBody.fromPublisher(bytes.map {
                wrap(it.toByteArray())
            })
    )

    This works fine for zips below 100KB. Higher than that we start seeing errors like below. Any ideas on how to fix this error?

    java.lang.IllegalStateException: Only one subscriber allowed
    at io.micronaut.core.async.processor.SingleThreadedBufferingProcessor.subscribeDownstream(SingleThreadedBufferingProcessor.java:76)
    at io.micronaut.core.async.processor.SingleThreadedBufferingProcessor.subscribe(SingleThreadedBufferingProcessor.java:42)
    at io.micronaut.http.server.netty.DefaultHttpContentProcessor.subscribe(DefaultHttpContentProcessor.java:71)
    at io.micronaut.http.server.netty.binders.PublisherBodyBinder.lambda$null$0(PublisherBodyBinder.java:85)
    at io.reactivex.internal.operators.flowable.FlowableFromPublisher.subscribeActual(FlowableFromPublisher.java:29)
    at io.reactivex.Flowable.subscribe(Flowable.java:14918)
    at io.reactivex.Flowable.subscribe(Flowable.java:14865)
    at io.micronaut.reactive.rxjava2.RxInstrumentedFlowable.subscribeActual(RxInstrumentedFlowable.java:57)
    at io.reactivex.Flowable.subscribe(Flowable.java:14918)
    at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:37)
    at io.reactivex.Flowable.subscribe(Flowable.java:14918)
    at io.reactivex.Flowable.subscribe(Flowable.java:14868)
    at software.amazon.awssdk.core.async.AsyncRequestBody$1.subscribe(AsyncRequestBody.java:81)
    at software.amazon.awssdk.services.s3.checksums.ChecksumCalculatingAsyncRequestBody.subscribe(ChecksumCalculatingAsyncRequestBody.java:46)
    at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage$SdkHttpContentPublisherAdapter.subscribe(MakeAsyncHttpRequestStage.java:230)

    姜为
    @wmz7year
    hello guys

    Error Occurred: java.io.IOException: The channel was closed. This may have been done by the client (e.g. because the request was aborted), by the service (e.g. because there was a handshake error, the request took too long, or the client tried to write on a read-only socket), or by an intermediary party (e.g. because the channel was idle for too long).

    at software.amazon.awssdk.http.nio.netty.internal.NettyRequestExecutor.decorateException(NettyRequestExecutor.java:314)
    at software.amazon.awssdk.http.nio.netty.internal.NettyRequestExecutor.handleFailure(NettyRequestExecutor.java:299)
    at software.amazon.awssdk.http.nio.netty.internal.NettyRequestExecutor.makeRequestListener(NettyRequestExecutor.java:172)
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
    at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
    at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
    at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:121)
    at software.amazon.awssdk.http.nio.netty.internal.CancellableAcquireChannelPool.lambda$acquire$1(CancellableAcquireChannelPool.java:58)
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
    at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
    at io.netty.util.concurrent.DefaultPromise.access$000(DefaultPromise.java:33)
    at io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:435)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:465)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
    at java.lang.Thread.run(Thread.java:745)

    Caused by: java.nio.channels.ClosedChannelException
    at io.netty.channel.AbstractChannel$AbstractUnsafe.ensureOpen(...)(Unknown Source)

    how can I fix this? my sdk version is software.amazon.awssdk:transcribestreaming:2.16.86
    guillepb10
    @guillepb10
    hello guys, I'v been working a few days ago into add authorization to http proxies, into the netty client. This work can be reviewed into the following PR aws/aws-sdk-java-v2#2517. Could any one help me to merge this PR?
    ziyaaslam
    @ziyaaslam
    hi
    ziyaaslam
    @ziyaaslam
    i could not find aws sdk 2.x version in maven central
    could any one help?
    Ross Kerr
    @rossk14_twitter
    @ziyaaslam this is what you're looking for i think https://search.maven.org/search?q=software.amazon.awssdk
    ziyaaslam
    @ziyaaslam
    swastb
    @swastb
    Any plans on adding JMS support for SQS ? Currently we do not have any listener available. What is the best practice for a Spring Rest Service to have a SQS listener running with sdk fojava 2?
    Irene Kors
    @ik130

    Hello AWS Java community! Java SDK team is conducting a survey to learn about your recent experiences working with the AWS SDK for Java and its learning resources. Please help us improve the SDK by taking a few minutes to answer the survey questions.

    https://amazonmr.au1.qualtrics.com/jfe/form/SV_egoUorKZU48vF7E

    amsdams
    @amsdams
    hi all, good evening. I want to retrieve an object file.mp4 with s3client. it returns something like ResponseInputStream<GetObjectResponse>. When I save the file fro the inputstream it contains header with something like Content-Disposition, content-type, but I am curently only interested in the 'body' so I can verify
    rnaval
    @rnaval
    Hello! I'm currently implementing a Java app that retrieves the available clusters and node groups via the EksClient. I want to be able to retrieve the associated metrics via cloudwatch as well - but I'm not sure which namespace and dimensions I should use to be able to get the available metrics via listMetrics. I'm looking at https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html but I can't see anything for EKS there - any ideas on where to look for documentation and examples? Thanks!
    1 reply
    bhparijat
    @bhparijat
    Can I dynamically add attributes to a DynamoDbTable at run time?
    Jorge Bo
    @jorgebo10
    Hi, is there anyway to update the user agent content? I have tried with the following code with no success.
    SqsAsyncClient.builder()
                    .overrideConfiguration(ClientOverrideConfiguration.builder()
                            .putAdvancedOption(SdkAdvancedClientOption.USER_AGENT_PREFIX, "my-service-name")
                            .putAdvancedOption(SdkAdvancedClientOption.USER_AGENT_SUFFIX, "4.0")
                            .build())
                    .region(Region.US_EAST_1)
                    .build();
    Ben Podgursky
    @bpodgursky

    Hi all. I'm trying to update our code to hit the FIPS endpoints in us-east-1 (instead of the default ones) and I am wondering if there's any way to do this via config file or environment variable. On the boto3 side, for our Python code, I was able to set the region to fips-us-east-1 in ~/.aws/config and the boto3 used the FIPS endpoints automatically, but this doesn't appear to work in the Java sdk (lmk if I am missing something here)

    I'm hoping to configure the endpoint globally instead of by directly supplying URLs to the clients because I'm using spark (on Kubernertes) and I don't have direct access to a lot of the instantiated clients. There's a configuration variable for S3, but not for all the services that get called. Let me know if there's a better way to handle this that I'm missing.

    rnaval
    @rnaval
    Hello! According to the RDS metrics documentation here: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/monitoring-cloudwatch.html I can use any of the dimensions in the list to get metrics from Cloudwatch. I should be able to use all dimensions at the same time (i.e. a list of DimensionFilters passed to the query) to get metrics right? Or is this strictly just use one dimension only? (For context, when I specify multiple dimensions, I'm getting nothing, but specifying single dimensions gets metrics)
    Brad
    @brmenchl
    Hey y'all! If I'm using a BatchGetItem with an enhanced item schema, and one of the items cannot be mapped correctly, will the entire operation throw an exception? Is there a way to have the BatchGet return a list of all the successful operations or the thrown exceptions?
    Serhii Dashko
    @sergeda
    Hi all. Is there a mocked version of EcsClient? If not, how can we test code that uses that this client?
    1 reply
    Deepak Thukral
    @deepak0004
    Hi All
    What is the alternative of withHashKeyValues in the aws sdk 2? I am making the get request as follows
    GetItemRequest request = GetItemRequest.builder()
    .projectionExpression(projectionExpression)
    .tableName(tableName)
    .build();
    as alternative to
    DynamoDBQueryExpression<Details> queryExpression =
    new DynamoDBQueryExpression<Details>()
    .withHashKeyValues(new Details(user))
    .withProjectionExpression(projectionExpression);
    Can someone suggest what to use for withHashKeyValues?
    mtmmtm9
    @mtmmtm9
    What is the alternative to selectObjectContent (we use sql-queries to filter out objects) in v2 ?
    I mean for S3. The docs says it is unsupported in v2.
    rnaval
    @rnaval
    Hello! Is there a way to list all of the AWS services with active resources in a given region? For example, if I check us-west-2, I can see that there are resources for AWS/EC2 and AWS/EBS.
    For context, I want to know which service namespaces to query in Cloudwatch to get metrics (and not waste calls)
    mtmmtm9
    @mtmmtm9
    Will selectObjectContent be removed in the future from the S3-api ?
    Deepak Thukral
    @deepak0004
    @here Can someone provide some leads on the issue - aws/aws-sdk-java-v2#2760