
org.sonar.l10n.java.rules.java.S6246.html Maven / Gradle / Ivy
Why is this an issue?
Invoking other Lambdas synchronously from a Lambda is a scalability anti-pattern. Lambdas have a maximum execution time before they timeout (15
minutes as of May 2021). Having to wait for another Lambda to finish its execution could lead to a timeout.
A better solution is to generate events that can be consumed asynchronously by other Lambdas.
Noncompliant code example
With AWS SDKv1
InvokeRequest invokeRequest = new InvokeRequest()
.withFunctionName("myFunction");
AWSLambda awsLambda = AWSLambdaClientBuilder.standard()
.withCredentials(new ProfileCredentialsProvider())
.withRegion(Regions.US_WEST_2).build();
awsLambda.invoke(invokeRequest); // Noncompliant
Resources
© 2015 - 2025 Weber Informatics LLC | Privacy Policy