How to invoke a function running in the cloud with spring

Viewed 447

Does Spring offer some abstraction to invoke an arbitrary cloud function (for example and AWS lambda function) ?

It seems to me this could be the job of spring-cloud-function, but it looks (maybe I'm mistaken) as if this project concentrates more on abstracting the creation of functions that run on serverless environments, rather than on how to invoke those functions from other java code (for example a microservice).

I also checked out spring-cloud-aws but found no sign of lambda in the documentation.

Of course I could write the code to invoke functions quite easily as described here but being in the habit of Spring abstracting quite literally everything, I feel like I'm missing something when writing code that calls directly the aws java SDK.

Did I miss a documentation/sample somewhere ?

1 Answers

The answer is a resounding YES ;)

Have you checked SCF AWS support. You can also check out the 4 examples we have here - https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples

You can also check out our presentation from SpringOne this year - https://springone.io/2021/sessions/spring-cloud-function. Although it packs 3 different topics, I touch a little bit on AWS at my opening and then Mark (from AWS) follows me for the next 20 min. The sample code for our demo with instructions is here

Related