简体   繁体   中英

JHipster - How to debug in Eclipse only one gateway (or microservice) in a microservices architecture?

Assuming that with JHipster I've generated: - 1 Gateway (with MongoDB + JHipsterRegistry) - 3 Microservices [called A, B and C] (with MongoDB + JHipsterRegistry)

I'm using maven.

I've composed all in Docker, so the resulting Docker configuration is:

  • 1 JHipster Registry
  • 1 Gateway
  • 1 Gateway MongoDB
  • 1 Microservice A
  • 1 Microservice A MongoDB
  • 1 Microservice B
  • 1 Microservice B MongoDB
  • 1 Microservice C
  • 1 Microservice C MongoDB

All works fine: from the Gateway I can see entities from each Microservice.

Now I need to implement some features on Gateway (UI pages etc), and I need to debug with Eclipse during development.

How can I achieve this?

A) Do I need to run all manually, so running:

  • all components manually with ./mvnw
  • the JHipsterRegistry from a .jar
  • the Gateway from Eclipse running the debugger executing the main Application

B) Or can I use somehow docker for all "static" components and run only the Gateway from eclipse?

C) Any other suggestion?

If (A):

  • I need to start also all MongoDB manually?
  • How?
  • May the used ports collide?
  • Do I need to change configurations?

If (B):

  • How to run all "static" components in docker?
  • How to configure the Gateway to reach other components?

I did something similar as follows, duplicate your docker-compose directory
create docker-compose-dev

edit the new docker-compose.yml remove the gateway service

edit your hosts file create an entry as follows:
127.0.0.1 jhipster-registry

run this setup docker compose up -d
It should start without issues then you can run your gateway
from the command line terminals using mvnw and npm start

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM