Commit Graph

149 Commits

Author SHA1 Message Date
Dave Syer
bca2eff2b0 Upgrade grpc-java to 1.69.0 2025-01-06 16:30:51 +00:00
Dave Syer
e0a744ba25 Add stack walker to discover main class 2025-01-06 15:15:23 +00:00
Andrey Litvitski
ddef9007af Disable in-process transport by default and add @AutoConfigureInProcessTransport annotation 2025-01-06 14:07:04 +00:00
Dave Syer
f8c6070eaa Upgrade Spring Boot to latest 2025-01-06 11:23:52 +00:00
Chris Bono
81990f0fd6 Use channel factory API w/o customizer in tests 2025-01-03 22:04:28 +00:00
Chris Bono
b08e11ad39 Improve channel factory API
This commit improves the GrpcChannelFactory createChannel API by
introducing `ChannelBuilderOptions` that can be specified during
channel creation.

Additionally, concrete Netty channel factory implementations have
been added as well as adding type to the GrpcChannelBuilderCustomizer
which helps match customizers to channel factories.
2025-01-03 22:04:28 +00:00
Dave Syer
b3271be918 Add explicit support for running on separate port
If the user wants a second port for gRPC that should be possible
(and was the only way with the old ecosystem projects). This change
adds a webflux sample and support for
spring.grpc.server.{servlet,reactive}.enabled to be explicitly
"false" to disable the embedded services.

N.B. embedded services are not yet supported in webflux so the flag
has no effect, except to disable gRPC completely if it is "true".
2024-12-23 15:02:45 +00:00
Dave Syer
133bfec5e5 Upgrade Spring Boot in sample 2024-12-23 11:30:09 +00:00
Dave Syer
0cf50bde36 Upgrade netty to same version as Boot 2024-12-23 11:05:38 +00:00
Dave Syer
e979a13ecf Add config for new protoc versions 2024-12-20 14:41:03 +00:00
Dave Syer
8b91ebd86a Tidy up README 2024-12-20 14:40:34 +00:00
Josh Long
780f8e61ea Add more detailed getting started to readme 2024-12-20 14:30:49 +00:00
Jonas Bjørge Andersen
4149ed552e Add autoconfiguration for client side observation interceptor
[resolves #51]

Signed-off-by: Jonas Bjørge Andersen <dev@jonasandersen.no>
2024-12-20 08:00:47 +00:00
Chris Bono
a21748aba2 Add autoconfiguration guard on GrpcServlet
This commit adds a guard on the Servlet gRPC server auto-configuration
to ensure that the `io.grpc:grpc-servlet-jakarta` lib is on the classpath.

Resolves #83

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-20 07:22:09 +00:00
Andrey Litvitski
8628aa1c8a Prevent duplicate entries in channels map
Prevents duplicate entries from being added to the named channels map
in client properties.  

Resolves #67
2024-12-19 10:33:25 -06:00
Moritz Halbritter
729940d62c Manage version of com.google.protobuf:protoc 2024-12-16 15:22:46 +00:00
Dave Syer
e63ed35edf Upgrade to Spring Boot 3.4.0 2024-12-16 11:20:53 +00:00
Dave Syer
560ffdb381 Run test app over TCP not in-process 2024-12-16 11:18:39 +00:00
Dave Syer
413ab2e8a0 Remove unused annotation 2024-12-06 08:39:21 +00:00
Chris Bono
9b170851d1 Split client interceptor autoconfiguration
This commit extracts the client interceptors configuration portion
out of the client autoconfiguration so that the testing module
autoconfiguration can also import the client interceptors
configuration directly.

Resolves #73

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-05 08:02:25 +00:00
Chris Bono
9dbe763932 Fix config props defaults and descriptions
This commit simplifies the client properties by setting the default values
directly on the properties and removes markdown from the property javadocs.
This improves end user experience by adding default values and descriptions
to the generated config props docs.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-05 06:51:19 +00:00
Dave Syer
acbe334b7e Refine config properties for default channel
Because of https://github.com/spring-projects/spring-boot/issues/43352
there's no point having a "default" entry in the channels map.
2024-12-04 09:56:39 +00:00
Chris Bono
5c0ca7056c Add client interceptors to channel factory
This commit adds support for global and channel-specific client
interceptors.

Resolves #52

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-01 21:01:08 +00:00
Chris Bono
bfa54f9423 Move client properties customizer to upper level
This commit moves the client properties customizer from an inner class
to its own top-level class to make it easier to test and for readability.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-01 17:57:41 +00:00
Chris Bono
62499c8be2 Rename client configurer to customizer
This commit renames the GrpcChannelConfigurer to GrpcChannelBuilderCustomizer
to more accurately represent its purpose and for consistency with the
server-side terminology.

Additionally, a new `What's new?` doc is added to list breaking changes between
versions.

See #52

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-01 17:57:41 +00:00
Chris Bono
17b8e9204c Move bean lookup utils into common package
This commit moves the `ApplicationContextBeanLookupUtils` into the
'internal' package and opens up its method to public visibility so
that it can be shared amongst framework components.

See #52

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-12-01 17:57:41 +00:00
Dave Syer
7f4cac0381 Back to snapshots 2024-11-28 15:37:42 +00:00
Dave Syer
b273d8e83a Bump to 0.2.0 2024-11-28 14:30:09 +00:00
Dave Syer
02ef2e25b3 Try to make test less likely to fail 2024-11-28 13:39:27 +00:00
Chris Bono
e0199dd130 Add client side health feature
This commit adds health auto-configuration to the client.

See #66

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-28 10:53:03 +00:00
Chris Bono
9374bdf93f Add docs for health feature
This commit adds docs for the server-side portion of the health feature.

See #56

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-26 17:28:41 +00:00
Chris Bono
6e154d53eb Add actuator health check adapter
This commit adds the implementation to the previously added skeleton
ActuatorHealthAdapter. On a configurable schedule, the adapter takes
a configured list of Actuator health indicators and gets their current
status and maps it into the gRPC HealthStatusManager.

See #56

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-25 07:47:57 +00:00
Chris Bono
b7b43cb6a3 Add property guard on Actuator health adapter
This commit adds a ConditionalOnProperty on the Actuator health
adapter autoconfiguration to allow users to disable only that
part of the health system.

Also, unrelated, the generated configprops with their default values.

See #56

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-25 07:47:57 +00:00
Chris Bono
592d29d3b3 Move health autoconfig into health package
This commit moves the health autoconfiguration into its own
package as well as moves the ActuatorHealthAdapter into its
own class.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-25 07:47:57 +00:00
Dave Syer
e33863992b Add some docs 2024-11-21 16:12:23 +00:00
Dave Syer
3feca42834 Move exception handling into autoconfiguration 2024-11-21 16:03:52 +00:00
Dave Syer
c239cfe970 Add sample and integration test 2024-11-21 15:24:44 +00:00
Chris Bono
f97487c768 Replace junit assertThrows w/ AssertJ assertThatExceptionOfType
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-21 08:19:22 +00:00
Chris Bono
ab55182304 Add autoconfiguration for server-side health
This commit autoconfigures the gRPC health service by providing
the following beans:

- gRPC HealthStatusManager
- gRPC HealthService
- Actuator health check adapter (skeleton impl)

See #56

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-21 08:19:22 +00:00
Dave Syer
2df6c37bb5 Only one inprocess server, so it can have a fixed name 2024-11-19 13:15:32 +00:00
Dave Syer
9e6c27eda6 Tidy up conditions for servlet and inprocess 2024-11-19 13:11:37 +00:00
Dave Syer
6b4f649712 Make inprocess server the default in tests 2024-11-19 12:53:25 +00:00
Dave Syer
796bcf560f Add inprocess factories and a test 2024-11-19 09:45:13 +00:00
Dave Syer
0dc3249251 Allow GrpcServerFactory to return null 2024-11-19 08:41:13 +00:00
Chris Bono
8eb623e82d Add server interceptor blending
This commit implements the `@GprcService(blendWithGlobalInterceptors)`
feature. This allows global and per-service server interceptors to be
combined into a single list and then finally sorted (i.e. blended).

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-18 06:55:49 +00:00
Chris Bono
e3d58cf988 Move some components into core module
This commit moves several components into the core module
from the autoconfiguration module. Anything that exists
in the AC module will ultimately end up in Spring Boot
project assuming we move into Spring Boot in the future.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-15 07:49:54 +00:00
Chris Bono
d629f9f547 Add autoconfig processor to improve startup time
This commit adds the Spring Boot autoconfiguration processor to generate
the `META-INF/spring-autoconfigure-metadata.properties`,which will improve
startup time.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-15 07:49:16 +00:00
Chris Bono
3178518433 Use specific bean types in autoconfiguration
This commit uses the most specific bean type in the autoconfiguration to
improve AOT compatibility.

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-15 07:48:53 +00:00
Chris Bono
c930bc799f Add auto-configuration test for configurer
Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-14 15:04:19 +00:00
Chris Bono
cd28b69756 Add support for service specific server interceptors
This commit introduces the `@GrpcService` annotation which can be used to
associate one or more `ServerInterceptor` beans with a `BindableService`.

See #5

Signed-off-by: Chris Bono <chris.bono@gmail.com>
2024-11-14 15:04:19 +00:00