@@ -119,11 +119,10 @@ the channels, stubs and other components without losing the features provided by
119
119
120
120
### GrpcClientBean
121
121
122
- This should significantly help with `` @Autowire `` and `` @Qualifier `` because default annotation`` @GrpcClient `` is
123
- not designed for usage with spring 'injection' annotations.
124
- `` @GrpcClientBean `` require annotation `` @Cofiguration `` or inherited, for example `` @TestConfiguraiton `` .
125
- It is definitely not recommended using `` @GrpcClientBean `` and field annotated with `` @GrpcClient `` for same
126
- configuration class, but it`s still possible.
122
+ This should significantly help with ` @Autowire ` and ` @Qualifier ` because default annotation ` @GrpcClient ` is
123
+ not designed for usage with spring 'injection' annotations. ` @GrpcClientBean ` require annotation ` @Cofiguration ` .
124
+ It is definitely not recommended using ` @GrpcClientBean ` and field annotated with ` @GrpcClient ` for same
125
+ configuration class, but it's still possible.
127
126
128
127
```` java
129
128
@Configuration
@@ -135,7 +134,7 @@ configuration class, but it`s still possible.
135
134
public static class YourCustomConfiguration {
136
135
137
136
@Bean
138
- FoobarService (@Autowired TestServiceGrpc .TestServiceBlockingStub blockingStub ) {
137
+ FoobarService foobarService (@Autowired TestServiceGrpc .TestServiceBlockingStub blockingStub ) {
139
138
return new FoobarService (blockingStub);
140
139
}
141
140
}
@@ -151,31 +150,30 @@ public class FoobarService {
151
150
.build();
152
151
return blockingStub. sayHello(request). getMessage();
153
152
}
154
-
155
153
}
156
154
````
157
155
158
156
### GrpcClientBeans
159
157
160
- `` @GrpcClientBeans ` ` designed for registration multiple stubs to the spring context from single configuration class.
158
+ ` @GrpcClientBeans ` designed for registration multiple stubs to the spring context from single configuration class.
161
159
162
160
```` java
163
- @Configuration
164
- @GrpcClientBeans (value = {
165
- @GrpcClientBean (
166
- clazz = TestServiceGrpc . TestServiceBlockingStub . class,
167
- beanName = " blockingStub" ,
168
- client = @GrpcClient (" test" )),
169
- @GrpcClientBean (
170
- clazz = TestServiceGrpc . FactoryMethodAccessibleStub . class,
171
- beanName = " accessibleStub" ,
172
- client = @GrpcClient (" test" ))
173
- })
174
- public static class YourCustomConfiguration {
161
+ @Configuration
162
+ @GrpcClientBeans (value = {
163
+ @GrpcClientBean (
164
+ clazz = TestServiceGrpc . TestServiceBlockingStub . class,
165
+ beanName = " blockingStub" ,
166
+ client = @GrpcClient (" test" )),
167
+ @GrpcClientBean (
168
+ clazz = TestServiceGrpc . FactoryMethodAccessibleStub . class,
169
+ beanName = " accessibleStub" ,
170
+ client = @GrpcClient (" test" ))
171
+ })
172
+ public static class YourCustomConfiguration {
175
173
176
174
@Bean
177
- FoobarService (@Autowired TestServiceGrpc .TestServiceBlockingStub blockingStub ,
178
- @Autowired TestServiceGrpc .FactoryMethodAccessibleStub accessibleStub ) {
175
+ FoobarService foobarService (@Autowired TestServiceGrpc .TestServiceBlockingStub blockingStub ,
176
+ @Autowired TestServiceGrpc .FactoryMethodAccessibleStub accessibleStub ) {
179
177
return new FoobarService (blockingStub, accessibleStub);
180
178
}
181
179
}
@@ -200,7 +198,6 @@ public class FoobarService {
200
198
.build();
201
199
return accessibleStub. sayHi(request). getMessage();
202
200
}
203
-
204
201
}
205
202
````
206
203
0 commit comments