You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by la...@apache.org on 2021/11/12 08:34:46 UTC
[dubbo-go-samples] branch master updated: hotfix for java-server
start (#294)
This is an automated email from the ASF dual-hosted git repository.
laurence pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
The following commit(s) were added to refs/heads/master by this push:
new f1b5bdb hotfix for java-server start (#294)
f1b5bdb is described below
commit f1b5bdbcb5441abdafc8047913b46859f93ed89a
Author: Mulavar <97...@qq.com>
AuthorDate: Fri Nov 12 16:34:41 2021 +0800
hotfix for java-server start (#294)
Co-authored-by: dongjianhui03 <do...@meituan.com>
---
rpc/dubbo/java-server/pom.xml | 1 +
rpc/dubbo/java-server/run.sh | 2 +-
.../com/apache/dubbo/sample/basic/ApiConsumer.java | 57 ----------------------
.../com/apache/dubbo/sample/basic/IGreeter.java | 31 ------------
4 files changed, 2 insertions(+), 89 deletions(-)
diff --git a/rpc/dubbo/java-server/pom.xml b/rpc/dubbo/java-server/pom.xml
index edf1f77..74df1c8 100644
--- a/rpc/dubbo/java-server/pom.xml
+++ b/rpc/dubbo/java-server/pom.xml
@@ -13,6 +13,7 @@
<dubbo-version>2.7.7</dubbo-version>
<curator.version>2.12.0</curator.version>
<zk.version>3.4.14</zk.version>
+ <java.version>1.8</java.version>
</properties>
<dependencies>
diff --git a/rpc/dubbo/java-server/run.sh b/rpc/dubbo/java-server/run.sh
index d24d248..74ac02b 100644
--- a/rpc/dubbo/java-server/run.sh
+++ b/rpc/dubbo/java-server/run.sh
@@ -1 +1 @@
-mvn -e clean compile exec:java -Dexec.mainClass="org.apache.dubbo.Provider"
\ No newline at end of file
+mvn -e clean compile -U exec:java -Dexec.mainClass="org.apache.dubbo.Provider"
\ No newline at end of file
diff --git a/rpc/dubbo/java-server/src/main/java/com/apache/dubbo/sample/basic/ApiConsumer.java b/rpc/dubbo/java-server/src/main/java/com/apache/dubbo/sample/basic/ApiConsumer.java
deleted file mode 100644
index baf093f..0000000
--- a/rpc/dubbo/java-server/src/main/java/com/apache/dubbo/sample/basic/ApiConsumer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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 com.apache.dubbo.sample.basic;
-
-import org.apache.dubbo.common.constants.CommonConstants;
-import org.apache.dubbo.config.ApplicationConfig;
-import org.apache.dubbo.config.ReferenceConfig;
-import org.apache.dubbo.config.RegistryConfig;
-import org.apache.dubbo.sample.hello.Helloworld;
-import org.apache.dubbo.config.bootstrap.DubboBootstrap;
-
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-
-public class ApiConsumer {
- public static void main(String[] args) throws InterruptedException, IOException {
- ReferenceConfig<IGreeter> ref = new ReferenceConfig<>();
- ref.setInterface(IGreeter.class);
- ref.setCheck(false);
- ref.setProtocol(CommonConstants.TRIPLE);
- ref.setLazy(true);
- ref.setTimeout(100000);
-
- DubboBootstrap bootstrap = DubboBootstrap.getInstance();
- bootstrap.application(new ApplicationConfig("demo-consumer"))
- .registry(new RegistryConfig("zookeeper://127.0.0.1:2181"))
- .reference(ref)
- .start();
-
- final IGreeter iGreeter = ref.get();
- System.out.println("dubbo ref started");
- Helloworld.HelloRequest req = Helloworld.HelloRequest.newBuilder().setName("laurence").build();
- try {
- final Helloworld.User reply = iGreeter.sayHello(req);
- TimeUnit.SECONDS.sleep(1);
- System.out.println("Reply:" + reply);
- } catch (Throwable t) {
- t.printStackTrace();
- }
- System.in.read();
- }
-}
diff --git a/rpc/dubbo/java-server/src/main/java/com/apache/dubbo/sample/basic/IGreeter.java b/rpc/dubbo/java-server/src/main/java/com/apache/dubbo/sample/basic/IGreeter.java
deleted file mode 100644
index 8722f2c..0000000
--- a/rpc/dubbo/java-server/src/main/java/com/apache/dubbo/sample/basic/IGreeter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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 com.apache.dubbo.sample.basic;
-
-
-import org.apache.dubbo.sample.hello.Helloworld;
-
-public interface IGreeter {
- /**
- * <pre>
- * Sends a greeting
- * </pre>
- */
- Helloworld.User sayHello(Helloworld.HelloRequest request);
-
-}