Is it possible to run JHipster Microservices locally that are managed with JHipster Registry in the cloud? - heroku

When I run JHipster Registry in the cloud (ex: Heroku) and runs without problems and I can access correctly through the URL (ex: my-jhipster-registry.herokuapp.com). I could use this JHipster Registry to manage JHipster Microservices (gateways or applications) that are not in the cloud? If this is possible, how?
This doubt arises from the need to NOT have install JHipster Registry locally (on my laptop) during development and read the official guide running in the cloud.
Scenario expected during development:
JHipster Registry in cloud (Heroku)
JHipster Microservices in local (laptop)
I thank you for your time and help!

Yes it should work as long as your services can connect to your registry and they expose IP addresses that can be reached by other services (a service running in the cloud will not be able to connect to a service running on your laptop).
You may need a real certificate on registry that match your domain name for using https.

Related

How can I deploy a Spring Boot REST API to BanaHost cPanel?

I created a full stack application (Angular front end, java spring boot back end, mysql database), and I was able to upload successfully both the angular files and mysql into BanaHost cPanel, however I have not found useful information on how to upload spring boot REST API, as a consequence only the front end is working. How can I deploy this REST API on cpanel?
Spring Boot Applications can't just upload and deploy if you're utilizing a cPanel Web hosting (shared) plan, like you deployed the Angular Application by uploading.
For spring boot you must do it yourself, a Virtual Private Server or Dedicated Server will unlock the site hosting restriction. If you are not much familiar with the Linux command line, you can use a Window VPS instead. Providers like, Digital Ocean, Linode, and Oracle Cloud all provide free trials.
And also, there are platforms, such as Heroku (Platform as a Service(PaSS)), where you can deploy your app without the need for a VPS. You can refer their documentation regarding this:
https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku

Configuration or link required to connect cluster of Pivotal Coud Cache in Spring boot microservices

I am setting up the Spring-boot microservices with the cluster bi-direction Pivotal cloud cache.
I have set up the bi-directional cluster in Pivotal Cloud, I have a list of locators with ports.
I have already some online docs.
https://github.com/pivotal-cf/PCC-Sample-App-PizzaStore
But couldn't understand the on which configuration the spring boot app will know to connect.
I am looking for some tutorial or some reference where I can have spring boot app linked up with the PCC(gemfire)
The way you configure a app running in PCF (Pivotal Cloud Foundry) to talk to a PCC (Pivotal Cloud Cache) service instance is by binding the app to that service instance. You can bind it either by running the cf bind command or by adding the service name in the app`s manifest.yml, something like the below
path: build/libs/cloudcache-pizza-store-1.0.0-SNAPSHOT.jar
services:
- dev-service-instance
I hope you are using Spring Boot for Apache Geode & Pivotal GemFire (SBDG) in your app, if not I recommend you to use it as it makes connecting to PCC service instance extremely easy. SBDG has the logic to extract credentials, hostname:ports needed to connect to a service instance.
You as a app developer just need to
Create the service instance.
Bind your app to the service instance.
The boilerplate code for configuring credentials, hostnames, ips are handled by SBDG.
When you deploy an application in Cloud Foundry, (or Pivotal Cloud), you need to bind it to one or more services. Service details are then automatically exposed to the app via the VCAP_SERVICES environment variable. In the case of PCC this will include the name and port of the locator. By adding the spring-geode-starter (or spring-gemfire-starter) jar to the application it will automatically process the VCAP_SERVICES value and extract the necessary endpoint information in order to connect to the cluster.
Furthermore, if security is enabled on your PCC instance, you will also need to have created a service key. As with the locator details, the necessary credentials will be exposed via VCAP_SERVICES and the starter jar will automatically process and configure them.

jhipster gateway and microservice

I need to run my gateway and microservice in local without docker. Is this possible?
I created two projects: gateway and microservice. How can I run in local without docker?
If you want to do this, you'll need to download the JHipster Registry. Then run it with java -jar jhipster-registry-*.war. Then start your gateway and microservice apps as you normally would (with Maven/Gradle, or your IDE).

Keycloak Server on Heroku

Currently I'm working on a Spring Boot 2 project where we use Heroku as our Cloud Service. We push our changes to Github and our instance on Heroku cloud gets provisioned and deployed. After participating Javaday in my city, I attended to a speech and got to know about this amazing framework, Keycloak. After some investigation, we have decided using Keycloak as our identity and access management.
From what I understand, we need to start a Keycloak standalone server as explained here https://www.keycloak.org/docs/latest/server_installation/index.html.
But the problem is, we cannot access to filesystem on Heroku instance and thus, cannot extract the Keycloak files and start the server.
I tried to follow these steps https://github.com/yurtsevich/keycloak-swarm-heroku yurtsevich has provided but I noticed that latest version of Keycloak Swarm is not compatible with Spring Boot 2.
Can we start Keycloak server on the same Heroku instance we have? I'm unable to find any solution to this at this moment.
Edit: this button from readme will deploy Keycloak on Heroku with free dynos: https://github.com/sannonaragao/keycloak-heroku
This button deploys the lastest version straight to Heroku.
https://elements.heroku.com/buttons/mieckert/keycloak-heroku
Beware! It deploys at the Performance-M dyno, you must change to free right after if you don't want to pay some use fee.

Spring Config Server Service with Heroku

I am exploring Heroku. I have a project which has 10 micro services. One of which is a configuration server which takes care of managing configuration for all services using git hub.
I want to use Heroku for deploying these services but I am not sure how would my Spring Boot Configuration Server would work as Heroku provides a way to configure each hosted app separately(Can configure DB settings for individual app).
Any suggestions/ thoughts would be appreciated.
I found solution to my problem, sharing it for a reference.
Just need to use the addons on Heroku and use the addons config details in any of my config file which can be easily managed by the config server through git.
For an instance, if you are having a addon of Postgres, you would get configuration from Heroku for it(url, username, password etc). Use this information in the configuration file which is being managed by config server.

Resources