{"id":6907,"date":"2019-04-06T20:31:20","date_gmt":"2019-04-06T20:31:20","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=6907"},"modified":"2019-04-06T20:31:20","modified_gmt":"2019-04-06T20:31:20","slug":"spring-boot-eureka-server","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/spring-boot-eureka-server\/","title":{"rendered":"Spring boot Eureka server"},"content":{"rendered":"<p>Using Spring boot, we can very easily run up a <a href=\"https:\/\/github.com\/Netflix\/eureka\/wiki\/Eureka-at-a-glance\" rel=\"noopener noreferrer\" target=\"_blank\">Eureka<\/a> server.<\/p>\n<p>In IntelliJ create a new project using the Spring Initializr, simply select the Eureka Server dependency.<\/p>\n<p>Once the application is create, I found I needed to add the <strong>@EnableEurekaServer<\/strong> annotation to the application class, so here&#8217;s my EurekatesApplication.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage com.putridparrot.eurekatest;\r\n\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;\r\n\r\n@EnableEurekaServer\r\n@SpringBootApplication\r\npublic class EurekatestApplication {\r\n\r\n    public static void main(String&#x5B;] args) {\r\n        SpringApplication.run(EurekatestApplication.class, args);\r\n    }\r\n}\r\n<\/pre>\n<p>Next we need to add the following properties to the resources\/application.properties<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nserver.port=8761\r\n\r\neureka.client.register-with-eureka=false\r\neureka.client.fetch-registry=false\r\n\r\nlogging.level.com.netflix.eureka=OFF\r\nlogging.level.com.netflix.discovery=OFF\r\n<\/pre>\n<p>Now when you run the application and view the web page http:\/\/localhost:8761\/, you should see the Spring Eureka web page. Running http:\/\/localhost:8761\/eureka\/apps from your preferred browser will list any applications registered with the server.<\/p>\n<p>At this point we&#8217;ve not application registered with the server, so let&#8217;s add a .NET server in the next post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using Spring boot, we can very easily run up a Eureka server. In IntelliJ create a new project using the Spring Initializr, simply select the Eureka Server dependency. Once the application is create, I found I needed to add the @EnableEurekaServer annotation to the application class, so here&#8217;s my EurekatesApplication.java package com.putridparrot.eurekatest; import org.springframework.boot.SpringApplication; import [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[240,161],"tags":[],"class_list":["post-6907","post","type-post","status-publish","format-standard","hentry","category-eureka","category-java"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/6907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=6907"}],"version-history":[{"count":2,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/6907\/revisions"}],"predecessor-version":[{"id":6909,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/6907\/revisions\/6909"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=6907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=6907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=6907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}