Aws-sdk-java-v2: SQS Message Parsers (e.g. S3EventNotification)

Created on 9 Apr 2019  路  11Comments  路  Source: aws/aws-sdk-java-v2

I am trying to upload a file to s3 and added a event notification pointing to sqs queue. I was using S3EventNotification class to parse it earlier in SDK 1.x but I don't see that class anymore.

1.11.x Parity feature-request

Most helpful comment

Has there been any movement on this in the past few months? We have an internal product which has migrated entirely to the 2.x sdk except for parsing these event notifications and I'd like to clean up the dependency if possible

All 11 comments

We have not yet ported that class over to the v2 SDK. You should be able to continue to use the class from v1 just fine.

how about conflicts between transitive dependencies from 1.1 and 2.0?

@millems - should we port this class over as-is, or should we modify codegen to emit new shapes that aren't present in the service definition? Are there similar shapes in other services that aren't contained in the service definition?

Hmm, I'm not sure how this should be done. I don't mind hand-writing them, but I'm not sure how well we can keep up with changes that might happen in the future. Let me check on our end to see if we want to hand-write these or find some way to generate them.

Has there been any movement on this in the past few months? We have an internal product which has migrated entirely to the 2.x sdk except for parsing these event notifications and I'd like to clean up the dependency if possible

Is this issue on the roadmap? When is this planned to be released?
To be able to listen to an S3 event it means that three jars from the old SDK will be needed (s3, core and kms). Maybe it is possible to exclude some of them manually. If not then it means that this will add almost 3 MB to my Lambda which is not optimal.

Since the class (S3Event) has already been created and that there are already other Json objects that has been created for V2 it can't be that much work to add this as well.

As far as I can see this is the only class that this needs to be corrected for in all the 23 classes in the "aws-lambda-java-events" jar file.
So it would really help if this could be prioritized.

It's on a roadmap, but it's far enough down the list that there's no date assigned. I think this will be a tricky one, since it's not clear who on the AWS side would be best to own this. We're not very well equipped to keep it up to date.

That said, the SDK owns this for V1, so it's on us to figure out the next steps. It might be easier to prioritize if we start by trying to figure out who should own this. We'll start with that. That said, I can't guarantee any dates for that, so it's still "planned, but not at the top of the backlog".

While on the topic of minimizing dependencies. Is there a reason why three of the event classes uses this: "import org.joda.time.DateTime;".
All other v2 Api:s like S3 and KMS uses "java.time.Instant". The Joda time dependency adds about 600 kB which would have been nice to skip.

I understand that this can't be changed without breaking existing code but maybe new classes can be created so that developers can choose to manually exclude Joda time.

Anything that is owned by the AWS SDK for Java team going forward will not use Joda time. You can provide this feedback to the Lambda Runtime team on their repository: https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events

Any update on a port of S3EventNotification from aws-java-sdk v1 -> v2? We have a project that was forced to migrate to using v2 because v1 will not work in AWS C2S (gov classified) because of Region names not in the enum. Would be nice to have v2 updated to support S3EventNotifications when an S3 bucket gets a new object ... as our ingest feed sends an S3EventNotification to an SQS Queue. We are still using v1 to handle parsing the SQS message and parsing it to an S3EventNotification (v1).

The "com.amazonaws.services.lambda.runtime.events.S3Event" class is already available in the "aws-lambda-java-events" artifact.
I have also excluded "apache-client" and "netty-nio-client" from that artifact which works for my purpose.

"com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord" might be the more specific class you are asking for.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tigertoes picture tigertoes  路  6Comments

SamBumgardner picture SamBumgardner  路  4Comments

etspaceman picture etspaceman  路  5Comments

jhovell picture jhovell  路  4Comments

david-katz picture david-katz  路  3Comments