Class JsonToGrpcGatewayFilterFactory
- java.lang.Object
-
- org.springframework.cloud.gateway.support.AbstractConfigurable<C>
-
- org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory<JsonToGrpcGatewayFilterFactory.Config>
-
- org.springframework.cloud.gateway.filter.factory.JsonToGrpcGatewayFilterFactory
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,GatewayFilterFactory<JsonToGrpcGatewayFilterFactory.Config>
,Configurable<JsonToGrpcGatewayFilterFactory.Config>
,ShortcutConfigurable
,org.springframework.context.ApplicationEventPublisherAware
public class JsonToGrpcGatewayFilterFactory extends AbstractGatewayFilterFactory<JsonToGrpcGatewayFilterFactory.Config>
This filter takes a JSON payload, transform it into a protobuf object, send it to a given gRPC channel, and transform the response back to JSON. Making it transparent for the consumer that the service under the gateway is a gRPC one.- Author:
- Alberto C. RĂos
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JsonToGrpcGatewayFilterFactory.Config
-
Nested classes/interfaces inherited from class org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory
AbstractGatewayFilterFactory.NameConfig
-
Nested classes/interfaces inherited from interface org.springframework.cloud.gateway.support.ShortcutConfigurable
ShortcutConfigurable.GatewayEvaluationContext, ShortcutConfigurable.RestrictivePropertyAccessor, ShortcutConfigurable.ShortcutType
-
-
Field Summary
-
Fields inherited from interface org.springframework.cloud.gateway.filter.factory.GatewayFilterFactory
NAME_KEY, VALUE_KEY
-
-
Constructor Summary
Constructors Constructor Description JsonToGrpcGatewayFilterFactory(GrpcSslConfigurer grpcSslConfigurer, org.springframework.core.io.ResourceLoader resourceLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GatewayFilter
apply(JsonToGrpcGatewayFilterFactory.Config config)
List<String>
shortcutFieldOrder()
Returns hints about the number of args and the order for shortcut parsing.-
Methods inherited from class org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory
getPublisher, setApplicationEventPublisher
-
Methods inherited from class org.springframework.cloud.gateway.support.AbstractConfigurable
getConfigClass, newConfig, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.springframework.cloud.gateway.filter.factory.GatewayFilterFactory
apply, apply, apply, getConfigClass, name, newConfig
-
Methods inherited from interface org.springframework.cloud.gateway.support.ShortcutConfigurable
shortcutFieldPrefix, shortcutType
-
-
-
-
Constructor Detail
-
JsonToGrpcGatewayFilterFactory
public JsonToGrpcGatewayFilterFactory(GrpcSslConfigurer grpcSslConfigurer, org.springframework.core.io.ResourceLoader resourceLoader)
-
-
Method Detail
-
shortcutFieldOrder
public List<String> shortcutFieldOrder()
Description copied from interface:ShortcutConfigurable
Returns hints about the number of args and the order for shortcut parsing.- Returns:
- the list of hints
-
apply
public GatewayFilter apply(JsonToGrpcGatewayFilterFactory.Config config)
-
-