diff --git a/docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/gatewayfilter-factories/jsontogrpc-factory.adoc b/docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/gatewayfilter-factories/jsontogrpc-factory.adoc index b5ce622e1..229bb8a89 100644 --- a/docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/gatewayfilter-factories/jsontogrpc-factory.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/gatewayfilter-factories/jsontogrpc-factory.adoc @@ -3,6 +3,53 @@ The JSONToGRPC GatewayFilter Factory converts a JSON payload to a gRPC request. +[[jsontogrpc-dependencies]] +== Required Dependencies + +The `JsonToGrpc` filter depends on several optional libraries that are *not* included by default. +You must add them explicitly to your project: + +.Maven +[source,xml] +---- + + tools.jackson.dataformat + jackson-dataformat-protobuf + + + io.grpc + grpc-netty + + + io.grpc + grpc-protobuf + + + io.grpc + grpc-stub + + + com.google.protobuf + protobuf-java-util + +---- + +.Gradle +[source,groovy] +---- +implementation 'tools.jackson.dataformat:jackson-dataformat-protobuf' +implementation 'io.grpc:grpc-netty' +implementation 'io.grpc:grpc-protobuf' +implementation 'io.grpc:grpc-stub' +implementation 'com.google.protobuf:protobuf-java-util' +---- + +[WARNING] +==== +If any of these dependencies are missing you will see a `NoClassDefFoundError` at runtime (for example, `com/fasterxml/jackson/dataformat/protobuf/ProtobufFactory`) when a request hits the route. +The versions are managed by the Spring Cloud Gateway BOM, so no version attributes are needed when using the BOM. +==== + The filter takes the following arguments: * `service`: Short name of the service that handles the request.