You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by jo...@apache.org on 2021/06/11 10:02:38 UTC
[dubbo-go-samples] branch 3.0 updated: fix: 3.0 triple/grpc
provider generated reference function by proto-gen-dubbo (#128)
This is an automated email from the ASF dual-hosted git repository.
joezou pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 508450c fix: 3.0 triple/grpc provider generated reference function by proto-gen-dubbo (#128)
508450c is described below
commit 508450c4d61f0a8114e88083be2fe8fa7c8972b5
Author: Laurence <45...@users.noreply.github.com>
AuthorDate: Fri Jun 11 18:02:31 2021 +0800
fix: 3.0 triple/grpc provider generated reference function by proto-gen-dubbo (#128)
---
.run/general/general-grpc-unary-go-client.run.xml | 15 --
.run/general/general-grpc-unary-go-server.run.xml | 15 --
.../dubbogo-grpc/protobuf/dubbo3/helloworld.pb.go | 6 +-
.../server/dubbogo-server/conf/client.yml | 2 +-
.../server/dubbogo-server/pkg/greeter.go | 6 +-
.../dubbo3/pb/dubbogo-java/go-client/cmd/client.go | 8 +-
.../pb/dubbogo-java/go-client/conf/client.yml | 2 +-
.../dubbo3/pb/dubbogo-java/go-client/pkg/hello.go | 42 ---
.../pb/dubbogo-java/go-server/conf/client.yml | 2 +-
.../pb/dubbogo-java/go-server/conf/server.yml | 2 +-
.../pb/dubbogo-java/go-server/pkg/greeter.go | 4 -
.../pb/dubbogo-java/protobuf/helloworld.pb.go | 10 +-
general/grpc/go-client/cmd/client.go | 10 +-
general/grpc/go-client/conf/client.yml | 2 +-
general/grpc/go-client/pkg/hello.go | 36 ---
general/grpc/go-server/conf/client.yml | 2 +-
general/grpc/go-server/conf/server.yml | 2 +-
general/grpc/go-server/pkg/greeter.go | 3 -
.../grpc/go-server/tests/integration/main_test.go | 30 +--
general/grpc/protobuf/helloworld.pb.go | 16 +-
general/grpc/stream/go-client/app/client.go | 6 +
general/grpc/stream/go-client/app/hello.go | 50 ----
general/grpc/stream/go-client/app/helloworld.pb.go | 12 +-
.../grpc/stream/go-client/profiles/dev/client.yml | 2 +-
.../grpc/stream/go-client/profiles/test/client.yml | 2 +-
general/grpc/stream/go-server/app/greeter.go | 3 -
general/grpc/stream/go-server/app/helloworld.pb.go | 12 +-
.../grpc/stream/go-server/profiles/dev/server.yml | 2 +-
.../stream/go-server/profiles/release/server.yml | 2 +-
.../grpc/stream/go-server/profiles/test/server.yml | 2 +-
general/grpc/unary/go-client/app/Makefile | 2 -
general/grpc/unary/go-client/app/client.go | 62 -----
general/grpc/unary/go-client/app/hello.go | 42 ---
general/grpc/unary/go-client/app/helloworld.pb.go | 284 ---------------------
general/grpc/unary/go-client/app/helloworld.proto | 37 ---
general/grpc/unary/go-client/app/version.go | 22 --
general/grpc/unary/go-client/assembly/bin/load.sh | 203 ---------------
.../unary/go-client/assembly/common/app.properties | 23 --
.../grpc/unary/go-client/assembly/common/build.sh | 83 ------
general/grpc/unary/go-client/assembly/linux/dev.sh | 36 ---
.../grpc/unary/go-client/assembly/linux/release.sh | 35 ---
.../grpc/unary/go-client/assembly/linux/test.sh | 35 ---
general/grpc/unary/go-client/assembly/mac/dev.sh | 36 ---
.../grpc/unary/go-client/assembly/mac/release.sh | 34 ---
general/grpc/unary/go-client/assembly/mac/test.sh | 34 ---
.../grpc/unary/go-client/assembly/windows/dev.sh | 34 ---
.../unary/go-client/assembly/windows/release.sh | 34 ---
.../grpc/unary/go-client/assembly/windows/test.sh | 34 ---
.../grpc/unary/go-client/profiles/dev/client.yml | 61 -----
general/grpc/unary/go-client/profiles/dev/log.yml | 28 --
.../unary/go-client/profiles/release/client.yml | 61 -----
.../grpc/unary/go-client/profiles/release/log.yml | 28 --
.../grpc/unary/go-client/profiles/test/client.yml | 63 -----
general/grpc/unary/go-client/profiles/test/log.yml | 28 --
general/grpc/unary/go-server/app/greeter.go | 46 ----
general/grpc/unary/go-server/app/helloworld.pb.go | 283 --------------------
general/grpc/unary/go-server/app/helloworld.proto | 37 ---
general/grpc/unary/go-server/app/server.go | 79 ------
general/grpc/unary/go-server/app/version.go | 22 --
general/grpc/unary/go-server/assembly/bin/load.sh | 151 -----------
.../unary/go-server/assembly/common/app.properties | 23 --
.../grpc/unary/go-server/assembly/common/build.sh | 80 ------
general/grpc/unary/go-server/assembly/linux/dev.sh | 36 ---
.../grpc/unary/go-server/assembly/linux/release.sh | 36 ---
.../grpc/unary/go-server/assembly/linux/test.sh | 36 ---
general/grpc/unary/go-server/assembly/mac/dev.sh | 36 ---
.../grpc/unary/go-server/assembly/mac/release.sh | 36 ---
general/grpc/unary/go-server/assembly/mac/test.sh | 36 ---
.../grpc/unary/go-server/assembly/windows/dev.sh | 36 ---
.../unary/go-server/assembly/windows/release.sh | 36 ---
.../grpc/unary/go-server/assembly/windows/test.sh | 36 ---
general/grpc/unary/go-server/profiles/dev/log.yml | 28 --
.../grpc/unary/go-server/profiles/dev/server.yml | 57 -----
.../grpc/unary/go-server/profiles/release/log.yml | 28 --
.../unary/go-server/profiles/release/server.yml | 54 ----
general/grpc/unary/go-server/profiles/test/log.yml | 28 --
.../grpc/unary/go-server/profiles/test/server.yml | 57 -----
general/grpc/unary/java-client/build.sh | 21 --
general/grpc/unary/java-client/pom.xml | 247 ------------------
.../java-client/src/main/assembly/assembly.xml | 39 ---
.../src/main/assembly/conf/dubbo.properties | 13 -
.../src/main/assembly/conf/log4j.properties | 19 --
.../src/main/java/com/ikurento/user/Consumer.java | 111 --------
.../java-client/src/main/proto/UserService.proto | 56 ----
.../resources/META-INF/spring/dubbo.consumer.xml | 43 ----
.../src/main/resources/META-INF/spring/service.xml | 36 ---
general/grpc/unary/java-server/build.sh | 20 --
general/grpc/unary/java-server/pom.xml | 225 ----------------
general/grpc/unary/java-server/script/debug.sh | 22 --
.../java-server/src/main/assembly/assembly.xml | 45 ----
.../java-server/src/main/assembly/bin/start.bat | 44 ----
.../java-server/src/main/assembly/bin/start.sh | 125 ---------
.../src/main/assembly/conf/dubbo.properties | 14 -
.../src/main/assembly/conf/log4j.properties | 20 --
.../src/main/java/com/ikurento/user/Provider.java | 34 ---
.../java/com/ikurento/user/UserProviderImpl.java | 70 -----
.../java-server/src/main/proto/UserService.proto | 56 ----
.../resources/META-INF/spring/dubbo.provider.xml | 39 ---
.../src/main/resources/log4j.properties | 20 --
99 files changed, 76 insertions(+), 4187 deletions(-)
diff --git a/.run/general/general-grpc-unary-go-client.run.xml b/.run/general/general-grpc-unary-go-client.run.xml
deleted file mode 100644
index da40f0d..0000000
--- a/.run/general/general-grpc-unary-go-client.run.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="general-grpc-unary-go-client" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="general">
- <module name="dubbo-go-samples" />
- <working_directory value="$PROJECT_DIR$" />
- <envs>
- <env name="CONF_CONSUMER_FILE_PATH" value="$PROJECT_DIR$/general/grpc/unary/go-client/profiles/dev/client.yml" />
- <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/general/grpc/unary/go-client/profiles/dev/log.yml" />
- </envs>
- <kind value="PACKAGE" />
- <filePath value="$PROJECT_DIR$/general/grpc/unary/go-client/app/client.go" />
- <package value="github.com/apache/dubbo-go-samples/general/grpc/unary/go-client/app" />
- <directory value="$PROJECT_DIR$" />
- <method v="2" />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/.run/general/general-grpc-unary-go-server.run.xml b/.run/general/general-grpc-unary-go-server.run.xml
deleted file mode 100644
index b8fadc1..0000000
--- a/.run/general/general-grpc-unary-go-server.run.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="general-grpc-unary-go-server" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="general">
- <module name="dubbo-go-samples" />
- <working_directory value="$PROJECT_DIR$" />
- <envs>
- <env name="APP_LOG_CONF_FILE" value="$PROJECT_DIR$/general/grpc/unary/go-server/profiles/dev/log.yml" />
- <env name="CONF_PROVIDER_FILE_PATH" value="$PROJECT_DIR$/general/grpc/unary/go-server/profiles/dev/server.yml" />
- </envs>
- <kind value="PACKAGE" />
- <filePath value="$PROJECT_DIR$/general/grpc/unary/go-server/app/server.go" />
- <package value="github.com/apache/dubbo-go-samples/general/grpc/unary/go-server/app" />
- <directory value="$PROJECT_DIR$" />
- <method v="2" />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/general/dubbo3/pb/dubbogo-grpc/protobuf/dubbo3/helloworld.pb.go b/general/dubbo3/pb/dubbogo-grpc/protobuf/dubbo3/helloworld.pb.go
index bc2822f..9a98f67 100644
--- a/general/dubbo3/pb/dubbogo-grpc/protobuf/dubbo3/helloworld.pb.go
+++ b/general/dubbo3/pb/dubbogo-grpc/protobuf/dubbo3/helloworld.pb.go
@@ -114,7 +114,7 @@ func (m *User) GetName() string {
return ""
}
-func (m *User) GetID() string {
+func (m *User) GetId() string {
if m != nil {
return m.Id
}
@@ -357,6 +357,10 @@ func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
+func (c *GreeterProviderBase) Reference() string {
+ return "greeterImpl"
+}
+
func _DUBBO_Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HelloRequest)
if err := dec(in); err != nil {
diff --git a/general/dubbo3/pb/dubbogo-grpc/server/dubbogo-server/conf/client.yml b/general/dubbo3/pb/dubbogo-grpc/server/dubbogo-server/conf/client.yml
index 62ac541..eb65e8c 100644
--- a/general/dubbo3/pb/dubbogo-grpc/server/dubbogo-server/conf/client.yml
+++ b/general/dubbo3/pb/dubbogo-grpc/server/dubbogo-server/conf/client.yml
@@ -16,7 +16,7 @@ registries:
# reference config
references:
- "GreeterProvider":
+ "greeterImpl":
registry: "demoZk"
protocol: "tri"
interface: "protobuf.Greeter"
\ No newline at end of file
diff --git a/general/dubbo3/pb/dubbogo-grpc/server/dubbogo-server/pkg/greeter.go b/general/dubbo3/pb/dubbogo-grpc/server/dubbogo-server/pkg/greeter.go
index 4f6e05b..559b303 100644
--- a/general/dubbo3/pb/dubbogo-grpc/server/dubbogo-server/pkg/greeter.go
+++ b/general/dubbo3/pb/dubbogo-grpc/server/dubbogo-server/pkg/greeter.go
@@ -76,8 +76,4 @@ func (s *GreeterProvider) SayHello(ctx context.Context, in *dubbo3.HelloRequest)
fmt.Println("get triple header tri-req-id = ", ctx.Value(tripleConstant.TripleCtxKey(tripleConstant.TripleRequestID)))
fmt.Println("get triple header tri-service-version = ", ctx.Value(tripleConstant.TripleCtxKey(tripleConstant.TripleServiceVersion)))
return &dubbo3.User{Name: "Hello " + in.Name, Id: "12345", Age: 21}, nil
-}
-
-func (g *GreeterProvider) Reference() string {
- return "greeterImpl"
-}
+}
\ No newline at end of file
diff --git a/general/dubbo3/pb/dubbogo-java/go-client/cmd/client.go b/general/dubbo3/pb/dubbogo-java/go-client/cmd/client.go
index c9ce71e..63d1410 100644
--- a/general/dubbo3/pb/dubbogo-java/go-client/cmd/client.go
+++ b/general/dubbo3/pb/dubbogo-java/go-client/cmd/client.go
@@ -20,7 +20,6 @@ package main
import (
"context"
"fmt"
-
"time"
)
@@ -38,11 +37,10 @@ import (
)
import (
- "github.com/apache/dubbo-go-samples/general/dubbo3/pb/dubbogo-java/go-client/pkg"
pb "github.com/apache/dubbo-go-samples/general/dubbo3/pb/dubbogo-java/protobuf"
)
-var grpcGreeterImpl = new(pkg.GreeterProvider)
+var grpcGreeterImpl = new(pb.GreeterClientImpl)
func init() {
config.SetConsumerService(grpcGreeterImpl)
@@ -58,10 +56,12 @@ func main() {
Name: "laurence",
}
+ reply := &pb.User{}
+
ctx := context.Background()
ctx = context.WithValue(ctx, "tri-req-id", "test_value_XXXXXXXX")
- reply, err := grpcGreeterImpl.SayHello(ctx, req)
+ err := grpcGreeterImpl.SayHello(ctx, req, reply)
if err != nil {
panic(err)
}
diff --git a/general/dubbo3/pb/dubbogo-java/go-client/conf/client.yml b/general/dubbo3/pb/dubbogo-java/go-client/conf/client.yml
index cd98b32..f9e9eed 100644
--- a/general/dubbo3/pb/dubbogo-java/go-client/conf/client.yml
+++ b/general/dubbo3/pb/dubbogo-java/go-client/conf/client.yml
@@ -25,7 +25,7 @@ registries:
# reference config
references:
- "GreeterProvider":
+ "greeterImpl":
registry: "demoZk"
protocol: "tri"
interface: "com.apache.dubbo.sample.basic.IGreeter"
\ No newline at end of file
diff --git a/general/dubbo3/pb/dubbogo-java/go-client/pkg/hello.go b/general/dubbo3/pb/dubbogo-java/go-client/pkg/hello.go
deleted file mode 100644
index eade071..0000000
--- a/general/dubbo3/pb/dubbogo-java/go-client/pkg/hello.go
+++ /dev/null
@@ -1,42 +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 pkg
-
-import (
- "context"
-)
-
-import (
- "github.com/dubbogo/triple/pkg/triple"
-)
-
-import (
- dubbo3pb "github.com/apache/dubbo-go-samples/general/dubbo3/pb/dubbogo-java/protobuf"
-)
-
-type GreeterProvider struct {
- SayHello func(ctx context.Context, request *dubbo3pb.HelloRequest) (*dubbo3pb.User, error)
-}
-
-func (u *GreeterProvider) Reference() string {
- return "GreeterProvider"
-}
-
-func (u *GreeterProvider) GetDubboStub(cc *triple.TripleConn) dubbo3pb.GreeterClient {
- return dubbo3pb.NewGreeterDubbo3Client(cc)
-}
diff --git a/general/dubbo3/pb/dubbogo-java/go-server/conf/client.yml b/general/dubbo3/pb/dubbogo-java/go-server/conf/client.yml
index cd98b32..f9e9eed 100644
--- a/general/dubbo3/pb/dubbogo-java/go-server/conf/client.yml
+++ b/general/dubbo3/pb/dubbogo-java/go-server/conf/client.yml
@@ -25,7 +25,7 @@ registries:
# reference config
references:
- "GreeterProvider":
+ "greeterImpl":
registry: "demoZk"
protocol: "tri"
interface: "com.apache.dubbo.sample.basic.IGreeter"
\ No newline at end of file
diff --git a/general/dubbo3/pb/dubbogo-java/go-server/conf/server.yml b/general/dubbo3/pb/dubbogo-java/go-server/conf/server.yml
index 94e02c2..87fc9f1 100644
--- a/general/dubbo3/pb/dubbogo-java/go-server/conf/server.yml
+++ b/general/dubbo3/pb/dubbogo-java/go-server/conf/server.yml
@@ -17,7 +17,7 @@ registries:
# service config
services:
- "GreeterProvider":
+ "greeterImpl":
registry: "demoZK"
protocol: "tri"
interface: "com.apache.dubbo.sample.basic.IGreeter"
diff --git a/general/dubbo3/pb/dubbogo-java/go-server/pkg/greeter.go b/general/dubbo3/pb/dubbogo-java/go-server/pkg/greeter.go
index 189ff3f..ced01a0 100644
--- a/general/dubbo3/pb/dubbogo-java/go-server/pkg/greeter.go
+++ b/general/dubbo3/pb/dubbogo-java/go-server/pkg/greeter.go
@@ -43,7 +43,3 @@ func (s *GreeterProvider) SayHello(ctx context.Context, in *pb.HelloRequest) (*p
logger.Infof("Dubbo3 GreeterProvider get user name = %s\n", in.Name)
return &pb.User{Name: "Hello " + in.Name, Id: "12345", Age: 21}, nil
}
-
-func (g *GreeterProvider) Reference() string {
- return "GreeterProvider"
-}
diff --git a/general/dubbo3/pb/dubbogo-java/protobuf/helloworld.pb.go b/general/dubbo3/pb/dubbogo-java/protobuf/helloworld.pb.go
index 9bfba1d..e3aa4dc 100644
--- a/general/dubbo3/pb/dubbogo-java/protobuf/helloworld.pb.go
+++ b/general/dubbo3/pb/dubbogo-java/protobuf/helloworld.pb.go
@@ -15,7 +15,7 @@ import (
import (
"dubbo.apache.org/dubbo-go/v3/protocol"
- dgrpc "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
+ dgrpc "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
"dubbo.apache.org/dubbo-go/v3/protocol/invocation"
tripleConstant "github.com/dubbogo/triple/pkg/common/constant"
dubbo3 "github.com/dubbogo/triple/pkg/triple"
@@ -114,7 +114,7 @@ func (m *User) GetName() string {
return ""
}
-func (m *User) GetID() string {
+func (m *User) GetId() string {
if m != nil {
return m.Id
}
@@ -276,12 +276,16 @@ func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
+func (c *GreeterProviderBase) Reference() string {
+ return "greeterImpl"
+}
+
func _DUBBO_Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HelloRequest)
if err := dec(in); err != nil {
return nil, err
}
- base := srv.(dgrpc.DubboGrpcService)
+ base := srv.(dgrpc.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
invo := invocation.NewRPCInvocation("SayHello", args, nil)
diff --git a/general/grpc/go-client/cmd/client.go b/general/grpc/go-client/cmd/client.go
index cf89bbf..dacbf39 100644
--- a/general/grpc/go-client/cmd/client.go
+++ b/general/grpc/go-client/cmd/client.go
@@ -19,9 +19,6 @@ package main
import (
"context"
- "github.com/apache/dubbo-go-samples/general/grpc/go-client/pkg"
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
- "github.com/dubbogo/gost/log"
"time"
)
@@ -35,9 +32,14 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+ "github.com/dubbogo/gost/log"
+)
+
+import(
+ "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
)
-var grpcGreeterImpl = new(pkg.GrpcGreeterImpl)
+var grpcGreeterImpl = new(protobuf.GreeterClientImpl)
func init() {
config.SetConsumerService(grpcGreeterImpl)
diff --git a/general/grpc/go-client/conf/client.yml b/general/grpc/go-client/conf/client.yml
index e440222..9342221 100644
--- a/general/grpc/go-client/conf/client.yml
+++ b/general/grpc/go-client/conf/client.yml
@@ -25,7 +25,7 @@ registries:
# reference config
references:
- "GrpcGreeterImpl":
+ "greeterImpl":
registry: "demoZk"
protocol: "grpc"
interface: "org.apache.dubbo.GreeterGrpc$IGreeter"
diff --git a/general/grpc/go-client/pkg/hello.go b/general/grpc/go-client/pkg/hello.go
deleted file mode 100644
index d133e1f..0000000
--- a/general/grpc/go-client/pkg/hello.go
+++ /dev/null
@@ -1,36 +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 pkg
-
-import (
- "context"
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
- "google.golang.org/grpc"
-)
-
-type GrpcGreeterImpl struct {
- SayHello func(ctx context.Context, in *protobuf.HelloRequest, out *protobuf.HelloReply) error
-}
-
-func (u *GrpcGreeterImpl) Reference() string {
- return "GrpcGreeterImpl"
-}
-
-func (u *GrpcGreeterImpl) GetDubboStub(cc *grpc.ClientConn) protobuf.GreeterClient {
- return protobuf.NewGreeterClient(cc)
-}
diff --git a/general/grpc/go-server/conf/client.yml b/general/grpc/go-server/conf/client.yml
index 615cd74..53ac35c 100644
--- a/general/grpc/go-server/conf/client.yml
+++ b/general/grpc/go-server/conf/client.yml
@@ -25,7 +25,7 @@ registries:
# reference config
references:
- "GrpcGreeterImpl":
+ "greeterImpl":
registry: "demoZk"
protocol: "grpc"
interface: "org.apache.dubbo.GreeterGrpc$IGreeter"
diff --git a/general/grpc/go-server/conf/server.yml b/general/grpc/go-server/conf/server.yml
index 083bdd9..6cf6d5d 100644
--- a/general/grpc/go-server/conf/server.yml
+++ b/general/grpc/go-server/conf/server.yml
@@ -17,7 +17,7 @@ registries:
# service config
services:
- "GrpcGreeterImpl":
+ "greeterImpl":
registry: "zk"
protocol: "grpc"
interface: "org.apache.dubbo.GreeterGrpc$IGreeter"
diff --git a/general/grpc/go-server/pkg/greeter.go b/general/grpc/go-server/pkg/greeter.go
index 7f26eb0..2afb641 100644
--- a/general/grpc/go-server/pkg/greeter.go
+++ b/general/grpc/go-server/pkg/greeter.go
@@ -38,6 +38,3 @@ func (g *GreeterProvider) SayHello(ctx context.Context, req *protobuf.HelloReque
return &protobuf.HelloReply{Message: "this is message from reply"}, nil
}
-func (g *GreeterProvider) Reference() string {
- return "GrpcGreeterImpl"
-}
diff --git a/general/grpc/go-server/tests/integration/main_test.go b/general/grpc/go-server/tests/integration/main_test.go
index 7505577..d2be529 100644
--- a/general/grpc/go-server/tests/integration/main_test.go
+++ b/general/grpc/go-server/tests/integration/main_test.go
@@ -20,10 +20,12 @@
package integration
import (
- "context"
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
- "google.golang.org/grpc"
+ "os"
+ "testing"
+ "time"
+)
+import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
@@ -35,13 +37,11 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
)
-import (
- "os"
- "testing"
- "time"
+import(
+ "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
)
-var grpcGreeterImpl = new(GrpcGreeterImpl)
+var grpcGreeterImpl = new(protobuf.GreeterClientImpl)
func TestMain(m *testing.M) {
config.SetConsumerService(grpcGreeterImpl)
@@ -49,16 +49,4 @@ func TestMain(m *testing.M) {
time.Sleep(3 * time.Second)
os.Exit(m.Run())
-}
-
-type GrpcGreeterImpl struct {
- SayHello func(ctx context.Context, in *protobuf.HelloRequest, out *protobuf.HelloReply) error
-}
-
-func (u *GrpcGreeterImpl) Reference() string {
- return "GrpcGreeterImpl"
-}
-
-func (u *GrpcGreeterImpl) GetDubboStub(cc *grpc.ClientConn) protobuf.GreeterClient {
- return protobuf.NewGreeterClient(cc)
-}
+}
\ No newline at end of file
diff --git a/general/grpc/protobuf/helloworld.pb.go b/general/grpc/protobuf/helloworld.pb.go
index 78289dc..bdc3361 100644
--- a/general/grpc/protobuf/helloworld.pb.go
+++ b/general/grpc/protobuf/helloworld.pb.go
@@ -135,11 +135,11 @@ var fileDescriptor_17b8c58d586b62f2 = []byte{
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
-var _ grpc.ClientConn
+var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
+const _ = grpc.SupportPackageIsVersion6
// GreeterClient is the client API for Greeter service.
//
@@ -150,10 +150,10 @@ type GreeterClient interface {
}
type greeterClient struct {
- cc *grpc.ClientConn
+ cc grpc.ClientConnInterface
}
-func NewGreeterClient(cc *grpc.ClientConn) GreeterClient {
+func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient {
return &greeterClient{cc}
}
@@ -243,6 +243,10 @@ func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
+func (c *GreeterProviderBase) Reference() string {
+ return "greeterImpl"
+}
+
func _DUBBO_Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HelloRequest)
if err := dec(in); err != nil {
@@ -253,7 +257,7 @@ func _DUBBO_Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec f
args = append(args, in)
invo := invocation.NewRPCInvocation("SayHello", args, nil)
if interceptor == nil {
- result := base.GetProxyImpl().Invoke(context.Background(), invo)
+ result := base.GetProxyImpl().Invoke(ctx, invo)
return result.Result(), result.Error()
}
info := &grpc.UnaryServerInfo{
@@ -261,7 +265,7 @@ func _DUBBO_Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec f
FullMethod: "/protobuf.Greeter/SayHello",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- result := base.GetProxyImpl().Invoke(context.Background(), invo)
+ result := base.GetProxyImpl().Invoke(ctx, invo)
return result.Result(), result.Error()
}
return interceptor(ctx, in, info, handler)
diff --git a/general/grpc/stream/go-client/app/client.go b/general/grpc/stream/go-client/app/client.go
index c710aa6..8571f87 100644
--- a/general/grpc/stream/go-client/app/client.go
+++ b/general/grpc/stream/go-client/app/client.go
@@ -44,6 +44,12 @@ var (
survivalTimeout int = 10e9
)
+var grpcGreeterImpl = new(GreeterClientImpl)
+
+func init() {
+ config.SetConsumerService(grpcGreeterImpl)
+}
+
// they are necessary:
// export CONF_CONSUMER_FILE_PATH="xxx"
// export APP_LOG_CONF_FILE="xxx"
diff --git a/general/grpc/stream/go-client/app/hello.go b/general/grpc/stream/go-client/app/hello.go
deleted file mode 100644
index 3cb0f8a..0000000
--- a/general/grpc/stream/go-client/app/hello.go
+++ /dev/null
@@ -1,50 +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 main
-
-import (
- "context"
-)
-
-import (
- "google.golang.org/grpc"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/config"
-)
-
-var grpcGreeterImpl = new(GrpcGreeterImpl)
-
-func init() {
- config.SetConsumerService(grpcGreeterImpl)
-}
-
-type GrpcGreeterImpl struct {
- SayHelloTwoSidesStream func(ctx context.Context) (Greeter_SayHelloTwoSidesStreamClient, error)
- SayHelloClientStream func(ctx context.Context) (Greeter_SayHelloClientStreamClient, error)
- SayHelloServerStream func(ctx context.Context, request *HelloRequest) (Greeter_SayHelloServerStreamClient, error)
-}
-
-func (u *GrpcGreeterImpl) Reference() string {
- return "GrpcGreeterImpl"
-}
-
-func (u *GrpcGreeterImpl) GetDubboStub(cc *grpc.ClientConn) GreeterClient {
- return NewGreeterClient(cc)
-}
diff --git a/general/grpc/stream/go-client/app/helloworld.pb.go b/general/grpc/stream/go-client/app/helloworld.pb.go
index 42fe40c..4666716 100644
--- a/general/grpc/stream/go-client/app/helloworld.pb.go
+++ b/general/grpc/stream/go-client/app/helloworld.pb.go
@@ -138,11 +138,11 @@ var fileDescriptor_17b8c58d586b62f2 = []byte{
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
-var _ grpc.ClientConn
+var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
+const _ = grpc.SupportPackageIsVersion6
// GreeterClient is the client API for Greeter service.
//
@@ -155,10 +155,10 @@ type GreeterClient interface {
}
type greeterClient struct {
- cc *grpc.ClientConn
+ cc grpc.ClientConnInterface
}
-func NewGreeterClient(cc *grpc.ClientConn) GreeterClient {
+func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient {
return &greeterClient{cc}
}
@@ -413,6 +413,10 @@ func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
+func (c *GreeterProviderBase) Reference() string {
+ return "greeterImpl"
+}
+
func _DUBBO_Greeter_SayHelloTwoSidesStream_Handler(srv interface{}, stream grpc.ServerStream) error {
_, ok := srv.(dgrpc.DubboGrpcService)
invo := invocation.NewRPCInvocation("SayHelloTwoSidesStream", nil, nil)
diff --git a/general/grpc/stream/go-client/profiles/dev/client.yml b/general/grpc/stream/go-client/profiles/dev/client.yml
index b2bc054..ae2a7cd 100644
--- a/general/grpc/stream/go-client/profiles/dev/client.yml
+++ b/general/grpc/stream/go-client/profiles/dev/client.yml
@@ -26,7 +26,7 @@ registries :
references:
- "GrpcGreeterImpl":
+ "greeterImpl":
# 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
registry: "zk"
protocol : "grpc"
diff --git a/general/grpc/stream/go-client/profiles/test/client.yml b/general/grpc/stream/go-client/profiles/test/client.yml
index e0c0737..48d158b 100644
--- a/general/grpc/stream/go-client/profiles/test/client.yml
+++ b/general/grpc/stream/go-client/profiles/test/client.yml
@@ -29,7 +29,7 @@ registries :
password: ""
references:
- "GrpcGreeterImpl":
+ "greeterImpl":
# 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
registry: "demoZk"
protocol : "grpc"
diff --git a/general/grpc/stream/go-server/app/greeter.go b/general/grpc/stream/go-server/app/greeter.go
index 1512d07..896c704 100644
--- a/general/grpc/stream/go-server/app/greeter.go
+++ b/general/grpc/stream/go-server/app/greeter.go
@@ -98,6 +98,3 @@ func (g *GreeterProvider) SayHelloServerStream(req *HelloRequest, server Greeter
return nil
}
-func (g *GreeterProvider) Reference() string {
- return "GrpcGreeterImpl"
-}
diff --git a/general/grpc/stream/go-server/app/helloworld.pb.go b/general/grpc/stream/go-server/app/helloworld.pb.go
index 42fe40c..4666716 100644
--- a/general/grpc/stream/go-server/app/helloworld.pb.go
+++ b/general/grpc/stream/go-server/app/helloworld.pb.go
@@ -138,11 +138,11 @@ var fileDescriptor_17b8c58d586b62f2 = []byte{
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
-var _ grpc.ClientConn
+var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
+const _ = grpc.SupportPackageIsVersion6
// GreeterClient is the client API for Greeter service.
//
@@ -155,10 +155,10 @@ type GreeterClient interface {
}
type greeterClient struct {
- cc *grpc.ClientConn
+ cc grpc.ClientConnInterface
}
-func NewGreeterClient(cc *grpc.ClientConn) GreeterClient {
+func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient {
return &greeterClient{cc}
}
@@ -413,6 +413,10 @@ func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
+func (c *GreeterProviderBase) Reference() string {
+ return "greeterImpl"
+}
+
func _DUBBO_Greeter_SayHelloTwoSidesStream_Handler(srv interface{}, stream grpc.ServerStream) error {
_, ok := srv.(dgrpc.DubboGrpcService)
invo := invocation.NewRPCInvocation("SayHelloTwoSidesStream", nil, nil)
diff --git a/general/grpc/stream/go-server/profiles/dev/server.yml b/general/grpc/stream/go-server/profiles/dev/server.yml
index 2e61183..df37534 100644
--- a/general/grpc/stream/go-server/profiles/dev/server.yml
+++ b/general/grpc/stream/go-server/profiles/dev/server.yml
@@ -17,7 +17,7 @@ registries :
address: "127.0.0.1:2181"
services:
- "GrpcGreeterImpl":
+ "greeterImpl":
# 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
registry: "zk"
protocol : "grpc"
diff --git a/general/grpc/stream/go-server/profiles/release/server.yml b/general/grpc/stream/go-server/profiles/release/server.yml
index 214aa14..8c9b2db 100644
--- a/general/grpc/stream/go-server/profiles/release/server.yml
+++ b/general/grpc/stream/go-server/profiles/release/server.yml
@@ -14,7 +14,7 @@ registries :
address: "127.0.0.1:2181"
services:
- "GrpcGreeterImpl":
+ "greeterImpl":
# 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
registry: "demoZk"
protocol : "grpc"
diff --git a/general/grpc/stream/go-server/profiles/test/server.yml b/general/grpc/stream/go-server/profiles/test/server.yml
index 14e9ecb..40a4892 100644
--- a/general/grpc/stream/go-server/profiles/test/server.yml
+++ b/general/grpc/stream/go-server/profiles/test/server.yml
@@ -17,7 +17,7 @@ registries:
# service config
services:
- "GrpcGreeterImpl":
+ "greeterImpl":
registry: "demoZk"
protocol: "grpc"
interface: "org.apache.dubbo.GreeterGrpc$IGreeter"
diff --git a/general/grpc/unary/go-client/app/Makefile b/general/grpc/unary/go-client/app/Makefile
deleted file mode 100644
index be60da1..0000000
--- a/general/grpc/unary/go-client/app/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-gen:
- protoc -I ./ helloworld.proto --go_out=plugins=grpc:.
diff --git a/general/grpc/unary/go-client/app/client.go b/general/grpc/unary/go-client/app/client.go
deleted file mode 100644
index 2c632ad..0000000
--- a/general/grpc/unary/go-client/app/client.go
+++ /dev/null
@@ -1,62 +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 main
-
-import (
- "context"
- "time"
-)
-
-import (
- _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
- _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
- gxlog "github.com/dubbogo/gost/log"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
-)
-
-var grpcGreeterImpl = new(GrpcGreeterImpl)
-
-func init() {
- config.SetConsumerService(grpcGreeterImpl)
-}
-
-// need to setup environment variable "CONF_CONSUMER_FILE_PATH" to "conf/client.yml" before run
-func main() {
- config.Load()
- time.Sleep(3 * time.Second)
-
- gxlog.CInfo("\n\n\nstart to test dubbo")
- reply := &protobuf.HelloReply{}
- req := &protobuf.HelloRequest{
- Name: "xujianhai",
- }
- err := grpcGreeterImpl.SayHello(context.TODO(), req, reply)
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("client response result: %v\n", reply)
-}
diff --git a/general/grpc/unary/go-client/app/hello.go b/general/grpc/unary/go-client/app/hello.go
deleted file mode 100644
index 69778bc..0000000
--- a/general/grpc/unary/go-client/app/hello.go
+++ /dev/null
@@ -1,42 +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 main
-
-import (
- "context"
-)
-
-import (
- "google.golang.org/grpc"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
-)
-
-type GrpcGreeterImpl struct {
- SayHello func(ctx context.Context, in *protobuf.HelloRequest, out *protobuf.HelloReply) error
-}
-
-func (u *GrpcGreeterImpl) Reference() string {
- return "GrpcGreeterImpl"
-}
-
-func (u *GrpcGreeterImpl) GetDubboStub(cc *grpc.ClientConn) protobuf.GreeterClient {
- return protobuf.NewGreeterClient(cc)
-}
diff --git a/general/grpc/unary/go-client/app/helloworld.pb.go b/general/grpc/unary/go-client/app/helloworld.pb.go
deleted file mode 100644
index 620ec35..0000000
--- a/general/grpc/unary/go-client/app/helloworld.pb.go
+++ /dev/null
@@ -1,284 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: helloworld.proto
-
-package main
-
-import (
- "context"
- "fmt"
- "math"
-
- "github.com/golang/protobuf/proto"
- "google.golang.org/grpc"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/protocol"
- dgrpc "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
-// The request message containing the user's name.
-type HelloRequest struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HelloRequest) Reset() { *m = HelloRequest{} }
-func (m *HelloRequest) String() string { return proto.CompactTextString(m) }
-func (*HelloRequest) ProtoMessage() {}
-func (*HelloRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_17b8c58d586b62f2, []int{0}
-}
-
-func (m *HelloRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_HelloRequest.Unmarshal(m, b)
-}
-func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic)
-}
-func (m *HelloRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HelloRequest.Merge(m, src)
-}
-func (m *HelloRequest) XXX_Size() int {
- return xxx_messageInfo_HelloRequest.Size(m)
-}
-func (m *HelloRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_HelloRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HelloRequest proto.InternalMessageInfo
-
-func (m *HelloRequest) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-// The response message containing the greetings
-type HelloReply struct {
- Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HelloReply) Reset() { *m = HelloReply{} }
-func (m *HelloReply) String() string { return proto.CompactTextString(m) }
-func (*HelloReply) ProtoMessage() {}
-func (*HelloReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_17b8c58d586b62f2, []int{1}
-}
-
-func (m *HelloReply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_HelloReply.Unmarshal(m, b)
-}
-func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic)
-}
-func (m *HelloReply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HelloReply.Merge(m, src)
-}
-func (m *HelloReply) XXX_Size() int {
- return xxx_messageInfo_HelloReply.Size(m)
-}
-func (m *HelloReply) XXX_DiscardUnknown() {
- xxx_messageInfo_HelloReply.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HelloReply proto.InternalMessageInfo
-
-func (m *HelloReply) GetMessage() string {
- if m != nil {
- return m.Message
- }
- return ""
-}
-
-func init() {
- proto.RegisterType((*HelloRequest)(nil), "main.HelloRequest")
- proto.RegisterType((*HelloReply)(nil), "main.HelloReply")
-}
-
-func init() { proto.RegisterFile("helloworld.proto", fileDescriptor_17b8c58d586b62f2) }
-
-var fileDescriptor_17b8c58d586b62f2 = []byte{
- // 185 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0x48, 0xcd, 0xc9,
- 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xc9, 0x4d,
- 0xcc, 0xcc, 0x53, 0x52, 0xe2, 0xe2, 0xf1, 0x00, 0xc9, 0x04, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97,
- 0x08, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81,
- 0xd9, 0x4a, 0x6a, 0x5c, 0x5c, 0x50, 0x35, 0x05, 0x39, 0x95, 0x42, 0x12, 0x5c, 0xec, 0xb9, 0xa9,
- 0xc5, 0xc5, 0x89, 0xe9, 0x30, 0x45, 0x30, 0xae, 0x91, 0x2d, 0x17, 0xbb, 0x7b, 0x51, 0x6a, 0x6a,
- 0x49, 0x6a, 0x91, 0x90, 0x11, 0x17, 0x47, 0x70, 0x62, 0x25, 0x58, 0x97, 0x90, 0x90, 0x1e, 0xc8,
- 0x26, 0x3d, 0x64, 0x6b, 0xa4, 0x04, 0x50, 0xc4, 0x0a, 0x72, 0x2a, 0x95, 0x18, 0x9c, 0xcc, 0xb8,
- 0xa4, 0x33, 0xf3, 0xf5, 0xd2, 0x8b, 0x0a, 0x92, 0xf5, 0x52, 0x2b, 0x12, 0x73, 0x0b, 0x72, 0x52,
- 0x8b, 0xf5, 0x10, 0xae, 0x76, 0xe2, 0x07, 0x2b, 0x0e, 0x07, 0xb1, 0x03, 0x40, 0x1e, 0x08, 0x60,
- 0x5c, 0xc4, 0xc4, 0xec, 0xe1, 0x13, 0x9e, 0xc4, 0x06, 0xf6, 0x8f, 0x31, 0x20, 0x00, 0x00, 0xff,
- 0xff, 0xd2, 0x16, 0x5f, 0x34, 0xe3, 0x00, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// GreeterClient is the client API for Greeter service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type GreeterClient interface {
- // Sends a greeting
- SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
-}
-
-type greeterClient struct {
- cc *grpc.ClientConn
-}
-
-func NewGreeterClient(cc *grpc.ClientConn) GreeterClient {
- return &greeterClient{cc}
-}
-
-func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) {
- out := new(HelloReply)
- err := c.cc.Invoke(ctx, "/main.Greeter/SayHello", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// GreeterServer is the server API for Greeter service.
-type GreeterServer interface {
- // Sends a greeting
- SayHello(context.Context, *HelloRequest) (*HelloReply, error)
-}
-
-// UnimplementedGreeterServer can be embedded to have forward compatible implementations.
-type UnimplementedGreeterServer struct {
-}
-
-func (*UnimplementedGreeterServer) SayHello(ctx context.Context, req *HelloRequest) (*HelloReply, error) {
- return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
-}
-
-func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) {
- s.RegisterService(&_Greeter_serviceDesc, srv)
-}
-
-func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(HelloRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GreeterServer).SayHello(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/main.Greeter/SayHello",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Greeter_serviceDesc = grpc.ServiceDesc{
- ServiceName: "main.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "SayHello",
- Handler: _Greeter_SayHello_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "helloworld.proto",
-}
-
-// GreeterClientImpl is the client API for Greeter service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type GreeterClientImpl struct {
- // Sends a greeting
- SayHello func(ctx context.Context, in *HelloRequest, out *HelloReply) error
-}
-
-func (c *GreeterClientImpl) Reference() string {
- return "greeterImpl"
-}
-
-func (c *GreeterClientImpl) GetDubboStub(cc *grpc.ClientConn) GreeterClient {
- return NewGreeterClient(cc)
-}
-
-type GreeterProviderBase struct {
- proxyImpl protocol.Invoker
-}
-
-func (s *GreeterProviderBase) SetProxyImpl(impl protocol.Invoker) {
- s.proxyImpl = impl
-}
-
-func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
- return s.proxyImpl
-}
-
-func _DUBBO_Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(HelloRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- base := srv.(dgrpc.DubboGrpcService)
- args := []interface{}{}
- args = append(args, in)
- invo := invocation.NewRPCInvocation("SayHello", args, nil)
- if interceptor == nil {
- result := base.GetProxyImpl().Invoke(context.Background(), invo)
- return result.Result(), result.Error()
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/main.Greeter/SayHello",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- result := base.GetProxyImpl().Invoke(context.Background(), invo)
- return result.Result(), result.Error()
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func (s *GreeterProviderBase) ServiceDesc() *grpc.ServiceDesc {
- return &grpc.ServiceDesc{
- ServiceName: "main.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "SayHello",
- Handler: _DUBBO_Greeter_SayHello_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "helloworld.proto",
- }
-}
diff --git a/general/grpc/unary/go-client/app/helloworld.proto b/general/grpc/unary/go-client/app/helloworld.proto
deleted file mode 100644
index 3a440cd..0000000
--- a/general/grpc/unary/go-client/app/helloworld.proto
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015 The gRPC Authors
-//
-// Licensed 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.
-syntax = "proto3";
-
-option java_multiple_files = true;
-option java_package = "org.apache.dubbo";
-option java_outer_classname = "HelloWorldProto";
-option objc_class_prefix = "HLW";
-
-package protobuf;
-
-// The greeting service definition.
-service Greeter {
- // Sends a greeting
- rpc SayHello (HelloRequest) returns (HelloReply) {}
-}
-
-// The request message containing the user's name.
-message HelloRequest {
- string name = 1;
-}
-
-// The response message containing the greetings
-message HelloReply {
- string message = 1;
-}
diff --git a/general/grpc/unary/go-client/app/version.go b/general/grpc/unary/go-client/app/version.go
deleted file mode 100644
index ae51f45..0000000
--- a/general/grpc/unary/go-client/app/version.go
+++ /dev/null
@@ -1,22 +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 main
-
-var (
- Version = "2.7.5"
-)
diff --git a/general/grpc/unary/go-client/assembly/bin/load.sh b/general/grpc/unary/go-client/assembly/bin/load.sh
deleted file mode 100644
index ffa240b..0000000
--- a/general/grpc/unary/go-client/assembly/bin/load.sh
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-APP_NAME="APPLICATION_NAME"
-APP_ARGS=""
-SLEEP_INTERVAL=5
-MAX_LIFETIME=4000
-
-PROJECT_HOME=""
-OS_NAME=`uname`
-if [[ ${OS_NAME} != "Windows" ]]; then
- PROJECT_HOME=`pwd`
- PROJECT_HOME=${PROJECT_HOME}"/"
-else
- APP_NAME="APPLICATION_NAME.exe"
-fi
-
-export CONF_CONSUMER_FILE_PATH=${PROJECT_HOME}"TARGET_CONF_FILE"
-export APP_LOG_CONF_FILE=${PROJECT_HOME}"TARGET_LOG_CONF_FILE"
-# export GOTRACEBACK=system
-# export GODEBUG=gctrace=1
-
-usage() {
- echo "Usage: $0 start [conf suffix]"
- echo " $0 stop"
- echo " $0 term"
- echo " $0 restart"
- echo " $0 list"
- echo " $0 monitor"
- echo " $0 crontab"
- exit
-}
-
-start() {
- arg=$1
- if [ "$arg" = "" ];then
- echo "No registry type! Default client.yml!"
- else
- export CONF_CONSUMER_FILE_PATH=${CONF_CONSUMER_FILE_PATH//\.yml/\_$arg\.yml}
- fi
- if [ ! -f "${CONF_CONSUMER_FILE_PATH}" ];then
- echo $CONF_CONSUMER_FILE_PATH" is not existing!"
- return
- fi
- APP_LOG_PATH=${PROJECT_HOME}"logs/"
- mkdir -p ${APP_LOG_PATH}
- APP_BIN=${PROJECT_HOME}sbin/${APP_NAME}
- chmod u+x ${APP_BIN}
- # CMD="nohup ${APP_BIN} ${APP_ARGS} >>${APP_NAME}.nohup.out 2>&1 &"
- CMD="${APP_BIN}"
- eval ${CMD}
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- CUR=`date +%FT%T`
- if [ "${PID}" != "" ]; then
- for p in ${PID}
- do
- echo "start ${APP_NAME} ( pid =" ${p} ") at " ${CUR}
- done
- fi
-}
-
-stop() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -SIGINT ${APP_NAME} ( pid =" ${ps} ")"
- kill -2 ${ps}
- done
- fi
-}
-
-
-term() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -9 ${APP_NAME} ( pid =" ${ps} ")"
- kill -9 ${ps}
- done
- fi
-}
-
-list() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s\n", $1, $2, $9, $10)}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s,%s\n", $1, $4, $6, $7, $8)}'`
- fi
-
- if [ "${PID}" != "" ]; then
- echo "list ${APP_NAME}"
-
- if [[ ${OS_NAME} == "Linux" || ${OS_NAME} == "Darwin" ]]; then
- echo "index: user, pid, start, duration"
- else
- echo "index: PID, WINPID, UID, STIME, COMMAND"
- fi
- idx=0
- for ps in ${PID}
- do
- echo "${idx}: ${ps}"
- ((idx ++))
- done
- fi
-}
-
-monitor() {
- idx=0
- while true; do
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [[ "${PID}" == "" ]]; then
- start
- idx=0
- fi
-
- ((LIFE=idx*${SLEEP_INTERVAL}))
- echo "${APP_NAME} ( pid = " ${PID} ") has been working in normal state for " $LIFE " seconds."
- ((idx ++))
- sleep ${SLEEP_INTERVAL}
- done
-}
-
-crontab() {
- idx=0
- while true; do
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [[ "${PID}" == "" ]]; then
- start
- idx=0
- fi
-
- ((LIFE=idx*${SLEEP_INTERVAL}))
- echo "${APP_NAME} ( pid = " ${PID} ") has been working in normal state for " $LIFE " seconds."
- ((idx ++))
- sleep ${SLEEP_INTERVAL}
- if [[ ${LIFE} -gt ${MAX_LIFETIME} ]]; then
- kill -9 ${PID}
- fi
- done
-}
-
-opt=$1
-case C"$opt" in
- Cstart)
- start $2
- ;;
- Cstop)
- stop
- ;;
- Cterm)
- term
- ;;
- Crestart)
- term
- start $2
- ;;
- Clist)
- list
- ;;
- Cmonitor)
- monitor
- ;;
- Ccrontab)
- crontab
- ;;
- C*)
- usage
- ;;
-esac
-
diff --git a/general/grpc/unary/go-client/assembly/common/app.properties b/general/grpc/unary/go-client/assembly/common/app.properties
deleted file mode 100644
index e10868f..0000000
--- a/general/grpc/unary/go-client/assembly/common/app.properties
+++ /dev/null
@@ -1,23 +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.
-
-
-export TARGET_EXEC_NAME="user_info_client"
-# BUILD_PACKAGE="dubbogo-examples/user-info/client/app"
-export BUILD_PACKAGE="app"
-
-export TARGET_CONF_FILE="conf/client.yml"
-export TARGET_LOG_CONF_FILE="conf/log.yml"
diff --git a/general/grpc/unary/go-client/assembly/common/build.sh b/general/grpc/unary/go-client/assembly/common/build.sh
deleted file mode 100644
index d38f889..0000000
--- a/general/grpc/unary/go-client/assembly/common/build.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-rm -rf target/
-
-PROJECT_HOME=`pwd`
-TARGET_FOLDER=${PROJECT_HOME}/target/${GOOS}
-
-TARGET_SBIN_NAME=${TARGET_EXEC_NAME}
-version=`cat app/version.go | grep Version | grep -v "Apache" | awk -F '=' '{print $2}' | awk -F '"' '{print $2}'`
-if [[ ${GOOS} == "windows" ]]; then
- TARGET_SBIN_NAME=${TARGET_SBIN_NAME}.exe
-fi
-TARGET_NAME=${TARGET_FOLDER}/${TARGET_SBIN_NAME}
-if [[ $PROFILE == "dev" || $PROFILE == "test" ]]; then
- # GFLAGS=-gcflags "-N -l" -race -x -v # -x会把go build的详细过程输出
- # GFLAGS=-gcflags "-N -l" -race -v
- # GFLAGS="-gcflags \"-N -l\" -v"
- cd ${BUILD_PACKAGE} && GOOS=$GOOS GOARCH=$GOARCH GO111MODULE=on go build -gcflags "-N -l" -x -v -i -o ${TARGET_NAME} && cd -
-else
- # -s去掉符号表(然后panic时候的stack trace就没有任何文件名/行号信息了,这个等价于普通C/C++程序被strip的效果),
- # -w去掉DWARF调试信息,得到的程序就不能用gdb调试了。-s和-w也可以分开使用,一般来说如果不打算用gdb调试,
- # -w基本没啥损失。-s的损失就有点大了。
- cd ${BUILD_PACKAGE} && GOOS=$GOOS GOARCH=$GOARCH GO111MODULE=on go build -ldflags "-w" -x -v -i -o ${TARGET_NAME} && cd -
-fi
-
-TAR_NAME=${TARGET_EXEC_NAME}-${version}-`date "+%Y%m%d-%H%M"`-${PROFILE}
-
-mkdir -p ${TARGET_FOLDER}/${TAR_NAME}
-
-SBIN_DIR=${TARGET_FOLDER}/${TAR_NAME}/sbin
-BIN_DIR=${TARGET_FOLDER}/${TAR_NAME}
-CONF_DIR=${TARGET_FOLDER}/${TAR_NAME}/conf
-
-mkdir -p ${SBIN_DIR}
-mkdir -p ${CONF_DIR}
-
-mv ${TARGET_NAME} ${SBIN_DIR}
-cp -r assembly/bin ${BIN_DIR}
-cd ${BIN_DIR}/bin/ && mv load.sh load_${TARGET_EXEC_NAME}.sh && cd -
-
-platform=$(uname)
-# modify APPLICATION_NAME
-if [ ${platform} == "Darwin" ]; then
- sed -i "" "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-fi
-
-# modify TARGET_CONF_FILE
-if [ ${platform} == "Darwin" ]; then
- sed -i "" "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-
-# modify TARGET_LOG_CONF_FILE
-if [ ${platform} == "Darwin" ]; then
- sed -i "" "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-
-cp -r profiles/${PROFILE}/* ${CONF_DIR}
-
-cd ${TARGET_FOLDER}
-
-tar czf ${TAR_NAME}.tar.gz ${TAR_NAME}/*
-
diff --git a/general/grpc/unary/go-client/assembly/linux/dev.sh b/general/grpc/unary/go-client/assembly/linux/dev.sh
deleted file mode 100644
index eada737..0000000
--- a/general/grpc/unary/go-client/assembly/linux/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="dev"
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-client/assembly/linux/release.sh b/general/grpc/unary/go-client/assembly/linux/release.sh
deleted file mode 100644
index 10eb3d7..0000000
--- a/general/grpc/unary/go-client/assembly/linux/release.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="release"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-client/assembly/linux/test.sh b/general/grpc/unary/go-client/assembly/linux/test.sh
deleted file mode 100644
index 78b650c..0000000
--- a/general/grpc/unary/go-client/assembly/linux/test.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="test"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-client/assembly/mac/dev.sh b/general/grpc/unary/go-client/assembly/mac/dev.sh
deleted file mode 100644
index c828476..0000000
--- a/general/grpc/unary/go-client/assembly/mac/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-export PROFILE="dev"
-
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-client/assembly/mac/release.sh b/general/grpc/unary/go-client/assembly/mac/release.sh
deleted file mode 100644
index 91c2dfe..0000000
--- a/general/grpc/unary/go-client/assembly/mac/release.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-export PROFILE="release"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-client/assembly/mac/test.sh b/general/grpc/unary/go-client/assembly/mac/test.sh
deleted file mode 100644
index a7853f5..0000000
--- a/general/grpc/unary/go-client/assembly/mac/test.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-export PROFILE="test"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-client/assembly/windows/dev.sh b/general/grpc/unary/go-client/assembly/windows/dev.sh
deleted file mode 100644
index 10a3866..0000000
--- a/general/grpc/unary/go-client/assembly/windows/dev.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="dev"
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-client/assembly/windows/release.sh b/general/grpc/unary/go-client/assembly/windows/release.sh
deleted file mode 100644
index 21af573..0000000
--- a/general/grpc/unary/go-client/assembly/windows/release.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-export PROFILE="release"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-client/assembly/windows/test.sh b/general/grpc/unary/go-client/assembly/windows/test.sh
deleted file mode 100644
index 2104da8..0000000
--- a/general/grpc/unary/go-client/assembly/windows/test.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-export PROFILE="test"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-client/profiles/dev/client.yml b/general/grpc/unary/go-client/profiles/dev/client.yml
deleted file mode 100644
index d04a578..0000000
--- a/general/grpc/unary/go-client/profiles/dev/client.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "demoZk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-
-references:
- "GrpcGreeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "demoZk"
- protocol : "grpc"
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- cluster: "failover"
- methods :
- - name: "SayHello"
- retries: 3
-
-
-protocol_conf:
- grpc:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "20s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
\ No newline at end of file
diff --git a/general/grpc/unary/go-client/profiles/dev/log.yml b/general/grpc/unary/go-client/profiles/dev/log.yml
deleted file mode 100644
index 59fa427..0000000
--- a/general/grpc/unary/go-client/profiles/dev/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "debug"
-development: true
-disableCaller: false
-disableStacktrace: false
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/general/grpc/unary/go-client/profiles/release/client.yml b/general/grpc/unary/go-client/profiles/release/client.yml
deleted file mode 100644
index 265654c..0000000
--- a/general/grpc/unary/go-client/profiles/release/client.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "test"
-
-registries :
- "demoZk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-
-references:
- "GrpcGreeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "demoZk"
- protocol : "grpc"
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- cluster: "failover"
- methods :
- - name: "SayHello"
- retries: 3
-
-
-protocol_conf:
- grpc:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "20s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
\ No newline at end of file
diff --git a/general/grpc/unary/go-client/profiles/release/log.yml b/general/grpc/unary/go-client/profiles/release/log.yml
deleted file mode 100644
index e0514be..0000000
--- a/general/grpc/unary/go-client/profiles/release/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "warn"
-development: true
-disableCaller: true
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/general/grpc/unary/go-client/profiles/test/client.yml b/general/grpc/unary/go-client/profiles/test/client.yml
deleted file mode 100644
index e0c0737..0000000
--- a/general/grpc/unary/go-client/profiles/test/client.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-config_center:
- protocol: "zookeeper"
- address: "127.0.0.1:2181"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "demoZk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-references:
- "GrpcGreeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "demoZk"
- protocol : "grpc"
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- cluster: "failover"
- methods :
- - name: "SayHello"
- retries: 3
-
-
-protocol_conf:
- grpc:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "20s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
\ No newline at end of file
diff --git a/general/grpc/unary/go-client/profiles/test/log.yml b/general/grpc/unary/go-client/profiles/test/log.yml
deleted file mode 100644
index baee0b7..0000000
--- a/general/grpc/unary/go-client/profiles/test/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "info"
-development: false
-disableCaller: false
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/general/grpc/unary/go-server/app/greeter.go b/general/grpc/unary/go-server/app/greeter.go
deleted file mode 100644
index a659a28..0000000
--- a/general/grpc/unary/go-server/app/greeter.go
+++ /dev/null
@@ -1,46 +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 main
-
-import (
- "context"
- "fmt"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
-)
-
-type GreeterProvider struct {
- *protobuf.GreeterProviderBase
-}
-
-func NewGreeterProvider() *GreeterProvider {
- return &GreeterProvider{
- GreeterProviderBase: &protobuf.GreeterProviderBase{},
- }
-}
-
-func (g *GreeterProvider) SayHello(ctx context.Context, req *protobuf.HelloRequest) (reply *protobuf.HelloReply, err error) {
- fmt.Printf("req: %v", req)
- return &protobuf.HelloReply{Message: "this is message from reply"}, nil
-}
-
-func (g *GreeterProvider) Reference() string {
- return "GrpcGreeterImpl"
-}
diff --git a/general/grpc/unary/go-server/app/helloworld.pb.go b/general/grpc/unary/go-server/app/helloworld.pb.go
deleted file mode 100644
index 803e757..0000000
--- a/general/grpc/unary/go-server/app/helloworld.pb.go
+++ /dev/null
@@ -1,283 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: helloworld.proto
-
-package main
-
-import (
- context "context"
- fmt "fmt"
- proto "github.com/golang/protobuf/proto"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- math "math"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/protocol"
- dgrpc "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
-// The request message containing the user's name.
-type HelloRequest struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HelloRequest) Reset() { *m = HelloRequest{} }
-func (m *HelloRequest) String() string { return proto.CompactTextString(m) }
-func (*HelloRequest) ProtoMessage() {}
-func (*HelloRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_17b8c58d586b62f2, []int{0}
-}
-
-func (m *HelloRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_HelloRequest.Unmarshal(m, b)
-}
-func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic)
-}
-func (m *HelloRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HelloRequest.Merge(m, src)
-}
-func (m *HelloRequest) XXX_Size() int {
- return xxx_messageInfo_HelloRequest.Size(m)
-}
-func (m *HelloRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_HelloRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HelloRequest proto.InternalMessageInfo
-
-func (m *HelloRequest) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-// The response message containing the greetings
-type HelloReply struct {
- Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HelloReply) Reset() { *m = HelloReply{} }
-func (m *HelloReply) String() string { return proto.CompactTextString(m) }
-func (*HelloReply) ProtoMessage() {}
-func (*HelloReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_17b8c58d586b62f2, []int{1}
-}
-
-func (m *HelloReply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_HelloReply.Unmarshal(m, b)
-}
-func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic)
-}
-func (m *HelloReply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HelloReply.Merge(m, src)
-}
-func (m *HelloReply) XXX_Size() int {
- return xxx_messageInfo_HelloReply.Size(m)
-}
-func (m *HelloReply) XXX_DiscardUnknown() {
- xxx_messageInfo_HelloReply.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HelloReply proto.InternalMessageInfo
-
-func (m *HelloReply) GetMessage() string {
- if m != nil {
- return m.Message
- }
- return ""
-}
-
-func init() {
- proto.RegisterType((*HelloRequest)(nil), "protobuf.HelloRequest")
- proto.RegisterType((*HelloReply)(nil), "protobuf.HelloReply")
-}
-
-func init() { proto.RegisterFile("helloworld.proto", fileDescriptor_17b8c58d586b62f2) }
-
-var fileDescriptor_17b8c58d586b62f2 = []byte{
- // 183 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0x48, 0xcd, 0xc9,
- 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x00, 0x53,
- 0x49, 0xa5, 0x69, 0x4a, 0x4a, 0x5c, 0x3c, 0x1e, 0x20, 0xd9, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2,
- 0x12, 0x21, 0x21, 0x2e, 0x96, 0xbc, 0xc4, 0xdc, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20,
- 0x30, 0x5b, 0x49, 0x8d, 0x8b, 0x0b, 0xaa, 0xa6, 0x20, 0xa7, 0x52, 0x48, 0x82, 0x8b, 0x3d, 0x37,
- 0xb5, 0xb8, 0x38, 0x31, 0x1d, 0xa6, 0x08, 0xc6, 0x35, 0x72, 0xe5, 0x62, 0x77, 0x2f, 0x4a, 0x4d,
- 0x2d, 0x49, 0x2d, 0x12, 0xb2, 0xe2, 0xe2, 0x08, 0x4e, 0xac, 0x04, 0xeb, 0x12, 0x12, 0xd3, 0x83,
- 0xd9, 0xa6, 0x87, 0x6c, 0x95, 0x94, 0x08, 0x86, 0x78, 0x41, 0x4e, 0xa5, 0x12, 0x83, 0x93, 0x36,
- 0x97, 0x40, 0x7e, 0x51, 0xba, 0x5e, 0x62, 0x41, 0x62, 0x72, 0x46, 0xaa, 0x5e, 0x4a, 0x69, 0x52,
- 0x52, 0xbe, 0x13, 0x3f, 0x58, 0x45, 0x38, 0xc8, 0x0b, 0x01, 0x20, 0x4d, 0x01, 0x8c, 0x8b, 0x98,
- 0x98, 0x3d, 0x7c, 0xc2, 0x93, 0xd8, 0xc0, 0x66, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xde,
- 0x1e, 0xf0, 0xa3, 0xe4, 0x00, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// GreeterClient is the client API for Greeter service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type GreeterClient interface {
- // Sends a greeting
- SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
-}
-
-type greeterClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient {
- return &greeterClient{cc}
-}
-
-func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) {
- out := new(HelloReply)
- err := c.cc.Invoke(ctx, "/protobuf.Greeter/SayHello", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// GreeterServer is the server API for Greeter service.
-type GreeterServer interface {
- // Sends a greeting
- SayHello(context.Context, *HelloRequest) (*HelloReply, error)
-}
-
-// UnimplementedGreeterServer can be embedded to have forward compatible implementations.
-type UnimplementedGreeterServer struct {
-}
-
-func (*UnimplementedGreeterServer) SayHello(ctx context.Context, req *HelloRequest) (*HelloReply, error) {
- return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
-}
-
-func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) {
- s.RegisterService(&_Greeter_serviceDesc, srv)
-}
-
-func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(HelloRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GreeterServer).SayHello(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/protobuf.Greeter/SayHello",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Greeter_serviceDesc = grpc.ServiceDesc{
- ServiceName: "protobuf.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "SayHello",
- Handler: _Greeter_SayHello_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "helloworld.proto",
-}
-
-// GreeterClientImpl is the client API for Greeter service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type GreeterClientImpl struct {
- // Sends a greeting
- SayHello func(ctx context.Context, in *HelloRequest, out *HelloReply) error
-}
-
-func (c *GreeterClientImpl) Reference() string {
- return "greeterImpl"
-}
-
-func (c *GreeterClientImpl) GetDubboStub(cc *grpc.ClientConn) GreeterClient {
- return NewGreeterClient(cc)
-}
-
-type GreeterProviderBase struct {
- proxyImpl protocol.Invoker
-}
-
-func (s *GreeterProviderBase) SetProxyImpl(impl protocol.Invoker) {
- s.proxyImpl = impl
-}
-
-func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
- return s.proxyImpl
-}
-
-func _DUBBO_Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(HelloRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- base := srv.(dgrpc.DubboGrpcService)
- args := []interface{}{}
- args = append(args, in)
- invo := invocation.NewRPCInvocation("SayHello", args, nil)
- if interceptor == nil {
- result := base.GetProxyImpl().Invoke(context.Background(), invo)
- return result.Result(), result.Error()
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/protobuf.Greeter/SayHello",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- result := base.GetProxyImpl().Invoke(context.Background(), invo)
- return result.Result(), result.Error()
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func (s *GreeterProviderBase) ServiceDesc() *grpc.ServiceDesc {
- return &grpc.ServiceDesc{
- ServiceName: "protobuf.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "SayHello",
- Handler: _DUBBO_Greeter_SayHello_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "helloworld.proto",
- }
-}
diff --git a/general/grpc/unary/go-server/app/helloworld.proto b/general/grpc/unary/go-server/app/helloworld.proto
deleted file mode 100644
index d68e1dd..0000000
--- a/general/grpc/unary/go-server/app/helloworld.proto
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015 The gRPC Authors
-//
-// Licensed 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.
-syntax = "proto3";
-
-option java_multiple_files = true;
-option java_package = "io.grpc.examples.helloworld";
-option java_outer_classname = "HelloWorldProto";
-option objc_class_prefix = "HLW";
-
-package main;
-
-// The greeting service definition.
-service Greeter {
- // Sends a greeting
- rpc SayHello (HelloRequest) returns (HelloReply) {}
-}
-
-// The request message containing the user's name.
-message HelloRequest {
- string name = 1;
-}
-
-// The response message containing the greetings
-message HelloReply {
- string message = 1;
-}
diff --git a/general/grpc/unary/go-server/app/server.go b/general/grpc/unary/go-server/app/server.go
deleted file mode 100644
index 301fa3c..0000000
--- a/general/grpc/unary/go-server/app/server.go
+++ /dev/null
@@ -1,79 +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 main
-
-import (
- "fmt"
- "os"
- "os/signal"
- "syscall"
- "time"
-)
-
-import (
- _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
- _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- "dubbo.apache.org/dubbo-go/v3/common/logger"
- _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
-)
-
-var (
- survivalTimeout = int(3 * time.Second)
-)
-
-func init() {
- config.SetProviderService(NewGreeterProvider())
-}
-
-// they are necessary:
-// export CONF_PROVIDER_FILE_PATH="xxx"
-// export APP_LOG_CONF_FILE="xxx"
-func main() {
-
- config.Load()
-
- initSignal()
-}
-
-func initSignal() {
- signals := make(chan os.Signal, 1)
- // It is not possible to block SIGKILL or syscall.SIGSTOP
- signal.Notify(signals, os.Interrupt, os.Kill, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
- for {
- sig := <-signals
- logger.Infof("get signal %s", sig.String())
- switch sig {
- case syscall.SIGHUP:
- // reload()
- default:
- time.AfterFunc(time.Duration(survivalTimeout), func() {
- logger.Warnf("app exit now by force...")
- os.Exit(1)
- })
-
- // The program exits normally or timeout forcibly exits.
- fmt.Println("provider app exit now...")
- return
- }
- }
-}
diff --git a/general/grpc/unary/go-server/app/version.go b/general/grpc/unary/go-server/app/version.go
deleted file mode 100644
index ae51f45..0000000
--- a/general/grpc/unary/go-server/app/version.go
+++ /dev/null
@@ -1,22 +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 main
-
-var (
- Version = "2.7.5"
-)
diff --git a/general/grpc/unary/go-server/assembly/bin/load.sh b/general/grpc/unary/go-server/assembly/bin/load.sh
deleted file mode 100644
index 90077c2..0000000
--- a/general/grpc/unary/go-server/assembly/bin/load.sh
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-APP_NAME="APPLICATION_NAME"
-APP_ARGS=""
-
-
-PROJECT_HOME=""
-OS_NAME=`uname`
-if [[ ${OS_NAME} != "Windows" ]]; then
- PROJECT_HOME=`pwd`
- PROJECT_HOME=${PROJECT_HOME}"/"
-fi
-
-export CONF_PROVIDER_FILE_PATH=${PROJECT_HOME}"TARGET_CONF_FILE"
-export APP_LOG_CONF_FILE=${PROJECT_HOME}"TARGET_LOG_CONF_FILE"
-
-usage() {
- echo "Usage: $0 start [conf suffix]"
- echo " $0 stop"
- echo " $0 term"
- echo " $0 restart"
- echo " $0 list"
- echo " $0 monitor"
- echo " $0 crontab"
- exit
-}
-
-start() {
- arg=$1
- if [ "$arg" = "" ];then
- echo "No registry type! Default server.yml!"
- else
- export CONF_PROVIDER_FILE_PATH=${CONF_PROVIDER_FILE_PATH//\.yml/\_$arg\.yml}
- fi
- if [ ! -f "${CONF_PROVIDER_FILE_PATH}" ];then
- echo $CONF_PROVIDER_FILE_PATH" is not existing!"
- return
- fi
- APP_LOG_PATH="${PROJECT_HOME}logs/"
- mkdir -p ${APP_LOG_PATH}
- APP_BIN=${PROJECT_HOME}sbin/${APP_NAME}
- chmod u+x ${APP_BIN}
- # CMD="nohup ${APP_BIN} ${APP_ARGS} >>${APP_NAME}.nohup.out 2>&1 &"
- CMD="${APP_BIN}"
- eval ${CMD}
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- CUR=`date +%FT%T`
- if [ "${PID}" != "" ]; then
- for p in ${PID}
- do
- echo "start ${APP_NAME} ( pid =" ${p} ") at " ${CUR}
- done
- fi
-}
-
-stop() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -SIGINT ${APP_NAME} ( pid =" ${ps} ")"
- kill -2 ${ps}
- done
- fi
-}
-
-
-term() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -9 ${APP_NAME} ( pid =" ${ps} ")"
- kill -9 ${ps}
- done
- fi
-}
-
-list() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s\n", $1, $2, $9, $10)}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s,%s\n", $1, $4, $6, $7, $8)}'`
- fi
-
- if [ "${PID}" != "" ]; then
- echo "list ${APP_NAME}"
-
- if [[ ${OS_NAME} == "Linux" || ${OS_NAME} == "Darwin" ]]; then
- echo "index: user, pid, start, duration"
- else
- echo "index: PID, WINPID, UID, STIME, COMMAND"
- fi
- idx=0
- for ps in ${PID}
- do
- echo "${idx}: ${ps}"
- ((idx ++))
- done
- fi
-}
-
-opt=$1
-case C"$opt" in
- Cstart)
- start $2
- ;;
- Cstop)
- stop
- ;;
- Cterm)
- term
- ;;
- Crestart)
- term
- start $2
- ;;
- Clist)
- list
- ;;
- C*)
- usage
- ;;
-esac
-
diff --git a/general/grpc/unary/go-server/assembly/common/app.properties b/general/grpc/unary/go-server/assembly/common/app.properties
deleted file mode 100644
index 1f0827e..0000000
--- a/general/grpc/unary/go-server/assembly/common/app.properties
+++ /dev/null
@@ -1,23 +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.
-
-
-TARGET_EXEC_NAME="user_info_server"
-# BUILD_PACKAGE="dubbogo-examples/user-info/server/app"
-BUILD_PACKAGE="app"
-
-TARGET_CONF_FILE="conf/server.yml"
-TARGET_LOG_CONF_FILE="conf/log.yml"
diff --git a/general/grpc/unary/go-server/assembly/common/build.sh b/general/grpc/unary/go-server/assembly/common/build.sh
deleted file mode 100644
index d90d026..0000000
--- a/general/grpc/unary/go-server/assembly/common/build.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-rm -rf target/
-
-PROJECT_HOME=`pwd`
-TARGET_FOLDER=${PROJECT_HOME}/target/${GOOS}
-
-TARGET_SBIN_NAME=${TARGET_EXEC_NAME}
-version=`cat app/version.go | grep Version | grep -v "Apache" | awk -F '=' '{print $2}' | awk -F '"' '{print $2}'`
-if [[ ${GOOS} == "windows" ]]; then
- TARGET_SBIN_NAME=${TARGET_SBIN_NAME}.exe
-fi
-TARGET_NAME=${TARGET_FOLDER}/${TARGET_SBIN_NAME}
-if [[ $PROFILE = "test" ]]; then
- # GFLAGS=-gcflags "-N -l" -race -x -v # -x会把go build的详细过程输出
- # GFLAGS=-gcflags "-N -l" -race -v
- # GFLAGS="-gcflags \"-N -l\" -v"
- cd ${BUILD_PACKAGE} && GO111MODULE=on go build -gcflags "-N -l" -x -v -i -o ${TARGET_NAME} && cd -
-else
- # -s去掉符号表(然后panic时候的stack trace就没有任何文件名/行号信息了,这个等价于普通C/C++程序被strip的效果),
- # -w去掉DWARF调试信息,得到的程序就不能用gdb调试了。-s和-w也可以分开使用,一般来说如果不打算用gdb调试,
- # -w基本没啥损失。-s的损失就有点大了。
- cd ${BUILD_PACKAGE} && GO111MODULE=on go build -ldflags "-w" -x -v -i -o ${TARGET_NAME} && cd -
-fi
-
-TAR_NAME=${TARGET_EXEC_NAME}-${version}-`date "+%Y%m%d-%H%M"`-${PROFILE}
-
-mkdir -p ${TARGET_FOLDER}/${TAR_NAME}
-
-SBIN_DIR=${TARGET_FOLDER}/${TAR_NAME}/sbin
-BIN_DIR=${TARGET_FOLDER}/${TAR_NAME}
-CONF_DIR=${TARGET_FOLDER}/${TAR_NAME}/conf
-
-mkdir -p ${SBIN_DIR}
-mkdir -p ${CONF_DIR}
-
-mv ${TARGET_NAME} ${SBIN_DIR}
-cp -r assembly/bin ${BIN_DIR}
-# modify APPLICATION_NAME
-# OS=`uname`
-# if [[ $OS=="Darwin" ]]; then
-if [ "$(uname)" == "Darwin" ]; then
- sed -i "" "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-fi
-# modify TARGET_CONF_FILE
-if [ "$(uname)" == "Darwin" ]; then
- sed -i "" "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-# modify TARGET_LOG_CONF_FILE
-if [ "$(uname)" == "Darwin" ]; then
- sed -i "" "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-
-cp -r profiles/${PROFILE}/* ${CONF_DIR}
-
-cd ${TARGET_FOLDER}
-
-tar czf ${TAR_NAME}.tar.gz ${TAR_NAME}/*
-
diff --git a/general/grpc/unary/go-server/assembly/linux/dev.sh b/general/grpc/unary/go-server/assembly/linux/dev.sh
deleted file mode 100644
index d830ac9..0000000
--- a/general/grpc/unary/go-server/assembly/linux/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-PROFILE=dev
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-server/assembly/linux/release.sh b/general/grpc/unary/go-server/assembly/linux/release.sh
deleted file mode 100644
index 9930380..0000000
--- a/general/grpc/unary/go-server/assembly/linux/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-PROFILE=release
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-server/assembly/linux/test.sh b/general/grpc/unary/go-server/assembly/linux/test.sh
deleted file mode 100644
index 87144bb..0000000
--- a/general/grpc/unary/go-server/assembly/linux/test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-PROFILE=test
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-server/assembly/mac/dev.sh b/general/grpc/unary/go-server/assembly/mac/dev.sh
deleted file mode 100644
index 3a7659b..0000000
--- a/general/grpc/unary/go-server/assembly/mac/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-PROFILE=dev
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-server/assembly/mac/release.sh b/general/grpc/unary/go-server/assembly/mac/release.sh
deleted file mode 100644
index 1c4bce4..0000000
--- a/general/grpc/unary/go-server/assembly/mac/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-PROFILE=release
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-server/assembly/mac/test.sh b/general/grpc/unary/go-server/assembly/mac/test.sh
deleted file mode 100644
index 69206e3..0000000
--- a/general/grpc/unary/go-server/assembly/mac/test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-PROFILE=test
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
-
diff --git a/general/grpc/unary/go-server/assembly/windows/dev.sh b/general/grpc/unary/go-server/assembly/windows/dev.sh
deleted file mode 100644
index 011fb41..0000000
--- a/general/grpc/unary/go-server/assembly/windows/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-PROFILE=dev
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-server/assembly/windows/release.sh b/general/grpc/unary/go-server/assembly/windows/release.sh
deleted file mode 100644
index 679a26a..0000000
--- a/general/grpc/unary/go-server/assembly/windows/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-PROFILE=release
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-server/assembly/windows/test.sh b/general/grpc/unary/go-server/assembly/windows/test.sh
deleted file mode 100644
index 4a36de0..0000000
--- a/general/grpc/unary/go-server/assembly/windows/test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-PROFILE=test
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/general/grpc/unary/go-server/profiles/dev/log.yml b/general/grpc/unary/go-server/profiles/dev/log.yml
deleted file mode 100644
index 59fa427..0000000
--- a/general/grpc/unary/go-server/profiles/dev/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "debug"
-development: true
-disableCaller: false
-disableStacktrace: false
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/general/grpc/unary/go-server/profiles/dev/server.yml b/general/grpc/unary/go-server/profiles/dev/server.yml
deleted file mode 100644
index 2e61183..0000000
--- a/general/grpc/unary/go-server/profiles/dev/server.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-# dubbo server yaml configure file
-
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "zk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
-
-services:
- "GrpcGreeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "zk"
- protocol : "grpc"
- # 相当于dubbo.xml中的interface
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "SayHello"
- retries: 1
- loadbalance: "random"
-
-protocols:
- "grpc":
- name: "grpc"
- port: 20000
-
-
-protocol_conf:
- grpc:
- session_number: 700
- session_timeout: "20s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/general/grpc/unary/go-server/profiles/release/log.yml b/general/grpc/unary/go-server/profiles/release/log.yml
deleted file mode 100644
index e0514be..0000000
--- a/general/grpc/unary/go-server/profiles/release/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "warn"
-development: true
-disableCaller: true
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/general/grpc/unary/go-server/profiles/release/server.yml b/general/grpc/unary/go-server/profiles/release/server.yml
deleted file mode 100644
index 214aa14..0000000
--- a/general/grpc/unary/go-server/profiles/release/server.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-# dubbo server yaml configure file
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "demoZk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
-
-services:
- "GrpcGreeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "demoZk"
- protocol : "grpc"
- # 相当于dubbo.xml中的interface
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "SayHello"
- retries: 1
- loadbalance: "random"
-
-protocols:
- "grpc":
- name: "grpc"
- port: 20000
-
-
-protocol_conf:
- grpc:
- session_number: 700
- session_timeout: "20s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/general/grpc/unary/go-server/profiles/test/log.yml b/general/grpc/unary/go-server/profiles/test/log.yml
deleted file mode 100644
index baee0b7..0000000
--- a/general/grpc/unary/go-server/profiles/test/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "info"
-development: false
-disableCaller: false
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/general/grpc/unary/go-server/profiles/test/server.yml b/general/grpc/unary/go-server/profiles/test/server.yml
deleted file mode 100644
index da146ad..0000000
--- a/general/grpc/unary/go-server/profiles/test/server.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-# dubbo server yaml configure file
-
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "test"
-
-registries :
- "demoZk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
-
-services:
- "GrpcGreeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "demoZk"
- protocol : "grpc"
- # 相当于dubbo.xml中的interface
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "SayHello"
- retries: 1
- loadbalance: "random"
-
-protocols:
- "grpc":
- name: "grpc"
- port: 20000
-
-
-protocol_conf:
- grpc:
- session_number: 700
- session_timeout: "20s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/general/grpc/unary/java-client/build.sh b/general/grpc/unary/java-client/build.sh
deleted file mode 100644
index c869acf..0000000
--- a/general/grpc/unary/java-client/build.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-# rm src/main/resources/META-INF/spring/dubbo.consumer.xml
-# cp src/main/resources/META-INF/spring/dubbo-protocol.consumer.xml src/main/resources/META-INF/spring/dubbo.consumer.xml
-# cp src/main/resources/META-INF/spring/jsonrpc-protocol.consumer.xml src/main/resources/META-INF/spring/dubbo.consumer.xml
-mvn clean package -Dmaven.test.skip
diff --git a/general/grpc/unary/java-client/pom.xml b/general/grpc/unary/java-client/pom.xml
deleted file mode 100644
index 687fac4..0000000
--- a/general/grpc/unary/java-client/pom.xml
+++ /dev/null
@@ -1,247 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>com.ikurento</groupId>
- <artifactId>user-info-client</artifactId>
- <packaging>jar</packaging>
- <version>0.2.0</version>
- <description>The demo consumer module of dubbo project</description>
-
- <properties>
- <skip_maven_deploy>false</skip_maven_deploy>
-
- <dubbo-version>2.7.5</dubbo-version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-bom</artifactId>
- <version>${dubbo-version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.6</version>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>28.1-jre</version>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo</artifactId>
- <version>${dubbo-version}</version>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </dependency>
- <dependency>
- <groupId>org.javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.20.0-GA</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.netty</groupId>
- <artifactId>netty</artifactId>
- <version>3.2.5.Final</version>
- </dependency>
-
- <dependency>
- <groupId>com.github.sgroschupf</groupId>
- <artifactId>zkclient</artifactId>
- <version>0.1</version>
- </dependency>
- <dependency>
- <groupId>com.netflix.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>1.1.16</version>
- </dependency>
- <dependency>
- <groupId>com.googlecode.xmemcached</groupId>
- <artifactId>xmemcached</artifactId>
- <version>1.3.6</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.16</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.2</version>
- </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- <version>1.0.0.GA</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-netty</artifactId>
- <version>1.19.0</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-netty-shaded</artifactId>
- <version>1.19.0</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-protobuf</artifactId>
- <version>1.19.0</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-stub</artifactId>
- <version>1.19.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>4.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-recipes</artifactId>
- <version>4.2.0</version>
- </dependency>
- </dependencies>
-
-<repositories>
- <repository>
- <id>apache.snapshots.https</id>
- <name>Apache Development Snapshot Repository</name>
- <url>https://repository.apache.org/content/repositories/snapshots</url>
- <layout>default</layout>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>daily</updatePolicy>
- </snapshots>
- </repository>
- <repository>
- <id>sonatype-nexus-snapshots</id>
- <name>Sonatype Nexus Snapshots</name>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>daily</updatePolicy>
- </snapshots>
- </repository>
-</repositories>
-
-
-
- <build>
- <extensions>
- <extension>
- <groupId>kr.motd.maven</groupId>
- <artifactId>os-maven-plugin</artifactId>
- <version>1.6.1</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.7.0</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.xolstice.maven.plugins</groupId>
- <artifactId>protobuf-maven-plugin</artifactId>
- <version>0.5.1</version>
- <configuration>
- <protocArtifact>com.google.protobuf:protoc:3.7.1:exe:${os.detected.classifier}</protocArtifact>
- <pluginId>dubbo-grpc-java</pluginId>
- <pluginArtifact>org.apache.dubbo:protoc-gen-dubbo-java:1.19.0-SNAPSHOT:exe:${os.detected.classifier}</pluginArtifact>
- <outputDirectory>build/generated/source/proto/main/java</outputDirectory>
- <clearOutputDirectory>false</clearOutputDirectory>
- <pluginParameter>grpc</pluginParameter>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>compile</goal>
- <goal>compile-custom</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>package</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo</artifactId>
- <version>${dubbo-version}</version>
- <outputDirectory>${project.build.directory}/dubbo</outputDirectory>
- <includes>META-INF/assembly/**</includes>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptor>src/main/assembly/assembly.xml</descriptor>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/general/grpc/unary/java-client/src/main/assembly/assembly.xml b/general/grpc/unary/java-client/src/main/assembly/assembly.xml
deleted file mode 100644
index 40c34d8..0000000
--- a/general/grpc/unary/java-client/src/main/assembly/assembly.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-
-<assembly>
- <id>assembly</id>
- <formats>
- <format>tar.gz</format>
- </formats>
- <includeBaseDirectory>true</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>${project.build.directory}/dubbo/META-INF/assembly/bin</directory>
- <outputDirectory>bin</outputDirectory>
- <fileMode>0755</fileMode>
- </fileSet>
- <fileSet>
- <directory>src/main/assembly/conf</directory>
- <outputDirectory>conf</outputDirectory>
- <fileMode>0644</fileMode>
- </fileSet>
- </fileSets>
- <dependencySets>
- <dependencySet>
- <outputDirectory>lib</outputDirectory>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
diff --git a/general/grpc/unary/java-client/src/main/assembly/conf/dubbo.properties b/general/grpc/unary/java-client/src/main/assembly/conf/dubbo.properties
deleted file mode 100644
index 1ac304c..0000000
--- a/general/grpc/unary/java-client/src/main/assembly/conf/dubbo.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-### dubbo注册中心配置 ###
-dubbo.container = log4j,spring
-dubbo.application.name = user-info-client
-dubbo.application.owner = AlexStocks
-dubbo.application.environment = product
-dubbo.registry.address = zookeeper://127.0.0.1:2181
-dubbo.monitor.protocol = zookeeper
-dubbo.consumer.timeout = 10000
-dubbo.provider.timeout = 10000
-dubbo.protocol.name = grpc
-dubbo.application.qos.enable = false
-dubbo.log4j.file = logs/client.log
-dubbo.log4j.level = WARN
diff --git a/general/grpc/unary/java-client/src/main/assembly/conf/log4j.properties b/general/grpc/unary/java-client/src/main/assembly/conf/log4j.properties
deleted file mode 100644
index 06bcb34..0000000
--- a/general/grpc/unary/java-client/src/main/assembly/conf/log4j.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-## Logger configure file for myproject
-log.dir=logs/
-datestamp=yyyy-MM-dd/HH:mm:ss.SSS
-
-log4j.rootLogger=DEBUG, file, console
-
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.threshold=DEBUG
-log4j.appender.file.File=${log.dir}/log4j.log
-log4j.appender.file.DatePattern=-yyyyMMddHH
-log4j.appender.file.ImmediateFlush=true
-log4j.appender.file.Append=true
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=DEBUG
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
diff --git a/general/grpc/unary/java-client/src/main/java/com/ikurento/user/Consumer.java b/general/grpc/unary/java-client/src/main/java/com/ikurento/user/Consumer.java
deleted file mode 100644
index 0eae3db..0000000
--- a/general/grpc/unary/java-client/src/main/java/com/ikurento/user/Consumer.java
+++ /dev/null
@@ -1,111 +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.ikurento.user;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.concurrent.CountDownLatch;
-
-import io.grpc.stub.StreamObserver;
-
-
-public class Consumer {
- // Define a private variable (Required in Spring)
- private UserProviderGrpc.IUserProvider userProvider;
-
- // Spring DI (Required in Spring)
- public void setUserProvider(UserProviderGrpc.IUserProvider u) {
- this.userProvider = u;
- }
-
- // Start the entry function for consumer (Specified in the configuration file)
- public void start() throws Exception {
- System.out.println("\n\ntest");
- testGetUser();
- System.out.println("\n\ntestList");
- testGetUserList();
- System.out.println("\n\ntestErr");
- testGetErr();
- System.out.println("\n\ntestStream");
- testGetUserByStream();
- }
-
- private void testGetUser() throws Exception {
- try {
- UserID userID = UserID.newBuilder().setID("A003").build();
- User user1 = userProvider.getUser(userID);
- System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] " +
- " UserInfo, ID:" + user1.getID() + ", name:" + user1.getName() + ", sex:" + user1.getSex().toString()
- + ", age:" + user1.getAge() + ", time:" + user1.getTime().toString());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void testGetUserList() throws Exception {
- try {
- UserIDList userIDList = UserIDList.newBuilder().addID("A003").addID("A002").build();
- UserList userList = userProvider.getUserList(userIDList);
- for (User user : userList.getUserList()) {
- System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] " +
- " UserInfo, ID:" + user.getID() + ", name:" + user.getName() + ", sex:" + user.getSex().toString()
- + ", age:" + user.getAge() + ", time:" + user.getTime().toString());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void testGetErr() throws Exception {
- try {
- UserID userID = UserID.newBuilder().setID("A003").build();
- userProvider.getErr(userID);
- } catch (Throwable t) {
- System.out.println("*************exception***********");
- t.printStackTrace();
- }
- }
-
- private void testGetUserByStream() {
- try {
- UserID userID = UserID.newBuilder().setID("A001").build();
- userProvider.getUserByStream(userID, new StreamObserver<User>() {
- @Override
- public void onNext(User user) {
- System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] " +
- " UserInfo, ID:" + user.getID() + ", name:" + user.getName() + ", sex:" + user.getSex().toString()
- + ", age:" + user.getAge() + ", time:" + user.getTime().toString());
- }
-
- @Override
- public void onError(Throwable t) {
- t.printStackTrace();
- }
-
- @Override
- public void onCompleted() {
- System.out.println("Done");
- }
- });
-
- } catch (Exception e) {
- System.out.println("*************exception***********");
- e.printStackTrace();
- }
- }
-}
diff --git a/general/grpc/unary/java-client/src/main/proto/UserService.proto b/general/grpc/unary/java-client/src/main/proto/UserService.proto
deleted file mode 100644
index b187f23..0000000
--- a/general/grpc/unary/java-client/src/main/proto/UserService.proto
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2015 The gRPC Authors
-//
-// Licensed 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.
-syntax = "proto3";
-import public "google/protobuf/timestamp.proto";
-
-option java_multiple_files = true;
-option java_package = "com.ikurento.user";
-option java_outer_classname = "UserProviderProto";
-option objc_class_prefix = "UP";
-
-package helloworld;
-
-// The UserProvider service definition.
-service UserProvider {
- rpc getUser (UserId) returns (User) {}
- rpc getUserList (UserIdList) returns (UserList) {}
- rpc getErr(UserId) returns (User) {}
- rpc getUserByStream(UserId) returns (stream User){}
-}
-
-// The request message containing the user's information.
-message User {
- string id = 1;
- string name = 2;
- int32 age = 3;
- google.protobuf.Timestamp time = 4;
- Gender sex = 5;
-}
-
-enum Gender{
- MAN = 0;
- WOMAN = 1;
-}
-
-message UserId{
- string id = 1;
-}
-
-message UserIdList{
- repeated string id = 1;
-}
-
-message UserList{
- repeated User user = 1;
-}
diff --git a/general/grpc/unary/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml b/general/grpc/unary/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml
deleted file mode 100644
index c2732bc..0000000
--- a/general/grpc/unary/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
-
-
- <!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 -->
- <dubbo:application name="user-info-client" />
- <!-- 连接到哪个本地注册中心 -->
- <dubbo:registry id="ikurento" address="zookeeper://127.0.0.1:2181" />
- <!-- dubbo.registry.address from dubbo.properties -->
- <!-- dubbo:registry address="${dubbo.registry.address}" / -->
-
- <!-- 用dubbo协议在20880端口暴露服务 -->
- <dubbo:protocol id="grpc" name="grpc" />
-
- <!-- 声明需要使用的服务接口 -->
- <dubbo:reference id="userProvider" protocol="grpc" interface="com.ikurento.user.UserProviderGrpc$IUserProvider">
- <!-- dubbo:reference id="userProvider" protocol="dubbo" interface="com.ikurento.user.UserProvider">
- <dubbo:parameter key="heartbeat" value="10000"/ -->
- </dubbo:reference>
-<!-- <dubbo:reference id="userProvider1" protocol="jsonrpc" version="2.0" interface="com.ikurento.user.UserProvider">-->
-<!-- </dubbo:reference>-->
-<!-- <dubbo:reference id="userProvider2" protocol="jsonrpc" version="2.0" group="as" interface="com.ikurento.user.UserProvider">-->
-<!-- </dubbo:reference>-->
-
-</beans>
diff --git a/general/grpc/unary/java-client/src/main/resources/META-INF/spring/service.xml b/general/grpc/unary/java-client/src/main/resources/META-INF/spring/service.xml
deleted file mode 100644
index 1e3c8da..0000000
--- a/general/grpc/unary/java-client/src/main/resources/META-INF/spring/service.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
-
- <bean class="com.ikurento.user.Consumer" init-method="start">
- <!-- 声明这个类 要使用的服务名-->
- <property name="userProvider" ref="userProvider" />
- </bean>
-
- <!-- App config -->
- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="locations">
- <list>
- <value>classpath:dubbo.properties</value>
- </list>
- </property>
- </bean>
-
-</beans>
diff --git a/general/grpc/unary/java-server/build.sh b/general/grpc/unary/java-server/build.sh
deleted file mode 100644
index 7b5755b..0000000
--- a/general/grpc/unary/java-server/build.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-# mvn dependency:sources
-mvn clean package -Dmaven.test.skip
-# mvn -X clean compile package -DskipTests=true
diff --git a/general/grpc/unary/java-server/pom.xml b/general/grpc/unary/java-server/pom.xml
deleted file mode 100644
index 2a9288a..0000000
--- a/general/grpc/unary/java-server/pom.xml
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>com.ikurento</groupId>
- <artifactId>user-info-server</artifactId>
- <packaging>jar</packaging>
- <version>0.2.0</version>
- <description>The demo provider module of dubbo project</description>
- <properties>
- <skip_maven_deploy>false</skip_maven_deploy>
-
- <dubbo-version>2.7.5</dubbo-version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-bom</artifactId>
- <version>${dubbo-version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo</artifactId>
- <version>${dubbo-version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.25</version>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>4.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-recipes</artifactId>
- <version>4.2.0</version>
- </dependency>
- <dependency>
- <groupId>com.github.sgroschupf</groupId>
- <artifactId>zkclient</artifactId>
- <version>0.1</version>
- <exclusions>
- <exclusion>
- <artifactId>org.apache.zookeeper</artifactId>
- <groupId>zookeeper</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>3.4.14</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-netty</artifactId>
- <version>1.19.0</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-netty-shaded</artifactId>
- <version>1.19.0</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-protobuf</artifactId>
- <version>1.19.0</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-stub</artifactId>
- <version>1.19.0</version>
- </dependency>
- <dependency>
- <groupId>io.grpc</groupId>
- <artifactId>grpc-api</artifactId>
- <version>1.24.1</version>
- </dependency>
- </dependencies>
-
- <repositories>
- <repository>
- <id>apache.snapshots.https</id>
- <name>Apache Development Snapshot Repository</name>
- <url>https://repository.apache.org/content/repositories/snapshots</url>
- <layout>default</layout>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>daily</updatePolicy>
- </snapshots>
- </repository>
- <repository>
- <id>sonatype-nexus-snapshots</id>
- <name>Sonatype Nexus Snapshots</name>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>daily</updatePolicy>
- </snapshots>
- </repository>
-
- </repositories>
-
- <build>
- <extensions>
- <extension>
- <groupId>kr.motd.maven</groupId>
- <artifactId>os-maven-plugin</artifactId>
- <version>1.6.1</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.7.0</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.xolstice.maven.plugins</groupId>
- <artifactId>protobuf-maven-plugin</artifactId>
- <version>0.5.1</version>
- <configuration>
- <protocArtifact>com.google.protobuf:protoc:3.7.1:exe:${os.detected.classifier}</protocArtifact>
- <pluginId>dubbo-grpc-java</pluginId>
- <pluginArtifact>org.apache.dubbo:protoc-gen-dubbo-java:1.19.0-SNAPSHOT:exe:${os.detected.classifier}</pluginArtifact>
- <outputDirectory>build/generated/source/proto/main/java</outputDirectory>
- <clearOutputDirectory>false</clearOutputDirectory>
- <pluginParameter>grpc</pluginParameter>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>compile</goal>
- <goal>compile-custom</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>build/generated/source/proto/main/java</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/assembly.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </build>
-
-
-</project>
-
-
diff --git a/general/grpc/unary/java-server/script/debug.sh b/general/grpc/unary/java-server/script/debug.sh
deleted file mode 100644
index 1038cd7..0000000
--- a/general/grpc/unary/java-server/script/debug.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-# jdb -classpath /Users/alex/tmp/us/conf:/Users/alex/tmp/us/lib/*:/Users/alex/test/java/dubbo/2.5.4/dubbo-remoting/dubbo-remoting-api/src/main/java/ com.alibaba.dubbo.container.Main
-jdb -classpath /Users/alex/tmp/us/conf:/Users/alex/tmp/us/lib/* -sourcepath /Users/alex/test/java/dubbo/2.5.4/dubbo-remoting/dubbo-remoting-api/src/main/java/:/Users/alex/tmp/java-server/src/main/java com.alibaba.dubbo.container.Main
-# jdb stop at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec:76
-# run
-
diff --git a/general/grpc/unary/java-server/src/main/assembly/assembly.xml b/general/grpc/unary/java-server/src/main/assembly/assembly.xml
deleted file mode 100644
index 196cb60..0000000
--- a/general/grpc/unary/java-server/src/main/assembly/assembly.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-
-<assembly>
- <id>assembly</id>
- <formats>
- <format>tar.gz</format>
- </formats>
- <includeBaseDirectory>true</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>src/main/assembly/bin</directory>
- <outputDirectory>bin</outputDirectory>
- <fileMode>0755</fileMode>
- <directoryMode>0755</directoryMode>
- </fileSet>
- <fileSet>
- <directory>src/main/assembly/conf</directory>
- <includes>
- <include>dubbo.properties</include>
- <include>log4j.*</include>
- </includes>
- <outputDirectory>conf</outputDirectory>
- <fileMode>0644</fileMode>
- <directoryMode>0755</directoryMode>
- </fileSet>
- </fileSets>
- <dependencySets>
- <dependencySet>
- <outputDirectory>lib</outputDirectory>
- </dependencySet>
- </dependencySets>
-</assembly>
\ No newline at end of file
diff --git a/general/grpc/unary/java-server/src/main/assembly/bin/start.bat b/general/grpc/unary/java-server/src/main/assembly/bin/start.bat
deleted file mode 100644
index 1d274cb..0000000
--- a/general/grpc/unary/java-server/src/main/assembly/bin/start.bat
+++ /dev/null
@@ -1,44 +0,0 @@
-@echo off & setlocal enabledelayedexpansion
-
-REM Licensed to the Apache Software Foundation (ASF) under one or more
-REM contributor license agreements. See the NOTICE file distributed with
-REM this work for additional information regarding copyright ownership.
-REM The ASF licenses this file to You under the Apache License, Version 2.0
-REM (the "License"); you may not use this file except in compliance with
-REM the License. You may obtain a copy of the License at
-REM
-REM http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing, software
-REM distributed under the License is distributed on an "AS IS" BASIS,
-REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-REM See the License for the specific language governing permissions and
-REM limitations under the License.
-
-set LIB_JARS=""
-set VM_ARGS_PERM_SIZE="MaxPermSize"
-set VM_ARGS_METASPACE_SIZE="MaxMetaspaceSize"
-set JAVA_8_VERSION="180"
-cd ..\lib
-for %%i in (*) do set LIB_JARS=!LIB_JARS!;..\lib\%%i
-cd ..\bin
-
-@REM set jvm args by different java version
-for /f tokens^=2-4^ delims^=.-_+^" %%j in ('java -fullversion 2^>^&1') do set "JAVA_VERSION=%%j%%k%%l"
-set VM_ARGS=%VM_ARGS_PERM_SIZE%
-if "%JAVA_VERSION%" GEQ %JAVA_8_VERSION% set VM_ARGS=%VM_ARGS_METASPACE_SIZE%
-if ""%1"" == ""debug"" goto debug
-if ""%1"" == ""jmx"" goto jmx
-
-java -Xms64m -Xmx1024m -XX:%VM_ARGS%=64M -classpath ..\conf;%LIB_JARS% com.ikurento.user.Provider
-goto end
-
-:debug
-java -Xms64m -Xmx1024m -XX:%VM_ARGS%=64M -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -classpath ..\conf;%LIB_JARS% org.apache.dubbo.container.Main
-goto end
-
-:jmx
-java -Xms64m -Xmx1024m -XX:%VM_ARGS%=64M -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -classpath ..\conf;%LIB_JARS% org.apache.dubbo.container.Main
-
-:end
-pause
\ No newline at end of file
diff --git a/general/grpc/unary/java-server/src/main/assembly/bin/start.sh b/general/grpc/unary/java-server/src/main/assembly/bin/start.sh
deleted file mode 100644
index 6343ea2..0000000
--- a/general/grpc/unary/java-server/src/main/assembly/bin/start.sh
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-cd `dirname $0`
-BIN_DIR=`pwd`
-cd ..
-DEPLOY_DIR=`pwd`
-CONF_DIR=$DEPLOY_DIR/conf
-
-SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
-SERVER_PROTOCOL=`sed '/dubbo.protocol.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
-SERVER_HOST=`sed '/dubbo.protocol.host/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
-SERVER_PORT=`sed '/dubbo.protocol.port/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
-LOGS_FILE=`sed '/dubbo.log4j.file/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
-VM_ARGS_PERM_SIZE='PermSize'
-VM_ARGS_METASPACE_SIZE='MetaspaceSize'
-JAVA_8_VERSION="180"
-
-if [ -z "$SERVER_HOST" ]; then
- SERVER_HOST='127.0.0.1'
-fi
-
-if [ -z "$SERVER_NAME" ]; then
- SERVER_NAME=`hostname`
-fi
-
-PIDS=`ps -ef | grep java | grep -v grep | grep "$CONF_DIR" |awk '{print $2}'`
-if [ -n "$PIDS" ]; then
- echo "ERROR: The $SERVER_NAME already started!"
- echo "PID: $PIDS"
- exit 1
-fi
-
-if [ -n "$SERVER_PORT" ]; then
- SERVER_PORT_COUNT=`netstat -tln | grep $SERVER_PORT | wc -l`
- if [ $SERVER_PORT_COUNT -gt 0 ]; then
- echo "ERROR: The $SERVER_NAME port $SERVER_PORT already used!"
- exit 1
- fi
-fi
-
-LOGS_DIR=""
-if [ -n "$LOGS_FILE" ]; then
- LOGS_DIR=`dirname $LOGS_FILE`
-else
- LOGS_DIR=$DEPLOY_DIR/logs
-fi
-if [ ! -d $LOGS_DIR ]; then
- mkdir $LOGS_DIR
-fi
-STDOUT_FILE=$LOGS_DIR/stdout.log
-
-LIB_DIR=$DEPLOY_DIR/lib
-LIB_JARS=`ls $LIB_DIR|grep .jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
-
-JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
-JAVA_DEBUG_OPTS=""
-if [ "$1" = "debug" ]; then
- JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n "
-fi
-JAVA_JMX_OPTS=""
-if [ "$1" = "jmx" ]; then
- JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
-fi
-JAVA_MEM_OPTS=""
-# set jvm args by different java version
-JAVA_VERSION=`java -fullversion 2>&1 | awk -F[\"\.] '{print $2$3$4}' |awk -F"_" '{print $1}'`
-VM_ARGS=${VM_ARGS_PERM_SIZE}
-# if you use dubbo in java 9
-TEMP_VERSION=$(echo ${JAVA_VERSION} | grep "+")
-if [[ "$TEMP_VERSION" != "" ]]; then
- JAVA_VERSION=$(echo ${JAVA_VERSION} | awk -F"+" '{print $1}')
-fi
-# compare java version
-if [ "${JAVA_VERSION}" -ge ${JAVA_8_VERSION} ]; then
- VM_ARGS=${VM_ARGS_METASPACE_SIZE}
-fi
-
-BITS=`java -version 2>&1 | grep -i 64-bit`
-if [ -n "$BITS" ]; then
- JAVA_MEM_OPTS=" -server -Xmx2g -Xms2g -Xmn256m -XX:${VM_ARGS}=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
-else
- JAVA_MEM_OPTS=" -server -Xms1g -Xmx1g -XX:${VM_ARGS}=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
-fi
-
-echo -e "Starting the $SERVER_NAME ...\n"
-echo -e "press any key to exit\n"
-java $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -classpath $CONF_DIR:$LIB_JARS com.ikurento.user.Provider > $STDOUT_FILE 2>&1
-
-COUNT=0
-while [ $COUNT -lt 1 ]; do
- echo -e ".\c"
- sleep 1
- if [ -n "$SERVER_PORT" ]; then
- if [ "$SERVER_PROTOCOL" == "dubbo" ]; then
- COUNT=`(sleep 1; echo -e '\n'; sleep 1; echo status; sleep 1)| telnet $SERVER_HOST $SERVER_PORT | grep -c OK`
- else
- COUNT=`netstat -an | grep $SERVER_PORT | wc -l`
- fi
- else
- COUNT=`ps -ef | grep java | grep -v grep | grep "$DEPLOY_DIR" | awk '{print $2}' | wc -l`
- fi
- if [ $COUNT -gt 0 ]; then
- break
- fi
-done
-
-echo "OK!"
-PIDS=`ps -ef | grep java | grep -v grep | grep "$DEPLOY_DIR" | awk '{print $2}'`
-echo "PID: $PIDS"
-echo "STDOUT: $STDOUT_FILE"
diff --git a/general/grpc/unary/java-server/src/main/assembly/conf/dubbo.properties b/general/grpc/unary/java-server/src/main/assembly/conf/dubbo.properties
deleted file mode 100644
index 83d7e07..0000000
--- a/general/grpc/unary/java-server/src/main/assembly/conf/dubbo.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-; ### dubbo注册中心配置 ##
-; dubbo.container = log4j,spring
-; dubbo.application.name = user-info-server
-; dubbo.application.environment = product
-; dubbo.application.owner = AlexStocks
-; dubbo.registry.address = 127.0.0.1:2181
-; dubbo.registry.protocol = zookeeper
-; dubbo.consumer.timeout = 10000
-; dubbo.provider.timeout = 10000
-; dubbo.protocol.name = jsonrpc
-; dubbo.protocol.port = 10000
-;
-; dubbo.log4j.file = logs/dubbo.log
-; dubbo.log4j.level = INFO
diff --git a/general/grpc/unary/java-server/src/main/assembly/conf/log4j.properties b/general/grpc/unary/java-server/src/main/assembly/conf/log4j.properties
deleted file mode 100644
index 806e33d..0000000
--- a/general/grpc/unary/java-server/src/main/assembly/conf/log4j.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-## Logger configure file for myproject
-log.dir=logs/
-datestamp=yyyy-MM-dd/HH:mm:ss.SSS
-
-log4j.rootLogger=DEBUG, file, console
-
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.threshold=DEBUG
-log4j.appender.file.File=${log.dir}/log4j.log
-log4j.appender.file.DatePattern=-yyyyMMddHH
-log4j.appender.file.ImmediateFlush=true
-log4j.appender.file.Append=true
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=DEBUG
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
-
diff --git a/general/grpc/unary/java-server/src/main/java/com/ikurento/user/Provider.java b/general/grpc/unary/java-server/src/main/java/com/ikurento/user/Provider.java
deleted file mode 100644
index dea1c34..0000000
--- a/general/grpc/unary/java-server/src/main/java/com/ikurento/user/Provider.java
+++ /dev/null
@@ -1,34 +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.ikurento.user;
-
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class Provider {
-
- /**
- * To get ipv6 address to work, add
- * System.setProperty("java.net.preferIPv6Addresses", "true");
- * before running your application.
- */
- public static void main(String[] args) throws Exception {
- ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"META-INF/spring/dubbo.provider.xml"});
- context.start();
- System.in.read(); // press any key to exit
- }
-}
diff --git a/general/grpc/unary/java-server/src/main/java/com/ikurento/user/UserProviderImpl.java b/general/grpc/unary/java-server/src/main/java/com/ikurento/user/UserProviderImpl.java
deleted file mode 100644
index a81a4a8..0000000
--- a/general/grpc/unary/java-server/src/main/java/com/ikurento/user/UserProviderImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.ikurento.user;
-
-import com.google.protobuf.ProtocolStringList;
-import com.google.protobuf.Timestamp;
-import io.grpc.Status;
-import io.grpc.stub.StreamObserver;
-
-
-public class UserProviderImpl extends UserProviderGrpc.UserProviderImplBase {
-
- @Override
- public void getUser(UserId request, io.grpc.stub.StreamObserver<User> responseObserver) {
- String id = request.getId();
- User user = User.newBuilder().setId(id)
- .setTime(Timestamp.getDefaultInstance())
- .setAge(11)
- .setName("Hello")
- .setId(id)
- .build();
- responseObserver.onNext(user);
- responseObserver.onCompleted();
- }
-
- @Override
- public void getUserList(UserIdList request, StreamObserver<UserList> responseObserver){
- ProtocolStringList protocolStringList = request.getIdList();
- UserList.Builder userListBuilder = UserList.newBuilder();
- for (String id : protocolStringList) {
- User user = User.newBuilder().setId(id)
- .setTime(Timestamp.getDefaultInstance())
- .setAge(11)
- .setName("Hello")
- .setId(id)
- .build();
- userListBuilder.addUser(user);
- }
- responseObserver.onNext(userListBuilder.build());
- responseObserver.onCompleted();
- }
-
- @Override
- public void getUserByStream(UserId request, StreamObserver<User> responseObserver){
- String id = request.getId();
- User user1 = User.newBuilder().setId(id)
- .setTime(Timestamp.getDefaultInstance())
- .setAge(11)
- .setName("Hello 1")
- .setId(id)
- .build();
- responseObserver.onNext(user1);
- User user2 = User.newBuilder().setId(id)
- .setTime(Timestamp.getDefaultInstance())
- .setAge(12)
- .setName("Hello 2")
- .setId(id)
- .build();
- responseObserver.onNext(user2);
- responseObserver.onCompleted();
- }
-
-
- @Override
- public void getErr(UserId request, StreamObserver<User> responseObserver){
- try{
- throw new Exception("test error");
- }catch(Exception ex){
- responseObserver.onError(Status.INTERNAL.withCause(ex).asException());
- }
- }
-}
diff --git a/general/grpc/unary/java-server/src/main/proto/UserService.proto b/general/grpc/unary/java-server/src/main/proto/UserService.proto
deleted file mode 100644
index b187f23..0000000
--- a/general/grpc/unary/java-server/src/main/proto/UserService.proto
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2015 The gRPC Authors
-//
-// Licensed 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.
-syntax = "proto3";
-import public "google/protobuf/timestamp.proto";
-
-option java_multiple_files = true;
-option java_package = "com.ikurento.user";
-option java_outer_classname = "UserProviderProto";
-option objc_class_prefix = "UP";
-
-package helloworld;
-
-// The UserProvider service definition.
-service UserProvider {
- rpc getUser (UserId) returns (User) {}
- rpc getUserList (UserIdList) returns (UserList) {}
- rpc getErr(UserId) returns (User) {}
- rpc getUserByStream(UserId) returns (stream User){}
-}
-
-// The request message containing the user's information.
-message User {
- string id = 1;
- string name = 2;
- int32 age = 3;
- google.protobuf.Timestamp time = 4;
- Gender sex = 5;
-}
-
-enum Gender{
- MAN = 0;
- WOMAN = 1;
-}
-
-message UserId{
- string id = 1;
-}
-
-message UserIdList{
- repeated string id = 1;
-}
-
-message UserList{
- repeated User user = 1;
-}
diff --git a/general/grpc/unary/java-server/src/main/resources/META-INF/spring/dubbo.provider.xml b/general/grpc/unary/java-server/src/main/resources/META-INF/spring/dubbo.provider.xml
deleted file mode 100644
index 136ea8d..0000000
--- a/general/grpc/unary/java-server/src/main/resources/META-INF/spring/dubbo.provider.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed 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.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
-
- <!-- 应用名 -->
- <dubbo:application name="user-info-server"/>
- <!-- 连接到哪个本地注册中心 -->
- <dubbo:registry id="ikurento" address="zookeeper://127.0.0.1:2181" />
-<!-- <dubbo:registry id="ikurento2" address="zookeeper://127.0.0.1:2181" />-->
- <!-- 用dubbo协议在20880端口暴露服务 -->
- <!-- dubbo:protocol host="127.0.0.1" / -->
- <dubbo:protocol id="grpc" name="grpc" host="127.0.0.1" port="20010" />
-<!-- <dubbo:protocol id="jsonrpc" name="jsonrpc" host="127.0.0.1" port="10010" />-->
- <!-- 声明需要暴露的服务接口 -->
- <dubbo:service registry="ikurento" timeout="3000" interface="com.ikurento.user.UserProviderGrpc$IUserProvider" ref="demoService"/>
-<!-- <dubbo:service registry="ikurento" timeout="3000" interface="com.ikurento.user.UserProvider" ref="otherService" version="2.0"/>-->
-<!-- <dubbo:service registry="ikurento" timeout="3000" interface="com.ikurento.user.UserProvider" ref="otherService" group="as" version="2.0"/>-->
-
- <bean id="demoService" class="com.ikurento.user.UserProviderImpl" />
-<!-- <bean id="otherService" class="com.ikurento.user.UserProviderAnotherImpl"/>-->
-
-</beans>
diff --git a/general/grpc/unary/java-server/src/main/resources/log4j.properties b/general/grpc/unary/java-server/src/main/resources/log4j.properties
deleted file mode 100644
index 806e33d..0000000
--- a/general/grpc/unary/java-server/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-## Logger configure file for myproject
-log.dir=logs/
-datestamp=yyyy-MM-dd/HH:mm:ss.SSS
-
-log4j.rootLogger=DEBUG, file, console
-
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.threshold=DEBUG
-log4j.appender.file.File=${log.dir}/log4j.log
-log4j.appender.file.DatePattern=-yyyyMMddHH
-log4j.appender.file.ImmediateFlush=true
-log4j.appender.file.Append=true
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=DEBUG
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
-