Spring Cloud Zookeeper (#1399)
* Spring Cloud Zookeeper * Spring Cloud Zookeeper Updated
This commit is contained in:
+18
@@ -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);
|
||||
}
|
||||
}
|
||||
+21
@@ -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
|
||||
Reference in New Issue
Block a user