More than one gateway in jhipster

2019-06-07 18:57发布

问题:

Is it bad practice and what are possible consequences of having more than one gateway applications in the jhipster stack.

I am working on an application that has user part and admin part which are very different. The idea is to have 2 gateways, one for user web app and one for admin web app. Both of them would have their own microservice as backend. Plus there is third shared microservice that contains common functionality.

So it looks like this:

user web app (gateway)    admin web app (gateway)
      \                           /
       \                         /
  user microservice          admin microservice
         \                     /
          \                   /
           shared microservice 

I have tried it with simple examples and it seems to work in dev environment. Besides that it is not elegant, are there other reasons why this architecture is not right.

回答1:

I see no problem in having multiple gateways

It is explicitly stated in the JHipster documentation that you can have several gateways (see http://www.jhipster.tech/microservices-architecture/) to accommodate the need to control which services you expose to which client. Moreover you can configure the zuul proxy to restrict the allowed routes on each gateways.