Is it advisable to use executor service in AWS Lambda? I see there is a limit for processes and threads in AWS docs
Number of processes and threads (combined total) 1,024
Does this determine the number of threads in my executor service?
Is shutting down the executor service as critical for AWS lambda as other processes?
Within the AWS lambda limits, you can do whatever you want in your lambda code, including starting starting multiple threads.
However, bear in mind the container your lambda is running is probably not optimized to support multiple threads so depending on how many threads you intend to run and what they do, you'd probably see better performance by running each thread in its own lambda.
Depending on how your lambda was invoked and what your threads do, you might also need to worry about the API gateway timeout (30 seconds) and the Lambda duration limit (5 minutes).
Here's an official example from AWS where they implement a Python lambda that spins up multiple processes inside the container: https://aws.amazon.com/blogs/compute/parallel-processing-in-python-with-aws-lambda/ (ok, those are processes, not threads and it's not Java, but it underscores the point AWS doesn't discourage running things in parallel in a lambda container).