You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by li...@apache.org on 2019/12/17 03:21:44 UTC
[dubbo-samples] branch master updated: polish service discovery
samples
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git
The following commit(s) were added to refs/heads/master by this push:
new 85b305a polish service discovery samples
85b305a is described below
commit 85b305ad99041176b85a76b94d257c9564631c01
Author: ken.lj <ke...@gmail.com>
AuthorDate: Tue Dec 17 11:21:26 2019 +0800
polish service discovery samples
---
.../samples/microservices/sc/Application.java | 16 +++++++++++
.../configuration/RestTemplateConfiguration.java | 16 +++++++++++
.../microservices/sc/controller/MeController.java | 16 +++++++++++
.../sc/controller/PropertyController.java | 16 +++++++++++
.../sc/controller/TestController.java | 16 +++++++++++
.../samples/microservices/sc/controller/User.java | 26 ++++++++---------
.../samples/microservices/sc/feign/TestFeign.java | 16 +++++++++++
.../src/main/resources/application.yml | 16 +++++++++++
.../src/main/resources/bootstrap.yml | 33 +++++++++++++---------
.../samples/microservices/sc/Application.java | 16 +++++++++++
.../configuration/RestTemplateConfiguration.java | 16 +++++++++++
.../microservices/sc/controller/MeController.java | 16 +++++++++++
.../sc/controller/PropertyController.java | 24 +++++++++++++---
.../sc/controller/TestController.java | 18 +++++++++++-
.../samples/microservices/sc/controller/User.java | 26 ++++++++---------
.../samples/microservices/sc/feign/TestFeign.java | 18 +++++++++++-
.../src/main/resources/application.yml | 16 +++++++++++
.../src/main/resources/bootstrap.yml | 16 +++++++++++
.../apache/dubbo/demo/provider/Application.java | 7 ++---
19 files changed, 293 insertions(+), 51 deletions(-)
diff --git a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/Application.java b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/Application.java
index 7244b58..18e1806 100644
--- a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/Application.java
+++ b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/Application.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc;
import org.springframework.boot.SpringApplication;
diff --git a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/configuration/RestTemplateConfiguration.java b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/configuration/RestTemplateConfiguration.java
index 85cc275..a3b4f41 100644
--- a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/configuration/RestTemplateConfiguration.java
+++ b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/configuration/RestTemplateConfiguration.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.configuration;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
diff --git a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/MeController.java b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/MeController.java
index 2fcf3e0..60b8175 100644
--- a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/MeController.java
+++ b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/MeController.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.controller;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/PropertyController.java b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/PropertyController.java
index cb24179..a962086 100644
--- a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/PropertyController.java
+++ b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/PropertyController.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.controller;
import org.springframework.beans.factory.annotation.Value;
diff --git a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/TestController.java b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/TestController.java
index ade2917..79fa993 100644
--- a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/TestController.java
+++ b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/TestController.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.controller;
import org.apache.dubbo.samples.microservices.sc.feign.TestFeign;
diff --git a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/User.java b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/User.java
index dd163f1..52f2abb 100644
--- a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/User.java
+++ b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/User.java
@@ -1,20 +1,18 @@
/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.dubbo.samples.microservices.sc.controller;
diff --git a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/feign/TestFeign.java b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/feign/TestFeign.java
index 6451c89..1903b84 100644
--- a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/feign/TestFeign.java
+++ b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/feign/TestFeign.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.feign;
import org.springframework.cloud.netflix.feign.FeignClient;
diff --git a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/resources/application.yml b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/resources/application.yml
index 869e5ae..4bf4efd 100644
--- a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/resources/application.yml
+++ b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/resources/application.yml
@@ -1,3 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
management:
security:
enabled: false
diff --git a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/resources/bootstrap.yml b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/resources/bootstrap.yml
index 6b8592a..e5a3cf6 100644
--- a/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/resources/bootstrap.yml
+++ b/java/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/resources/bootstrap.yml
@@ -1,3 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
server:
port: 8099
@@ -13,8 +29,10 @@ spring:
instance-id: ${spring.application.name}:${random.value}
service-name: ${spring.application.name}
heartbeat:
- enabled: false
- health-check-interval: 1000s
+ enabled: true
+ health-check-interval: 10s
+ health-check-critical-timeout: 10s
+ register-health-check: true
config:
format: yaml
prefix: config
@@ -24,15 +42,4 @@ spring:
management:
security:
- enabled: false
-
- endpoint:
- consul:
- enabled: false
- health:
- consul:
- enabled: false
-
-endpoints:
- consul:
enabled: false
\ No newline at end of file
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/Application.java b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/Application.java
index 7244b58..18e1806 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/Application.java
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/Application.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc;
import org.springframework.boot.SpringApplication;
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/configuration/RestTemplateConfiguration.java b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/configuration/RestTemplateConfiguration.java
index 85cc275..a3b4f41 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/configuration/RestTemplateConfiguration.java
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/configuration/RestTemplateConfiguration.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.configuration;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/MeController.java b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/MeController.java
index 2fcf3e0..60b8175 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/MeController.java
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/MeController.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.controller;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/PropertyController.java b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/PropertyController.java
index cb24179..0e8baf7 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/PropertyController.java
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/PropertyController.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.controller;
import org.springframework.beans.factory.annotation.Value;
@@ -28,18 +44,18 @@ public class PropertyController {
@Value("${infrastructurePassword:default value}")
private String infrastructurePassword;
- @Value("${password:mypassword}")
- private String secret;
+ @Value("${password:mypassword}")
+ private String secret;
@RequestMapping
public String getProperty() {
return "<h3>applicationProperty:</h3> " + applicationProperty + "</br>"
- + "<h3>property:</h3> " + property + "</br>"
+ + "<h3>property:</h3> " + property + "</br>"
+ "<h3>property2:</h3> " + property2 + "</br>"
+ "<h3>infrastructureDesc:</h3> " + infrastructureDesc + "</br>"
+ "<h3>infrastructureUserName:</h3> " + infrastructureUserName + "</br>"
+ "<h3>infrastructurePassword:</h3> " + infrastructurePassword + "</br>"
- + "<h3>vault password:</h3>" + secret + "</br>";
+ + "<h3>vault password:</h3>" + secret + "</br>";
}
}
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/TestController.java b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/TestController.java
index ef5823b..f897b37 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/TestController.java
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/TestController.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.controller;
import org.apache.dubbo.samples.microservices.sc.feign.TestFeign;
@@ -26,7 +42,7 @@ public class TestController {
@RequestMapping("/rest/user")
public String doRestAliveUsingEurekaAndRibbon() {
String url = "http://dubbo-provider-for-sc/users/1";
- System.out.println("url: "+url);
+ System.out.println("url: " + url);
return restTemplate.getForObject(url, String.class);
}
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/User.java b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/User.java
index dd163f1..52f2abb 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/User.java
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/User.java
@@ -1,20 +1,18 @@
/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.apache.dubbo.samples.microservices.sc.controller;
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/feign/TestFeign.java b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/feign/TestFeign.java
index a222092..645b213 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/feign/TestFeign.java
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/java/org/apache/dubbo/samples/microservices/sc/feign/TestFeign.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.dubbo.samples.microservices.sc.feign;
import org.springframework.cloud.netflix.feign.FeignClient;
@@ -7,7 +23,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
@FeignClient(name = "dubbo-provider-for-sc")
public interface TestFeign {
- @RequestMapping(value="/users/1", method = RequestMethod.GET)
+ @RequestMapping(value = "/users/1", method = RequestMethod.GET)
String doAlive();
}
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/resources/application.yml b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/resources/application.yml
index 869e5ae..4bf4efd 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/resources/application.yml
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/resources/application.yml
@@ -1,3 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
management:
security:
enabled: false
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/resources/bootstrap.yml b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/resources/bootstrap.yml
index d6bad3c..95294d5 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/resources/bootstrap.yml
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-consumer/src/main/resources/bootstrap.yml
@@ -1,3 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
server:
port: 8099
diff --git a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-provider/src/main/java/org/apache/dubbo/demo/provider/Application.java b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-provider/src/main/java/org/apache/dubbo/demo/provider/Application.java
index 2735488..147efc0 100644
--- a/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-provider/src/main/java/org/apache/dubbo/demo/provider/Application.java
+++ b/java/dubbo-samples-cloud-native/sc-call-dubbo/sc-dubbo-provider/src/main/java/org/apache/dubbo/demo/provider/Application.java
@@ -28,7 +28,7 @@ import org.apache.dubbo.demo.provider.rest.UserServiceImpl;
public class Application {
public static void main(String[] args) throws Exception {
- ServiceConfig<UserService> service = new ServiceConfig<UserService>();
+ ServiceConfig<UserService> service = new ServiceConfig<>();
service.setInterface(UserService.class);
service.setRef(new UserServiceImpl());
@@ -40,8 +40,7 @@ public class Application {
.registry(new RegistryConfig("consul://127.0.0.1:8500?registry-type=service"))
.protocol(protocolConfig)
.service(service)
- .start();
-
- System.in.read();
+ .start()
+ .await();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org