aws-java-sdk

Timeout when publishing from AWS Lambda to SNS

Deadly 提交于 2019-12-04 02:45:41
I'm trying to publish some data to SNS from a Lambda function call, but it doesn't seem to be working. My function code is - public class Handler implements RequestHandler<DynamodbEvent, Void> { private static final String SNS_TOPIC_ARN = "arn:aws:sns:us-west-2:account_number:function_name"; @Override public Void handleRequest(DynamodbEvent dynamodbEvent, Context context) { LambdaLogger logger = context.getLogger(); AmazonSNSClient snsClient = new AmazonSNSClient(new DefaultAWSCredentialsProviderChain()); snsClient.setRegion(Region.getRegion(Regions.US_WEST_2)); for (DynamodbStreamRecord

API retry logic in Amazon Web Services

穿精又带淫゛_ 提交于 2019-12-04 02:09:59
http://docs.aws.amazon.com/general/latest/gr/api-retries.html This document mentions that "each AWS SDK implements automatic retry logic and AWS SDK for Java automatically retries requests." What is the default mechanism for Java AWS SDK, if i don't specify any retry config? I have been using the Java AWS SDK and get a straightforward service exception if something fails on AWS service side. I have never experienced any "automatic" retry mechanism. Can someone explain what this retry mechanism is? The same documentation page says: The AWS SDK for Java automatically retries requests, and you

AWS Java SDK Version For Creating a Lambda

匆匆过客 提交于 2019-12-01 23:14:19
I'm trying to develop a AWS Java lambda function by following the guidance described here . In it it describes the implementation of the RequestHandler interface and also references the aws-lambda-java-core library. However I am trying to use the latest SDK as recommended here but this is completely different and the RequestHandler interface doesn't appear to exist anymore. It's not clear to me what the name and version of the java libraries I need. Is there any guidance on all the different versions of the AWS java libraries there are and any updated examples. I have to admit I am completely

Could not initialize class com.amazonaws.partitions.PartitionsLoader

∥☆過路亽.° 提交于 2019-12-01 03:58:54
Using Eclipse Mars .I have already added aws java sdk 1.11.123 through install software from help.Now when i run Tomcat Server 7 I get this error: May 02, 2017 11:57:32 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [PdsServlet] in context with path [/PdsAWS] threw exception [java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.partitions.PartitionsLoader] with root cause java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.partitions.PartitionsLoader I also get java.lang.NoSuchFieldError: ALLOW_FINAL_FIELDS

Could not initialize class com.amazonaws.partitions.PartitionsLoader

社会主义新天地 提交于 2019-12-01 01:30:47
问题 Using Eclipse Mars .I have already added aws java sdk 1.11.123 through install software from help.Now when i run Tomcat Server 7 I get this error: May 02, 2017 11:57:32 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [PdsServlet] in context with path [/PdsAWS] threw exception [java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.partitions.PartitionsLoader] with root cause java.lang.NoClassDefFoundError: Could not initialize

S3 download pdf - REST API

依然范特西╮ 提交于 2019-11-29 11:54:01
I am trying to serve one of my PDF stored on S3 using Spring Boot Rest API. Following is my code : byte[] targetArray = null; InputStream is = null; S3Object object = s3Client .getObject(new GetObjectRequest("S3_BUCKET_NAME", "prefixUrl")); InputStream objectData = object.getObjectContent(); BufferedReader reader = new BufferedReader(new InputStreamReader(objectData)); char[] charArray = new char[8 * 1024]; StringBuilder builder = new StringBuilder(); int numCharsRead; while ((numCharsRead = reader.read(charArray, 0, charArray.length)) != -1) { builder.append(charArray, 0, numCharsRead); }

S3 download pdf - REST API

为君一笑 提交于 2019-11-28 04:54:35
问题 I am trying to serve one of my PDF stored on S3 using Spring Boot Rest API. Following is my code : byte[] targetArray = null; InputStream is = null; S3Object object = s3Client .getObject(new GetObjectRequest("S3_BUCKET_NAME", "prefixUrl")); InputStream objectData = object.getObjectContent(); BufferedReader reader = new BufferedReader(new InputStreamReader(objectData)); char[] charArray = new char[8 * 1024]; StringBuilder builder = new StringBuilder(); int numCharsRead; while ((numCharsRead =

Pagination with DynamoDBMapper Java AWS SDK

时光怂恿深爱的人放手 提交于 2019-11-27 18:25:16
From the API docs dynamo db does support pagination for scan and query operations. The catch here is to set the ExclusiveStartIndex of current request to the value of the LastEvaluatedIndex of previous request to get next set (logical page) of results. I'm trying to implement the same but I'm using DynamoDBMapper , which seems to have lot more advantages like tight coupling with data models. So if I wanted to do the above, I'm assuming I would do something like below: // Mapping of hashkey of the last item in previous query operation Map<String, AttributeValue> lastHashKey = ..

Pagination with DynamoDBMapper Java AWS SDK

萝らか妹 提交于 2019-11-26 19:20:59
问题 From the API docs dynamo db does support pagination for scan and query operations. The catch here is to set the ExclusiveStartIndex of current request to the value of the LastEvaluatedIndex of previous request to get next set (logical page) of results. I'm trying to implement the same but I'm using DynamoDBMapper , which seems to have lot more advantages like tight coupling with data models. So if I wanted to do the above, I'm assuming I would do something like below: // Mapping of hashkey of