I am trying to develop a microservice using spring MVC and spring boot with spring cloud. Here I am practicing my java microservices using JAR packaging. When I am using Maven build tool , also uses JAR file when building project. My ultimate aim is to deploy my microservice into AWS cloud.
Can anyone give clarification for the packaging format of my microservices in cloud,since I am a beginner to cloud platform.
Since you are using the spring boot, it supports UBER JAR format, which is the most recommended way for microservices these days since it has the embedded support for server tomcat / jetty / etc. Check 12-factor apps
Once you have the jar simply pushing it in the EC2 and running the java -jar
command would start running the server. And in spring boot application.properties
you can define the server listen port and the same can be allowed from security groups.
Further you can have Ec2 attached to the ELB.