Skip to content

Commit

Permalink
Merge branch 'master' into actuator-healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
yidongnan authored Oct 27, 2024
2 parents 66d7420 + 48073ab commit f2c458e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['17']
java: ['17', '21']
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['17']
java: ['17', '21']
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}
}
ext {
projectVersion = '3.1.0.RELEASE'
projectVersion = '3.2.0-SNAPSHOT'

// https://github.com/grpc/grpc-java/releases
grpcVersion = '1.63.0'
Expand Down
8 changes: 4 additions & 4 deletions deploy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ publishing {
pom {
name = 'gRPC Spring Boot Starter'
description = 'gRPC Spring Boot Starter'
url = 'https://github.com/yidongnan/grpc-spring-boot-starter'
url = 'https://github.com/grpc-ecosystem/grpc-spring'
licenses {
license {
name = 'Apache 2.0'
Expand All @@ -50,9 +50,9 @@ publishing {
}
}
scm {
connection = 'scm:git:git://github.com/yidongnan/grpc-spring-boot-starter.git'
developerConnection = 'scm:git:[email protected]:yidongnan/grpc-spring-boot-starter.git'
url = 'https://github.com/yidongnan/grpc-spring-boot-starter'
connection = 'scm:git:git://github.com/grpc-ecosystem/grpc-spring.git'
developerConnection = 'scm:git:[email protected]/grpc-ecosystem/grpc-spring.git'
url = 'https://github.com/grpc-ecosystem/grpc-spring'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ List<GrpcChannelConfigurer> defaultChannelConfigurers() {
return Collections.emptyList();
}

// First try the shaded netty channel factory
// First try the shaded netty channel factory and in process factory
@ConditionalOnMissingBean(GrpcChannelFactory.class)
@ConditionalOnClass(name = {"io.grpc.netty.shaded.io.netty.channel.Channel",
"io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder"})
"io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder", "io.grpc.inprocess.InProcessChannelBuilder"})
@Bean
@Lazy
GrpcChannelFactory shadedNettyGrpcChannelFactory(
GrpcChannelFactory inProcessOrShadedNettyGrpcChannelFactory(
final GrpcChannelsProperties properties,
final GlobalClientInterceptorRegistry globalClientInterceptorRegistry,
final List<GrpcChannelConfigurer> channelConfigurers) {
Expand All @@ -162,12 +162,13 @@ GrpcChannelFactory shadedNettyGrpcChannelFactory(
return new InProcessOrAlternativeChannelFactory(properties, inProcessChannelFactory, channelFactory);
}

// Then try the normal netty channel factory
// Then try the normal netty channel factory and in process factory
@ConditionalOnMissingBean(GrpcChannelFactory.class)
@ConditionalOnClass(name = {"io.netty.channel.Channel", "io.grpc.netty.NettyChannelBuilder"})
@ConditionalOnClass(name = {"io.netty.channel.Channel", "io.grpc.netty.NettyChannelBuilder",
"io.grpc.inprocess.InProcessChannelBuilder"})
@Bean
@Lazy
GrpcChannelFactory nettyGrpcChannelFactory(
GrpcChannelFactory inProcessOrNettyGrpcChannelFactory(
final GrpcChannelsProperties properties,
final GlobalClientInterceptorRegistry globalClientInterceptorRegistry,
final List<GrpcChannelConfigurer> channelConfigurers) {
Expand All @@ -180,8 +181,38 @@ GrpcChannelFactory nettyGrpcChannelFactory(
return new InProcessOrAlternativeChannelFactory(properties, inProcessChannelFactory, channelFactory);
}

// Then try the shaded netty channel factory
@ConditionalOnMissingBean(GrpcChannelFactory.class)
@ConditionalOnClass(name = {"io.grpc.netty.shaded.io.netty.channel.Channel",
"io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder"})
@Bean
@Lazy
GrpcChannelFactory shadedNettyGrpcChannelFactory(
final GrpcChannelsProperties properties,
final GlobalClientInterceptorRegistry globalClientInterceptorRegistry,
final List<GrpcChannelConfigurer> channelConfigurers) {

log.info("Detected grpc-netty-shaded: Creating ShadedNettyChannelFactory");
return new ShadedNettyChannelFactory(properties, globalClientInterceptorRegistry, channelConfigurers);
}

// Then try the normal netty channel factory
@ConditionalOnMissingBean(GrpcChannelFactory.class)
@ConditionalOnClass(name = {"io.netty.channel.Channel", "io.grpc.netty.NettyChannelBuilder"})
@Bean
@Lazy
GrpcChannelFactory nettyGrpcChannelFactory(
final GrpcChannelsProperties properties,
final GlobalClientInterceptorRegistry globalClientInterceptorRegistry,
final List<GrpcChannelConfigurer> channelConfigurers) {

log.info("Detected grpc-netty: Creating NettyChannelFactory");
return new NettyChannelFactory(properties, globalClientInterceptorRegistry, channelConfigurers);
}

// Finally try the in process channel factory
@ConditionalOnMissingBean(GrpcChannelFactory.class)
@ConditionalOnClass(name = {"io.grpc.inprocess.InProcessChannelBuilder"})
@Bean
@Lazy
GrpcChannelFactory inProcessGrpcChannelFactory(
Expand Down

0 comments on commit f2c458e

Please sign in to comment.