diff options
author | 2018-03-21 01:45:52 +0000 | |
---|---|---|
committer | 2018-03-21 01:45:52 +0000 | |
commit | 01b109873fa129319830a4619a01c503c139cd29 (patch) | |
tree | 7cf02867e88cdfc38499b64a887fd55c3c3724d8 /example/src/main/java/org/onap | |
parent | b0fd041c7ec97e762109c1a0700400bb2f3aef12 (diff) | |
parent | fd00a6849e072eb429e7ed7181588389f39bbdff (diff) |
Merge "Support healthy check for registered services"v1.1.0
Diffstat (limited to 'example/src/main/java/org/onap')
4 files changed, 33 insertions, 34 deletions
diff --git a/example/src/main/java/org/onap/msb/sdk/example/client/AnimalServiceClient.java b/example/src/main/java/org/onap/msb/sdk/example/client/AnimalServiceClient.java index cd9ebbb..aa6b9e3 100644 --- a/example/src/main/java/org/onap/msb/sdk/example/client/AnimalServiceClient.java +++ b/example/src/main/java/org/onap/msb/sdk/example/client/AnimalServiceClient.java @@ -23,6 +23,6 @@ import retrofit2.http.Path; @ServiceHttpEndPoint(serviceName = "animals", serviceVersion = "v1") public interface AnimalServiceClient { - @GET("animals/{name}") - Call<Animal> queryAnimal(@Path("name") String name); + @GET("animals/{name}") + Call<Animal> queryAnimal(@Path("name") String name); } diff --git a/example/src/main/java/org/onap/msb/sdk/example/client/ExampleClient.java b/example/src/main/java/org/onap/msb/sdk/example/client/ExampleClient.java index 4184b02..968621f 100644 --- a/example/src/main/java/org/onap/msb/sdk/example/client/ExampleClient.java +++ b/example/src/main/java/org/onap/msb/sdk/example/client/ExampleClient.java @@ -29,8 +29,8 @@ public class ExampleClient { public static void main(String[] args) throws IOException { // For real use case, MSB discovery IP and Port should come from configuration file instead // of hard code here - String msb_discovery_ip = "127.0.0.1"; - int msb_discovery_port = 10081; + String msb_discovery_ip = "10.96.33.44"; + int msb_discovery_port = 30080; MSBServiceClient msbClient = new MSBServiceClient(msb_discovery_ip, msb_discovery_port); diff --git a/example/src/main/java/org/onap/msb/sdk/example/server/ExampleApp.java b/example/src/main/java/org/onap/msb/sdk/example/server/ExampleApp.java index 7e74ed2..002a358 100644 --- a/example/src/main/java/org/onap/msb/sdk/example/server/ExampleApp.java +++ b/example/src/main/java/org/onap/msb/sdk/example/server/ExampleApp.java @@ -40,8 +40,8 @@ public class ExampleApp extends Application<Config> { public void run(Config configuration, Environment environment) throws Exception { // For real use case, MSB discovery IP and Port should come from configuration file instead // of hard code here - String msb_discovery_ip = "127.0.0.1"; - int msb_discovery_port = 10081; + String msb_discovery_ip = "10.96.33.44"; + int msb_discovery_port = 30081; environment.jersey().register(new AnimalResource()); diff --git a/example/src/main/java/org/onap/msb/sdk/example/server/MsbHelper.java b/example/src/main/java/org/onap/msb/sdk/example/server/MsbHelper.java index bd49a9b..c3cab67 100644 --- a/example/src/main/java/org/onap/msb/sdk/example/server/MsbHelper.java +++ b/example/src/main/java/org/onap/msb/sdk/example/server/MsbHelper.java @@ -24,32 +24,31 @@ import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; public class MsbHelper { - private MSBServiceClient msbClient; - - public MsbHelper(MSBServiceClient msbClient) { - super(); - this.msbClient = msbClient; - } - - - - public void registerMsb() throws Exception { - - - MicroServiceInfo msinfo = new MicroServiceInfo(); - - msinfo.setServiceName("animals"); - msinfo.setVersion("v1"); - msinfo.setUrl("/api/rpc/v1"); - msinfo.setProtocol("REST"); - msinfo.setVisualRange("0|1"); - - Set<Node> nodes = new HashSet<>(); - Node node1 = new Node(); - node1.setIp(InetAddress.getLocalHost().getHostAddress()); - node1.setPort("9090"); - nodes.add(node1); - msinfo.setNodes(nodes); - msbClient.registerMicroServiceInfo(msinfo, false); - } + private MSBServiceClient msbClient; + + public MsbHelper(MSBServiceClient msbClient) { + super(); + this.msbClient = msbClient; + } + + + + public void registerMsb() throws Exception { + MicroServiceInfo msinfo = new MicroServiceInfo(); + msinfo.setServiceName("animals"); + msinfo.setVersion("v1"); + msinfo.setUrl("/api/rpc/v1"); + msinfo.setProtocol("REST"); + msinfo.setVisualRange("0|1"); + + Set<Node> nodes = new HashSet<>(); + Node node1 = new Node(); + node1.setIp(InetAddress.getLocalHost().getHostAddress()); + node1.setPort("9090"); + node1.setCheckType("HTTP"); + node1.setCheckUrl("http://10.74.57.151:9090/api/rpc/v1/animals/panda"); + nodes.add(node1); + msinfo.setNodes(nodes); + msbClient.registerMicroServiceInfo(msinfo, false); + } } |