简体   繁体   中英

How to deploy two .jar files on the same port?

I want to know how to deploy two different .jar files on the same port using Jenkins.

The two .jar files is build by Jenkins, i just want to know if there are any better options than re-doing the projects to build .war files and deploy them using a single Tomcat container?

edit: The reason i'm asking the questions is because i'm building a webapp using multiple microservices, therefor i'm interested in how to do this with "best practice".

It sounds like what you want is a common point of access that your clients can use to access your services. You can achieve this by creating an API gateway service that routes requests to the correct service. Your original two services listen on different ports, but your client only has to know about the API gateway endpoints, the API gateway itself will route the requests.

Have a look at Spring-cloud-zuul or this tutorial to see how to do this.

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