Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade GRPC version due to new feature introduced in 1.40.0 version. #583

Merged
merged 6 commits into from Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/client/configuration.md
Expand Up @@ -75,7 +75,7 @@ There are a number of supported schemes, that you can use to determine the targe
The self address or scheme is a keyword that is available, if you also use `grpc-server-spring-boot-starter` and
allows you to connect to the server without specifying the own address/port. This is especially useful for tests
where you might want to use random server ports to avoid conflicts. \
Example: `self` or `self:self`
Example: `self:self`
- `in-process`: \
This is a special scheme that will bypass the normal channel factory and will use the `InProcessChannelFactory`
instead. Use it to connect to the [`InProcessServer`](../server/configuration.md#enabling-the-inprocessserver). \
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/client/configuration.md
Expand Up @@ -45,7 +45,7 @@ grpc.client.__name__.address=static://localhost:9090
- `static`(优先级 4): 一个简单的IP静态列表 (v4 和 v6), 可用于连接到服务端 (支持 `localhost`)。 例如:`static://192.168.1:8080,10.0.0.1:1337`
- [`dns`](https://github.com/grpc/grpc-java/blob/master/core/src/main/java/io/grpc/internal/DnsNameResolver.java#L66)(优先级 5):解析并绑定到给定 DNS 名称的所有地址。 地址将被缓存,只有当现有连接被关闭 / 失败时才会刷新。 更多选项,例如 `SVC` 查找(对 kubernetes 有用),可以通过系统属性启用。 例如:`dns:///example.my.company`
- `discovery` (优先级 6):(可选) 使用 Spring Cloud 的`DiscoveryClient` 去查找合适的目标。 在 `HeartbeatEvent` 的时候,连接将自动刷新。 使用 `gRPC_port` 元数据来确定端口,否则使用服务端口。 示例: `discovery:///service-name`
- `self`(优先级 0):如果您使用 `grpc-server-spring-boot-starter` 并且不想指定自己的地址 / 端口,则可以使用 self 关键词作为 scheme 或者 address 。 这对于需要使用随机服务器端口以避免冲突的测试特别有用。 例如:`self`或`self:self`
- `self`(优先级 0):如果您使用 `grpc-server-spring-boot-starter` 并且不想指定自己的地址 / 端口,则可以使用 self 关键词作为 scheme 或者 address 。 这对于需要使用随机服务器端口以避免冲突的测试特别有用。 例如:`self:self`
- `in-process`:这是一个特殊的方案,将使用 `InProcessChannelFactory` 来替代原有正常的 ChannelFactory。 并使用它连接到 [`InProcessServer`](../server/configuration.md#enabling-the-inprocessserver)。 例如:`in-process:foobar`
- *custom*: 您可以通过 Java 的 `ServiceLoader` 或从 Spring 的应用上下文中选择要自定义的 [`NameResolverProvider`](https://javadoc.io/page/io.grpc/grpc-all/latest/io/grpc/NameResolverProvider.html) ,并将其注册到 `NameResolverRegistry` 上.

Expand Down
Expand Up @@ -50,7 +50,7 @@ public SelfNameResolverFactory(final GrpcServerProperties properties) {

@Override
public NameResolver newNameResolver(final URI targetUri, final Args args) {
if (SELF_SCHEME.equals(targetUri.getScheme()) || targetUri.toString().equals(SELF_SCHEME)) {
if (SELF_SCHEME.equals(targetUri.getScheme())) {
return new SelfNameResolver(this.properties, args);
}
return null;
Expand Down
Expand Up @@ -48,10 +48,10 @@ public class SelfNameResolverConnectionTest {

private static final Empty EMPTY = Empty.getDefaultInstance();

@GrpcClient("self")
@GrpcClient("self:self")
luankevinferreira marked this conversation as resolved.
Show resolved Hide resolved
private TestServiceBlockingStub selfStub;

@GrpcClient("other")
@GrpcClient("self:other")
private TestServiceBlockingStub otherStub;
luankevinferreira marked this conversation as resolved.
Show resolved Hide resolved

/**
Expand Down