Serverless Spring: Deploy serverless functions to any platform using Spring Cloud Function

  Рет қаралды 14,531

Dan Vega

Dan Vega

Жыл бұрын

In this tutorial, you will follow along with me as we create a serverless function in Spring Boot using Spring Cloud Function. This will allow you to use the same consistent programming model regardless of the platform you are deploying your serverless applications on. In this example, we will deploy our serverless function to AWS Lambda.
🔗Resources & Links mentioned in this video:
Serverless Spring Guide: tanzu.vmware.com/developer/gu...
👋🏻Connect with me:
Website: www.danvega.dev
Twitter: / therealdanvega
Github: github.com/danvega
LinkedIn: / danvega
Newsletter: www.danvega/dev/newsletter
SUBSCRIBE TO MY CHANNEL: bit.ly/2re4GH0 ❤️

Пікірлер: 47
@laerciopaula1989
@laerciopaula1989 Жыл бұрын
Really nice and easy to follow tutorial! Thank you for creating it!
@EklakDangaura
@EklakDangaura 10 ай бұрын
Short and quick with great information. Thank you .🎉
@tkoz-dev
@tkoz-dev Жыл бұрын
Thanks Dan, this was super informative and will be helpful on my next project.
@DanVega
@DanVega Жыл бұрын
Glad it was helpful!
@pradeepjoshi6611
@pradeepjoshi6611 Жыл бұрын
i was trying to run serverless application in AWS lambda but failing every time , but your tutorials work for me . thanks a lot
@shixulin4110
@shixulin4110 Жыл бұрын
thx for all your contents, really concise and helpful
@mtc539
@mtc539 Жыл бұрын
Hey Dan, I don't see the purpose of adding Spring Web as a dependency for a serverless function. My understanding is that functions are supposed to be short-lived programs, so deploying something to AWS Lambda which listens for HTTP requests seems counter-intuitive to me. Is Spring Web only needed for the internal Spring Cloud Function "magic" to happen?
@RossieHoorn
@RossieHoorn Жыл бұрын
This is really powerfull. I am going to play with serverless spring for sure.
Жыл бұрын
Great tuto. Thanks Dan!!
@light.yagami787
@light.yagami787 Жыл бұрын
Really helpful. Thank you so much
@sivaa12
@sivaa12 Жыл бұрын
Thank you Dan!
@DanVega
@DanVega Жыл бұрын
Thank you for watching!
@joseantoni034
@joseantoni034 Жыл бұрын
Very interesting, thanks Dan!
@DanVega
@DanVega Жыл бұрын
Thank you!
@DHA508
@DHA508 Жыл бұрын
Thanks Dan
@kappaj01
@kappaj01 Жыл бұрын
Interesting - as is and the startup time is 3.6 sec's. Much faster than my previous experience running SpringBoot as a Lambda. Really battle to get it to 23 secs. But, that was with a lot of JPA and other Spring related configuration. With Spring Native it is another story altogether - sub second startups! Will be very interesting to test this with SpringBoot 3.0 optimization.
@DanVega
@DanVega Жыл бұрын
Thank you for the feedback. I will work on getting an example together using Spring Boot 3 and compiling this down to a native image. Normal execution times haven't been a huge issues, it's usually just the cold start time which again we can now greatly improve.
@springbootprogramming
@springbootprogramming Жыл бұрын
Thanks!
@DanVega
@DanVega Жыл бұрын
You bet!
@tytech6047
@tytech6047 Жыл бұрын
Very nice 👍👍
@DheerajSingh
@DheerajSingh 6 ай бұрын
Could you please also create a video on how to call the multiple functions through the API gateway? Also, where are we set the spring.cloud.function.definition in the API gateway to dynamically route to the function.
@MichalGebauer
@MichalGebauer Жыл бұрын
Thanks Dan. I think AtomicInteger is bit misleading, considering the way how AWS scales out and kills lambda instances. Anyway, good video.
@thevagabond85yt
@thevagabond85yt 11 ай бұрын
Dan my Man
@MohamedElsayed-tc5yg
@MohamedElsayed-tc5yg 11 ай бұрын
Thank you
@DanVega
@DanVega 11 ай бұрын
You're welcome
@mshohag4229
@mshohag4229 Жыл бұрын
Thanks for creating such an awesome contant. Can you please make something serverless using jpa repository and using aws mysql.
@kismet333music
@kismet333music Жыл бұрын
This was a really awesome video, cannot stress that enough. I have used what I learned here and made my own spring cloud/lambda implementation. I am running into one problem though. My app deals with the client uploading a file and sending it to my spring backend. I was previously using MultipartFile in my spring boot app but now I am having trouble attempting this with the new spring cloud framework. Any chance you can do a video or a small example of how to do this? Thanks!
@DefinitionOfUnstoppable
@DefinitionOfUnstoppable 10 ай бұрын
Bro Can you share github Link?
@bwest-dev6241
@bwest-dev6241 Жыл бұрын
Hi Dan, In relation to the deployment what would we need to change if we want the lambda to be accessible by another service (AWS) or through an AWS API Gateway. Am right in assuming the approach shown here works because of the spring-cloud-web that is included in the jar?
@Andrey_landauuu
@Andrey_landauuu Жыл бұрын
Thanks for the tutorial. Unfortunately, after adding a db-functionality to this project (model-repository-service with spring-data-jpa + data in application.properties) in AWS Lambda I keep getting "Spring Boot Lambda Startup multiple times" error. No idea, what have i done wrong, because locally everything works just fine :(
@smoke86it
@smoke86it Жыл бұрын
Thanks Dan. This is very interesting, but it looks like that it just support GET and POST methods. Is there a way to use it in a RESTful way supporting other HTTP verbs like PUT, PATCH and DELETE ?
@togerait
@togerait 25 күн бұрын
Hi! I have the same question, could you answer me if you have it? Thanks a lot.
@desarrollojava
@desarrollojava Жыл бұрын
This is an exceptional announcment. Stil need the Dockerfile? or we'll say "look ma' no docker file!"?
@DanVega
@DanVega Жыл бұрын
You don't need a docker file to build a serverless function in Java. Currently you can just use the maven shade plugin to create an uber jar.
@jamesrooney931
@jamesrooney931 6 ай бұрын
09:31 Create Supplier Function 10:36 Create Consumer Function 11:34 Test function via HTTP 14:23 Deploying Spring Cloud functions 15:13 Add AWS dependency 17:09 Deploy Functions on AWS 18:33 Create function URL on AWS
@btk467
@btk467 10 ай бұрын
Nicely done. Thanks Dan. A little wrinkle, maybe be it is just me. I am getting "{"timestamp":"2023-10-03T03:26:30.174+00:00","status":405,"error":"Method Not Allowed","path":"/create"}" Anyone had this error? Any remedy? Thanks in advance.
@togerait
@togerait 25 күн бұрын
you need to use POST or GET method
@orhn
@orhn Жыл бұрын
What if we want to pass path param/query param or body?
@DanVega
@DanVega Жыл бұрын
I'm not sure if you can but also not sure why you would want to? If you're sending data as part of post request you should be sending it via request body.
@orhn
@orhn Жыл бұрын
@@DanVega Ah you mean parsing the body as json right? That make sense
@sagarbhat3884
@sagarbhat3884 Жыл бұрын
@@DanVega But what if we want to pass a query or path param for a GET transaction? How can we achieve that using Spring Cloud Functions.
@kismet333music
@kismet333music Жыл бұрын
@@sagarbhat3884 I ran into this problem too. I wasn't sure what to do but I just ended up changing my method to a POST and adding the path param as the body.
@guangweizhang2814
@guangweizhang2814 6 ай бұрын
Mark: In 2024-01-31, no more "spring_cloud_function_definition", please use "spring.cloud.function.definition"
@aaajojoaaa
@aaajojoaaa Жыл бұрын
I tried to do the same thing as when you did here , but I got this exception: Class not found: org.springframework.cloud.function.adapter.aws.FunctionInvoker: java.lang.ClassNotFoundException java.lang.ClassNotFoundException: org.springframework.cloud.function.adapter.aws.FunctionInvoker. Current classpath: file:/var/task/
@aaajojoaaa
@aaajojoaaa Жыл бұрын
I don't know how to fix it
@KyleTran-ek5nb
@KyleTran-ek5nb Жыл бұрын
Hi Dan, thanks for the video; it is very well done. I'm running into the issue with calling my lambda function, even though I have "spring.cloud.function.definition": "create" in my header. The logs show an NPE at org.springframework.cloud.function.adapter.aws.AWSLambdaUtils.generateMessage(AWSLambdaUtils.java:127)
@DheerajSingh
@DheerajSingh 6 ай бұрын
Did you find any solution to this? Now, I am facing a similar issue
Spring Cloud Function and AWS: Performance, Portability, and Productivity
1:04:57
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 17 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 39 МЛН
Finger Heart - Fancy Refill (Inside Out Animation)
00:30
FASH
Рет қаралды 29 МЛН
Stop, Intel’s Already Dead! - AMD Ryzen 9600X & 9700X Review
13:47
Linus Tech Tips
Рет қаралды 992 М.
Spring boot + PostgreSQL + Liquibase + Testcontainers
22:01
Sergey Labuzov
Рет қаралды 9 М.
From zero to hero on Cloud Functions Java 11
25:06
Google Cloud Tech
Рет қаралды 7 М.
Deploy a Spring Boot Application to AWS Lambda with an API Gateway
9:49
The Dev World - by Sergio Lema
Рет қаралды 2,2 М.
GO without SERVERS? How to Deploy Go to Lambda
15:47
Melkey
Рет қаралды 17 М.
Deploy a SpringBoot 3 API on AWS Lambda in 10 minutes
9:16
James Eastham
Рет қаралды 8 М.
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 7 МЛН
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 29 МЛН
Как противодействовать FPV дронам
44:34
Стратег Диванного Легиона
Рет қаралды 127 М.