Refer to the slides at: wmarques.github.io/meetup-jhipster-3.
Install docker and docker-compose if not installed (see docker docs).
Build the jar and docker images in each of the following directories:
- accounts-microservice
- accounts-microservice-v2
- hipster-bank-gateway
- insurances-microservice
using the command:
./mvnw package -Pprod -DskipTests docker:build
cd docker-config
yo jhipster:docker-compose
docker-compose up -d
docker-compose scale accountsmicroservice-app=2
Then run docker-compose logs accountsmicroservice
and see the second instance of the microservice starting, and their Hazelcast clustered caches getting in sync thanks to Eureka discovery.
Sample Hazelcast Logs:
accountsmicroservice-app_1 | Members [2] {
accountsmicroservice-app_1 | Member [172.22.0.8]:5701 this
accountsmicroservice-app_1 | Member [172.22.0.15]:5701
accountsmicroservice-app_1 | }
accountsmicroservice-app_1 |
accountsmicroservice-app_2 | 2016-04-12 08:33:46.592 INFO 1 --- [ration.thread-3] com.hazelcast.cluster.ClusterService : [172.22.0.15]:5701 [dev] [3.6.1]
accountsmicroservice-app_2 |
accountsmicroservice-app_2 | Members [2] {
accountsmicroservice-app_2 | Member [172.22.0.8]:5701
accountsmicroservice-app_2 | Member [172.22.0.15]:5701 this
accountsmicroservice-app_2 | }
Open http://localhost:5601 and have fun !
- Open http://localhost:8080/property/greeting.
- Tweak the value of
property.greeting
indocker-config/central-server-config/hipsterBangGateway.yml
- Trigger refreshing of the gateway's config:
curl -X POST http://localhost:8080/refresh
-
Regenerate the docker-compose file using
yo jhipster:docker-compose
to add the account-v2 service. -
Run
docker-compose up -d
to startaccount-v2
and its database and elasticsearch dependencies. -
In
hipsterBangGateway.yml
, edit the zuul config as follows and refresh the configuration using thecurl
command above.
zuul:
ignoredServices: '*'
routes:
accountsmicroservicev2:
path: /accountsmicroservice/**
serviceId: accountsmicroservicev2
- Open http://localhost:8080/#/gateway to see the gateway route changing from
account
toaccount-v2
. - On the BankAcount entity screen, the
account-v2
back-end service is now used but there is still no search bar to make use of elasticsearch. - Finally, change
feature-toggle.account
tov2
and refresh once again withcurl
to toggle the appearance of the search bar on the front-end .