116 Commits

Author SHA1 Message Date
Dave Syer
ced5936c02 Fix status trailers in exception handler 2025-06-12 13:54:33 +01:00
Chris Bono
171f2556df Fixes to allow non-test inprocess channels
- Fix @LocalGrpcPort to ignore the inprocess factory port
- Don't set load balancer policy for inprocess channel factory

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-06-09 16:01:38 +01:00
Chris Bono
a087eac776 Add support for in-process outside of tests
This commit allows the usage of inprocess server and channel factories
outside of tests.

Resolves #144

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-06-09 16:01:38 +01:00
Dave Syer
f1b8bfacb4 Merge two classes into one
Fixes gh-166
2025-05-29 13:13:32 +01:00
Dave Syer
8c27fe8ab7 Remove GrpcClientFactoryCustomizer
Existing APIs for customizing channel creation can be used instead.
2025-05-29 13:05:04 +01:00
Dave Syer
2edb857dfc SimpleStubFactory has to be more precise about supports() 2025-05-17 08:38:35 +01:00
Dave Syer
c6f765e507 Fix method name in BlockingV2StubFactory
Plus add a test.
2025-05-16 16:43:20 +01:00
Alexey Genus
6403bd96fa Implement CoroutineStubFactory
Signed-off-by: Alexey Genus <genus.alexey@gmail.com>
2025-05-16 09:20:44 +01:00
Dave Syer
7de96df5bd Default factory for stubs when scanning as documented
Also add failing test. Fixes #172.
2025-05-16 08:42:10 +01:00
Thomas McKernan
bd70fcd69f add GrpcExceptionHandledServerCall to catch exceptions
Signed-off-by: Thomas McKernan <tmeaglei@gmail.com>
2025-05-15 17:08:16 +01:00
Dave Syer
8f706665df Change contract of StubFactory
Instead of an instance method we now use a static supports() method
to determine if a factory matches a given stub type. This is better
for the lifecycle since bean definitions have to be created before
and factory can actually be created and autowired.

It's a slightly unusual contract, but it makes it much harder to
make a mistake with lifecycle, and much easier to install custom
StubFactory instances (as @Beans)
2025-05-12 17:18:59 +01:00
Dave Syer
08957115bd Support for static supports() method in StubFactory 2025-05-09 09:19:38 +01:00
Dave Syer
db2f5fa165 Only add client beans if factory supported 2025-05-08 17:43:37 +01:00
Dave Syer
9fe003c6d1 Allow StubFactory to be configured in application 2025-05-08 16:41:35 +01:00
Dave Syer
7911f3f57e Revert to snapshots 2025-04-25 15:55:29 +01:00
Dave Syer
5f7447c9db 0.8.0 release 2025-04-25 15:42:35 +01:00
Dave Syer
8b9fc7757d Fix bug in exception interceptor 2025-04-25 15:24:41 +01:00
Dave Syer
eb82d462e9 Rename explicit references to github org 2025-04-23 10:51:55 +01:00
Dave Syer
3176c7bc50 Revert to snapshots 2025-04-16 08:20:42 +01:00
Dave Syer
c357502aa4 Bump to 0.7.0 2025-04-16 07:39:50 +01:00
Tran Ngoc Nhan
32f2c75d09 Fix typo javadoc
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-04-07 09:35:19 +01:00
Dave Syer
61c16aadd8 Revert to snapshots 2025-04-05 10:06:52 +01:00
Dave Syer
495934ab28 Bump to 0.6.0 2025-04-04 17:54:59 +01:00
Dave Syer
a3d7ba643d Split bean registration and creation for stubs
GrpcClientRegistry was responsible for both, which causes lifecycle
issues when users don't follow recommendations. This change
pushes the bean registration firmly down a level into an
ImportBeanDefinitionRegistrar. Also helps with AOT because the AOT
processor only runs the IBDR at build time.
2025-04-03 12:09:23 +01:00
Dave Syer
326c075b36 Ensure only one client is created by default 2025-04-03 11:33:45 +01:00
Dave Syer
97ba123fbf Add composite pattern to GrpcChannelBuilderCustomizer 2025-04-03 09:01:46 +01:00
Dave Syer
3f709fd9f4 Change method signature for exception handler 2025-04-02 17:26:36 +01:00
Dave Syer
60dac75874 Don't use supplier for customizer 2025-03-28 11:37:53 +00:00
Dave Syer
055688a533 Ensure @Import works with 1 or many 2025-03-27 17:36:46 +00:00
Dave Syer
8b26b8f262 Rename annotation to mirror Spring HTTP interfaces 2025-03-26 08:30:01 +00:00
Dave Syer
55bd93958a Rename client annotations 2025-03-26 08:23:11 +00:00
Dave Syer
6bb10ab65e Add a test and check for direct onErrorMap 2025-03-26 08:19:41 +00:00
Dave Syer
5d1b0e78fc Add a test and check for direct onErrorMap 2025-03-26 08:18:38 +00:00
Dave Syer
582b59a7a6 Add registrar to autoconfig 2025-03-25 07:11:24 +00:00
Dave Syer
fce479bc36 Add a bean post processor for reactive stubs
Fixes gh-143
2025-03-25 06:57:12 +00:00
Sergei Batsura
b004ba6559 Added defaultDeadline client property
Signed-off-by: Sergei Batsura <batsura.sa@gmail.com>
[resolves #136]
2025-03-13 12:36:20 +00:00
Dave Syer
fe2509d1ac Revert to snapshots 2025-03-10 10:25:10 +00:00
Dave Syer
630e776158 Bump to 0.5.0 2025-03-10 09:09:29 +00:00
Dave Syer
d8995bb59a Add support for @EnableGrpcClients
Automatic bean definition registration for stubs

Fixes #91
2025-03-07 08:56:30 +00:00
Dave Syer
b423429b8f Revert to snapshot 2025-03-03 12:47:03 +00:00
Dave Syer
28a2c58f78 Bump to 0.4.0
There are some version management issues with 0.3.0 so we
need a release to catch up with changes in Boot.
2025-03-03 09:45:48 +00:00
Dave Syer
3047c27f9c Add (temporarily) some native image metadata
Still waiting for
https://github.com/oracle/graalvm-reachability-metadata/pull/593
2025-03-03 09:13:28 +00:00
Dave Syer
6853d2dad4 There may be more than one security configuration
In an app with servlets *and* a native gRPC server for instance,
the global AuthenticationManagerBuilder (the @Bean) should be
treated as a parent for the one used by GrpcSecurity. It's the
same in HttpSecurity. Slightly more complicated than necessary
when there is only native gRPC security, but at least it now
works, and makes it easier to introduce multiple GrpcSecurity
instances in future if necessary (like with HttpSecurity it
could be a prototype).
2025-02-24 16:23:43 +00:00
Andrey Litvitski
8d20f4a6d9 Fix typo in pom.xml in core module
Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2025-02-15 11:20:59 -06:00
Chris Bono
b65c03d1c5 Fix pom.xml indentation issues from previous commits
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
2bd167e985 Add client starter module
This adds a starter module that includes the Spring gRPC
core module and the grpc-stub dependency.

Also, makes the `grpc-stub` dependency optional in Spring
gRPC core module.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
98d744fd6b Remove opinion on Netty from core module
Currently the spring-grpc-core imposes an opinion on Netty.
The core module should not have an opinion, but rather the
starter enforces the opinion.

Also, makes spring-grpc-core optional in the autconfigure
module as the autoconfigure will eventually be moved into
Spring Boot and at that time everything is optional.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Chris Bono
06adbaa26d Add explicit io.grpc:grpc-core dependency
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2025-02-12 10:09:45 -06:00
Dave Syer
1b09b7b23c Shutdown channel in tests
Fixes #47
2025-02-07 12:31:48 +00:00
Dave Syer
d6c0298ae0 Prevent call from proceeding if it fails in onReady() 2025-02-07 11:13:20 +00:00