Description
I have an AWS Lambda function that receives an SQSEvent. I need to enable support for large messages that are stored in S3.
I'm following the instructions here: https://awslabs.github.io/aws-lambda-powertools-java/utilities/sqs_large_message_handling/
I'm using Gradle, so I add this to my build.gradle as described:
dependencies { ... implementation 'software.amazon.lambda:powertools-sqs:1.5.0' aspectpath 'software.amazon.lambda:powertools-sqs:1.5.0' }
Error: Could not find method aspectpath() for arguments [software.amazon.lambda:powertools-sqs:1.5.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler
.
Ok so I gather I need to add the AspectJ plugin, like in the Maven example (although not mentioned in the Gradle example).
In the Maven example you use the one by org.codehaus.mojo, but there doesn't seem to be an equivalent for Gradle. This one seems like the official plugin for Gradle - https://plugins.gradle.org/plugin/aspectj.gradle - so I use that.
plugins { id "aspectj.gradle" version "0.1.6" }
Error: You must set the property 'aspectjVersion' before applying the aspectj plugin
Stack Overflow https://stackoverflow.com/questions/55753896/gradle-error-you-must-set-the-property-aspectjversion-before-applying-the-as tells me to define the version in gradle.properties so I do that
Error: java.lang.IllegalStateException: Unnecessarily replacing a task that does not exist is not supported. Use create() or register() directly instead.
Google leads me to this issue #146
I'm using Gradle 6, and I can't drop to Gradle 5 in my workplace. So like the issue says I use a different AspectJ plugin: https://plugins.gradle.org/plugin/aspectj.AspectjGradlePlugin.
It now builds. I run my tests...
Error: Task :compileAspect warning You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
That's this issue: projectlombok/lombok#2592. So I add the workaround to my build process options:
-Djps.track.ap.dependencies=false
I run the tests again.
`Unable to find method ''org.gradle.internal.deprecation.DeprecationMessageBuilder$DeprecateProperty$WithDeprecationTimeline org.gradle.internal.deprecation.DeprecationMessageBuilder$DeprecateProperty.willBeRemovedInGradle8()''
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes`
At this point I'm seriously considering my career choices. I restart my IDE and kill all Java processes. I reimport my dependencies. Same error. This time I click on:
Re-download dependencies and sync project (requires network)
Same error. I click on
Stop Gradle build processes (requires restart)
Same error.
I'm out of options. I've lost a whole day to this.
Please can you tell me how I can use SQS Large Message Handling using Gradle, and provide working instructions on your documentation. OR - is there an alternative way I can receive large SQS messages (that are offloaded to S3) in my lambda function?