{"id":1927,"date":"2019-06-07T12:00:00","date_gmt":"2019-06-07T10:00:00","guid":{"rendered":"https:\/\/kindsonthegenius.com\/blog\/how-to-build-microservices-in-java-using-spring-eureka-source-codes\/"},"modified":"2026-07-05T03:23:41","modified_gmt":"2026-07-05T01:23:41","slug":"how-to-build-microservices-in-java-using-spring-eureka-source-codes","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/how-to-build-microservices-in-java-using-spring-eureka-source-codes\/","title":{"rendered":"How to Build Microservices in Java using Spring, Eureka (Source Codes)"},"content":{"rendered":"<p><a href=\"https:\/\/kindsonthegenius.com\/tempsite\/how-to-build-microservices-in-java-using-spring-eureka-step-by-step-procedure\/\">Find the Step by Step Procedure here<\/a><\/p>\n<h5>Final AdmissionsResource File<\/h5>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@RestController<\/span>\n<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/admissions\"<\/span><span style=\"color: #333333;\">)<\/span>\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">AdmissionsResource<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\n\t<span style=\"color: #555555; font-weight: bold;\">@Autowired<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">private<\/span> RestTemplate restTemplate<span style=\"color: #333333;\">;<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/A hardcoded list of patients<\/span>\n\tList<span style=\"color: #333333;\">&lt;<\/span>Patient<span style=\"color: #333333;\">&gt;<\/span> patients <span style=\"color: #333333;\">=<\/span> Arrays<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">asList<\/span><span style=\"color: #333333;\">(<\/span>\t\t\t\t\n\t\t<span style=\"color: #008800; font-weight: bold;\">new<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Patient<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"P1\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Joseph\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Nigerian\"<\/span><span style=\"color: #333333;\">),<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">new<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Patient<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"P2\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Gabor\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Hungarian\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t\t<span style=\"color: #333333;\">);<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/getPatients() returns a list of patients<\/span>\n\t<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/patients\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> List<span style=\"color: #333333;\">&lt;<\/span>Patient<span style=\"color: #333333;\">&gt;<\/span> <span style=\"color: #0066bb; font-weight: bold;\">getPatients<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> patients<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/getPatientById() returns a patient with a given Id<\/span>\n\t<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/patients\/{Id}\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> Patient <span style=\"color: #0066bb; font-weight: bold;\">getPatientById<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #555555; font-weight: bold;\">@PathVariable<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Id\"<\/span><span style=\"color: #333333;\">)<\/span> String Id<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\tPatient p <span style=\"color: #333333;\">=<\/span> patients<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">stream<\/span><span style=\"color: #333333;\">()<\/span>\n\t\t\t\t<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">filter<\/span><span style=\"color: #333333;\">(<\/span>patient <span style=\"color: #333333;\">-&gt;<\/span> Id<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">equals<\/span><span style=\"color: #333333;\">(<\/span>patient<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getId<\/span><span style=\"color: #333333;\">()))<\/span>\n\t\t\t\t<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">findAny<\/span><span style=\"color: #333333;\">()<\/span>\n\t\t\t\t<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">orElse<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #008800; font-weight: bold;\">null<\/span><span style=\"color: #333333;\">);<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> p<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/getPhysicians calls the hr-service microservice to get list of physicians<\/span>\n\t<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/physicians\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> EmployeesList <span style=\"color: #0066bb; font-weight: bold;\">getPhysicians<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\tEmployeesList physicians <span style=\"color: #333333;\">=<\/span> \n\t\t\t\trestTemplate<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getForObject<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"http:\/\/hr-service\/hr\/employees\"<\/span><span style=\"color: #333333;\">,<\/span> EmployeesList<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">class<\/span><span style=\"color: #333333;\">);<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> physicians<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/getDiseases calls the pathology-service to get list of diseases<\/span>\n\t<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/diseases\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> DiseasesList <span style=\"color: #0066bb; font-weight: bold;\">getDiseases<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\tDiseasesList diseases <span style=\"color: #333333;\">=<\/span> \n\t\t\t\trestTemplate<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getForObject<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"http:\/\/pathology-service\/pathology\/diseases\"<\/span><span style=\"color: #333333;\">,<\/span> DiseasesList<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">class<\/span><span style=\"color: #333333;\">);<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> diseases<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\t\n<span style=\"color: #333333;\">}<\/span>\n<\/pre>\n<p>&nbsp;<\/p>\n<h5>Final HrResource File<\/h5>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@RestController<\/span>\n<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/hr\"<\/span><span style=\"color: #333333;\">)<\/span>\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">HrResource<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/Hardcoded list of employees<\/span>\n\tList<span style=\"color: #333333;\">&lt;<\/span>Employee<span style=\"color: #333333;\">&gt;<\/span> employees <span style=\"color: #333333;\">=<\/span> Arrays<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">asList<\/span><span style=\"color: #333333;\">(<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">new<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Employee<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"E1\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Kindson\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Munonye\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"MedTech\"<\/span><span style=\"color: #333333;\">),<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">new<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Employee<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"E2\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Kate\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Winters\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Surgery\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #333333;\">);<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/getEmployees returns list of employees<\/span>\n\t<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/employees\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> EmployeesList <span style=\"color: #0066bb; font-weight: bold;\">getEmployees<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\t\n\t\tEmployeesList employeesList <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> EmployeesList<span style=\"color: #333333;\">();<\/span>\n\t\temployeesList<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">setEmployees<\/span><span style=\"color: #333333;\">(<\/span>employees<span style=\"color: #333333;\">);<\/span>\t\t\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> employeesList<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/getEmployeeById returns an employee with the given Id<\/span>\n\t<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/employees\/{Id}\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> Employee <span style=\"color: #0066bb; font-weight: bold;\">getEmployeeById<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #555555; font-weight: bold;\">@PathVariable<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Id\"<\/span><span style=\"color: #333333;\">)<\/span> String Id<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\tEmployee e <span style=\"color: #333333;\">=<\/span> employees<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">stream<\/span><span style=\"color: #333333;\">()<\/span>\n\t\t\t\t<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">filter<\/span><span style=\"color: #333333;\">(<\/span>employee <span style=\"color: #333333;\">-&gt;<\/span>Id<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">equals<\/span><span style=\"color: #333333;\">(<\/span>employee<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getId<\/span><span style=\"color: #333333;\">()))<\/span>\n\t\t\t\t<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">findAny<\/span><span style=\"color: #333333;\">()<\/span>\n\t\t\t\t<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">orElse<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #008800; font-weight: bold;\">null<\/span><span style=\"color: #333333;\">);<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> e<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\t\t\n<span style=\"color: #333333;\">}<\/span>\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h5>Final PathologyResource File<\/h5>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@RestController<\/span>\n<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/pathology\"<\/span><span style=\"color: #333333;\">)<\/span>\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">PathologyResource<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/Hardcoded list of diseases<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">private<\/span> List<span style=\"color: #333333;\">&lt;<\/span>Disease<span style=\"color: #333333;\">&gt;<\/span> diseases <span style=\"color: #333333;\">=<\/span> Arrays<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">asList<\/span><span style=\"color: #333333;\">(<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">new<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Disease<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"D1\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Ashma\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Warm water bath\"<\/span><span style=\"color: #333333;\">),<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">new<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Disease<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"D2\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Headache\"<\/span><span style=\"color: #333333;\">,<\/span> <span style=\"background-color: #fff0f0;\">\"Panadol capsule\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #333333;\">);<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/getDiseases returns a list of diseases<\/span>\n\t<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/diseases\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> DiseasesList <span style=\"color: #0066bb; font-weight: bold;\">getDiseases<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\tDiseasesList diseasesList <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> DiseasesList<span style=\"color: #333333;\">();<\/span>\n\t\tdiseasesList<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">setDiseases<\/span><span style=\"color: #333333;\">(<\/span>diseases<span style=\"color: #333333;\">);<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> diseasesList<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\n\t\n\t<span style=\"color: #888888;\">\/\/getDiseaseById returns the disease with the given Id<\/span>\n\t<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/diseases\/{Id}\"<\/span><span style=\"color: #333333;\">)<\/span>\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> Disease <span style=\"color: #0066bb; font-weight: bold;\">getDiseaseById<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #555555; font-weight: bold;\">@PathVariable<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Id\"<\/span><span style=\"color: #333333;\">)<\/span> String Id<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\t\n\t\tDisease d <span style=\"color: #333333;\">=<\/span> diseases<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">stream<\/span><span style=\"color: #333333;\">()<\/span>\n\t\t\t<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">filter<\/span><span style=\"color: #333333;\">(<\/span>disease <span style=\"color: #333333;\">-&gt;<\/span> Id<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">equals<\/span><span style=\"color: #333333;\">(<\/span>disease<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getId<\/span><span style=\"color: #333333;\">()))<\/span>\n\t\t\t<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">findAny<\/span><span style=\"color: #333333;\">()<\/span>\n\t\t\t<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">orElse<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #008800; font-weight: bold;\">null<\/span><span style=\"color: #333333;\">);<\/span>\t\n\t\t\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> d<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\t\n<span style=\"color: #333333;\">}<\/span>\n<\/pre>\n<p>&nbsp;<\/p>\n<h5>pom.xml for the admission-service<\/h5>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #557799;\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;<\/span>\n<span style=\"color: #007700;\">&lt;project<\/span> <span style=\"color: #0000cc;\">xmlns=<\/span><span style=\"background-color: #fff0f0;\">\"http:\/\/maven.apache.org\/POM\/4.0.0\"<\/span> <span style=\"color: #0000cc;\">xmlns:xsi=<\/span><span style=\"background-color: #fff0f0;\">\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"<\/span>\n\t<span style=\"color: #0000cc;\">xsi:schemaLocation=<\/span><span style=\"background-color: #fff0f0;\">\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"<\/span><span style=\"color: #007700;\">&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;modelVersion&gt;<\/span>4.0.0<span style=\"color: #007700;\">&lt;\/modelVersion&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;parent&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.springframework.boot<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>spring-boot-starter-parent<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;version&gt;<\/span>2.1.5.RELEASE<span style=\"color: #007700;\">&lt;\/version&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;relativePath\/&gt;<\/span> <span style=\"color: #888888;\">&lt;!-- lookup parent from repository --&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;\/parent&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;groupId&gt;<\/span>com.kindsonthegenius<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>admissions-service<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;version&gt;<\/span>0.0.1-SNAPSHOT<span style=\"color: #007700;\">&lt;\/version&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;name&gt;<\/span>admissions-service<span style=\"color: #007700;\">&lt;\/name&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;description&gt;<\/span>Admissions Service<span style=\"color: #007700;\">&lt;\/description&gt;<\/span>\n\n\t<span style=\"color: #007700;\">&lt;properties&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;java.version&gt;<\/span>1.8<span style=\"color: #007700;\">&lt;\/java.version&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;spring-cloud.version&gt;<\/span>Greenwich.SR1<span style=\"color: #007700;\">&lt;\/spring-cloud.version&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;\/properties&gt;<\/span>\n\n\t<span style=\"color: #007700;\">&lt;dependencies&gt;<\/span>\t\n\t\t<span style=\"color: #007700;\">&lt;dependency&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.springframework.cloud<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>spring-cloud-starter-netflix-eureka-client<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;\/dependency&gt;<\/span>\n\t\t\n\t\t<span style=\"color: #007700;\">&lt;dependency&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.springframework.boot<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>spring-boot-starter-web<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;\/dependency&gt;<\/span>\n\n\t\t<span style=\"color: #007700;\">&lt;dependency&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.springframework.boot<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>spring-boot-starter-test<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;scope&gt;<\/span>test<span style=\"color: #007700;\">&lt;\/scope&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;\/dependency&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;\/dependencies&gt;<\/span>\n\n\t<span style=\"color: #007700;\">&lt;dependencyManagement&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;dependencies&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;dependency&gt;<\/span>\n\t\t\t\t<span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.springframework.cloud<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\n\t\t\t\t<span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>spring-cloud-dependencies<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\n\t\t\t\t<span style=\"color: #007700;\">&lt;version&gt;<\/span>${spring-cloud.version}<span style=\"color: #007700;\">&lt;\/version&gt;<\/span>\n\t\t\t\t<span style=\"color: #007700;\">&lt;type&gt;<\/span>pom<span style=\"color: #007700;\">&lt;\/type&gt;<\/span>\n\t\t\t\t<span style=\"color: #007700;\">&lt;scope&gt;<\/span>import<span style=\"color: #007700;\">&lt;\/scope&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;\/dependency&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;\/dependencies&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;\/dependencyManagement&gt;<\/span>\n\n\t<span style=\"color: #007700;\">&lt;build&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;plugins&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;plugin&gt;<\/span>\n\t\t\t\t<span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.springframework.boot<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\n\t\t\t\t<span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>spring-boot-maven-plugin<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\n\t\t\t<span style=\"color: #007700;\">&lt;\/plugin&gt;<\/span>\n\t\t<span style=\"color: #007700;\">&lt;\/plugins&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;\/build&gt;<\/span>\n\t\n\t<span style=\"color: #007700;\">&lt;repositories&gt;<\/span>\n\t    <span style=\"color: #007700;\">&lt;repository&gt;<\/span> \n\t        <span style=\"color: #007700;\">&lt;id&gt;<\/span>spring-milestones<span style=\"color: #007700;\">&lt;\/id&gt;<\/span> \n\t        <span style=\"color: #007700;\">&lt;name&gt;<\/span>Spring Milestone<span style=\"color: #007700;\">&lt;\/name&gt;<\/span> \n\t        <span style=\"color: #007700;\">&lt;url&gt;<\/span>http:\/\/repo.spring.io\/milestone<span style=\"color: #007700;\">&lt;\/url&gt;<\/span> \n\t    <span style=\"color: #007700;\">&lt;\/repository&gt;<\/span>\n\t<span style=\"color: #007700;\">&lt;\/repositories&gt;<\/span>\n<span style=\"color: #007700;\">&lt;\/project&gt;<\/span>\n<\/pre>\n<p>&nbsp;<\/p>\n<h5>application.properties file of the Discovery Server<\/h5>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007020;\">server<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">port<\/span><span style=\"color: #333333;\">=<\/span><span style=\"color: #0000dd; font-weight: bold;\">8761<\/span>\neureka<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">client<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">register<\/span><span style=\"color: #333333;\">-<\/span>with<span style=\"color: #333333;\">-<\/span>eureka<span style=\"color: #333333;\">=<\/span><span style=\"color: #008800; font-weight: bold;\">false<\/span>\neureka<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">client<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">fetch<\/span><span style=\"color: #333333;\">-<\/span>registry<span style=\"color: #333333;\">=<\/span><span style=\"color: #008800; font-weight: bold;\">false<\/span>\n<\/pre>\n<p>&nbsp;<\/p>\n<h5>EmployeesList class<\/h5>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">EmployeesList<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\n\t<span style=\"color: #008800; font-weight: bold;\">private<\/span> List<span style=\"color: #333333;\">&lt;<\/span>Employee<span style=\"color: #333333;\">&gt;<\/span> employees<span style=\"color: #333333;\">;<\/span>\n\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> List<span style=\"color: #333333;\">&lt;<\/span>Employee<span style=\"color: #333333;\">&gt;<\/span> <span style=\"color: #0066bb; font-weight: bold;\">getEmployees<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> employees<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\n\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #333399; font-weight: bold;\">void<\/span> <span style=\"color: #0066bb; font-weight: bold;\">setEmployees<\/span><span style=\"color: #333333;\">(<\/span>List<span style=\"color: #333333;\">&lt;<\/span>Employee<span style=\"color: #333333;\">&gt;<\/span> employees<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\n\t\t<span style=\"color: #008800; font-weight: bold;\">this<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">employees<\/span> <span style=\"color: #333333;\">=<\/span> employees<span style=\"color: #333333;\">;<\/span>\n\t<span style=\"color: #333333;\">}<\/span>\t\t\n<span style=\"color: #333333;\">}<\/span>\n<\/pre>\n<p>&nbsp;<\/p>\n<h5><strong>More Tutorials on Microservices<\/strong><\/h5>\n<ul>\n<li>\n<h6><strong><a href=\"https:\/\/kindsonthegenius.com\/tempsite\/how-to-make-two-microservices-communicate\/\">How to Make two Microservices Communicate<\/a><\/strong><\/h6>\n<\/li>\n<li>\n<h6><strong><a href=\"https:\/\/kindsonthegenius.com\/tempsite\/how-to-build-microservices-in-java-using-spring-eureka-source-codes\/\">How to Build Microservices in Java using Spring, Eureka (Source Codes)<\/a><\/strong><\/h6>\n<\/li>\n<li>\n<h6><strong><a href=\"https:\/\/kindsonthegenius.com\/tempsite\/how-to-build-microservices-in-java-using-spring-eureka-step-by-step-procedure\/\">How to Build Microservices in Java using Spring, Eureka (step by step Procedure)<\/a><\/strong><\/h6>\n<\/li>\n<li>\n<h6><strong><a href=\"https:\/\/kindsonthegenius.com\/tempsite\/dockers-containers-and-kubernetes-a-simple-explanation\/\">Dockers, Containers and Kubernetes \u2013 A Simple Explanation<\/a><\/strong><\/h6>\n<\/li>\n<li>\n<h6><strong><a href=\"https:\/\/kindsonthegenius.com\/tempsite\/what-are-microservices-a-simple-explanation\/\">What are Microservices? \u2013 A Simple Explanation<\/a><\/strong><\/h6>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Find the Step by Step Procedure here Final AdmissionsResource File @RestController @RequestMapping(&#8220;\/admissions&#8221;) public class AdmissionsResource { @Autowired private RestTemplate restTemplate; \/\/A hardcoded list of patients &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[85],"tags":[],"class_list":["post-1927","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/1927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/comments?post=1927"}],"version-history":[{"count":1,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/1927\/revisions"}],"predecessor-version":[{"id":2095,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/1927\/revisions\/2095"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=1927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=1927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=1927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}