Microservice Configuration in play 2 framework

早过忘川 提交于 2019-12-19 12:04:07

问题


I have divided my application into different projects in PLay 2. But I just realised I do not know how to run multiple play application in the same server.

Anyone knows how to do it?

Let us suppose it is not possible,Therefore, I will just deploy multiple play application in the same root project (The microservice will act as a plugin). Do you think this will defeat microservice architecture?. I will make each module act independently.


回答1:


By server, I'm guessing you mean Tomcat / Jetty / other containers / etc ? You can either deploy each service on its own container (tomcat), or rename the generated WAR file to a.war, b.war, c.war in which case you can access the different services at localhost:8080/a, localhost:8080/b, etc

If you're running JARs, you need to figure out how to run each service on its own port since you can only run one service per port, eg localhost:8081, localhost:8082

Have not used play myself



来源:https://stackoverflow.com/questions/44083919/microservice-configuration-in-play-2-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!