0

My company has been using AWS Lambda for many years to run our Spring Boot REST API. We are migrating to GCP and they want me to deploy our code to GCF the same way we were with AWS Lambda, but I am not sure that GCF works that way.

According to Google Cloud Functions are only good for Single Endpoints and can only work as a web server using the functions framework. enter image description here

Spring has a document that uses the GcfJarLauncher, but that is still in alpha and I can only get it to work for a single endpoint. Any additional functions I put into the code are ignored and every endpoint triggers the same function.

There were some posts here on SO that talked about using Functional Beans to map to multiple functions, but I couldn't fully get it working and my boss isn't interested in that.

I've also read of people putting the endpoint in the request payload and then mapping to the proper function, but we are not interested in doing that either.

TLDR/Conclusion:

Is it even possible to deploy our app to GCF or do we need to use Cloud Run (as Google suggests in my first link)?

AylaWinters
  • 1,121
  • 2
  • 7
  • 24
  • Thanks, but I linked to that adapter in my post. The problem with it is that it is still only single endpoint. That adapter + functional beans can work as a hack, but not something my company is interested in. – AylaWinters Dec 15 '22 at 16:11
  • Does this answer your question? [How can I have multiple API endpoints for one Google Cloud Function?](https://stackoverflow.com/questions/47155378/how-can-i-have-multiple-api-endpoints-for-one-google-cloud-function) – Marc Anthony B Dec 16 '22 at 21:11
  • Thank you, but I referenced that one in my post as well. It is a hack that could work, but my company is not interested in that. – AylaWinters Dec 17 '22 at 03:30

0 Answers0