Spring Cloud Zookeeper (#1399)

* Spring Cloud Zookeeper

* Spring Cloud Zookeeper Updated
This commit is contained in:
Tehreem
2017-04-07 12:47:33 +05:00
committed by adamd1985
parent 22dda8c2be
commit 69965db187
12 changed files with 329 additions and 0 deletions
@@ -0,0 +1,18 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.baeldung.spring.cloud.helloworld;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public class HelloWorldApplication {
public static void main(String[] args) {
SpringApplication.run(HelloWorldApplication.class, args);
}
}
@@ -0,0 +1,21 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.baeldung.spring.cloud.helloworld;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloWorldController {
@RequestMapping(path = "/helloworld", method = RequestMethod.GET)
public String HelloWorld() {
return "Hello World!";
}
}
@@ -0,0 +1,16 @@
spring:
application:
name: HelloWorld
cloud:
zookeeper:
connect-string: localhost:2181
discovery:
enabled: true
server:
port: 8081
endpoints:
restart:
enabled: true
logging:
level:
org.apache.zookeeper.ClientCnxn: WARN