We have a requirement where we would like to call the API of one java application from another application deployed in the same cloud foundry.
Could you please tell if there is any way to access the api.
Check out the Spring Cloud Netflix project:
http://cloud.spring.io/spring-cloud-netflix/
The service registration and discovery features of Eureka are exactly what you are looking for, and are built for use in a cloud environment.
This article contains code samples:
https://spring.io/blog/2015/01/20/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka
You can leverage Pivotal Spring Cloud Services in your Spring boot App. You might be using Pivotal SCS libraries.
In order to expose API to an another app, you've to enable service discovery and get registered in Eureka Server.
https://docs.pivotal.io/spring-cloud-services/1-3/common/service-registry/writing-client-applications.html#add-application-dependencies
Related
We have a cloud product written in ASP.NET Core. This product is using SignalR for frontend/backend communication. This cloud product is being hosted in AKS (Azure). Right now, we also need to host this product on GCP. Does GCP support SignalR for backend/frontend communication? Again, the product is written in ASP.NET Core.
Yes, it does.
You can deploy ASP.NET applications on Compute Engine, Cloud Run or App Engine.
You can find more information here and here.
In AWS, making a new API is as easy as going to the API Gateway service and clicking "Create API". How do I do the same in GCP? The Endpoints service does not appear to offer any way of creating an API.
At GCP there are several offers to deploy APIs, and as you have pointed Cloud Endpoints do not offer to ways to create aPI, but it provides frameworks to to base on and to integrate with the actual application hosting offers (App Engine, Compute Engine GKE, Cloud Run, Cloud Functions).
I would follow this tutorial in order to create the base for your API and later deploy and test your API. Notice that in those tutorial App Engine is used to deploy your API.
I'm building an app and the idea is to go serverless.
I'm looking mainly at AWS and GCP (Google Cloud Platform), and as AWS costs are a bit obscure (at least for me), and there is no way to ensure not being billed, I'm going with GCP.
For the "server" part of the app, I would like to build an API on GCP as I could do with AWS API Gateway, but I couldn't find any matching product for that.
The closer one was Google Cloud Endpoint, but it seems to have a very different concept from AWS API Gateway. I've watched some videos about it (for example https://www.youtube.com/watch?v=bR9hEyZ9774), but still can't get the idea behind it or if it fits my needs.
Could someone please help clarify which GCP product would be suitable for creating an API and how it compares to AWS API Gateway?
Some link with info/example on how to do it would be really appreciated.
Google Product Manager here.
We don't have an exact analog for AWS API Gateway.
You're right about Cloud Endpoints. It's a bit of a different architecture than AWS uses -- it's a sidecar proxy that gets deployed with the backend. That's different than API Gateway, which is a fully managed proxy deployed in front of your backends.
If you are deploying in App Engine Flexible environments: good news! The Endpoints Proxy can be deployed as part of your deployment. It can do things similar to AWS API Gateway (API key validation, JWT validation, rate limiting).
We are working on some plans to allow for the proxy to be used in other places (Cloud Functions and the newer App Engine Standard runtimes).
And, finally: on our older App Engine Java and Python runtimes, we have API Frameworks that provide the same functionality. Those frameworks do the same thing as the proxy, but get expressed as code annotations and built into your app. We're moving away from the framework model in favor of the proxy model.
An example of springboot project with google cloud app engine can be found here-https://github.com/ashishkeshu/googlecloud-springboot
How can I enable/disable APIs/Services in Google Cloud Project via Restful APIs or python?
For example, I want to enable following API/Service in a project.
https://console.developers.google.com/apis/api/iam.googleapis.com/overview?project=
You can programmatically enable or disable a GCP service using the Service Usage API. There are also methods for batch operations and querying service state. See the link below to the documentation.
https://cloud.google.com/service-usage/docs/reference/rest/v1/services
I want to register two sample Java web applications with Spring Registry so that both applications can communicate directly. I don't know much about programming.
Here I found the Spring Registry code, where Spring backend application is registering itself when it is deployed on Cloud Foundry, so that any Spring frontend application that is trying to reach the backend can communicate directly.
How can I register a simple Java dynamic web application to make direct communication between them without using the third-party services like RabbitMQ?
I think you are misunderstanding the use cases. The Netflix Eureka registry is for service registry that helps facilitate service to service communication.
Suppose a service - abc.foo.com and it needs to call another service pqr.foo.com. You don't want the path for the pqr service hardcoded in the abc service. Hardcoding like is an anti-pattern for cloud native applications. The approach is to have service abc and pqr register themselves with a service registry (eureka, consul, etc.). Then at runtime, the service, abc here, can interrogate registry and get an active instance of the pqr service and invoke it.
For your Java web applications, that need to call each other, I am assuming, all your interactions (service calls) are done on server-side. In which case, using Eureka registry, one microservice an easily find and get instance of another service and invoke it. You don't need RabbitMQ for that.
I would recommend looking at the jHipster project. It is an open source project. They have a Eureka based registry service, a gateway service, microservices and client-side UI (Node.js).
It will be a good starting point and there is a lot of open source help available.
I hope this helps!