Class GatewayProxySpec
java.lang.Object
org.springframework.integration.dsl.GatewayProxySpec
A builder for the 
GatewayProxyFactoryBean options
 when MessagingGateway on the service interface cannot be
 declared.- Since:
- 5.2
- Author:
- Artem Bilan, Gary Russell
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final GatewayMethodMetadataprotected final GatewayProxyFactoryBean<?> protected final MessageChannelprotected final Map<String, Expression> protected static final SpelExpressionParser
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionasyncExecutor(Executor executor) Specify a bean name for the targetGatewayProxyFactoryBean.errorChannel(String errorChannelName) Identifies a channel that error messages will be sent to if a failure occurs in the gateway's proxy invocation.errorChannel(MessageChannel errorChannel) Identifies a channel that error messages will be sent to if a failure occurs in the gateway's proxy invocation.Provides custom message header.header(String headerName, Function<MethodArgsHolder, ?> valueFunction) Provides custom message header.header(String headerName, Expression valueExpression) Provides custom message header.mapper(MethodArgsMessageMapper mapper) AnMethodArgsMessageMapperto map the method arguments to aMessage.payloadExpression(String expression) An expression that will be used to generate thepayloadfor all methods in the service interface unless explicitly overridden by a method declaration.payloadExpression(Expression expression) An expression that will be used to generate thepayloadfor all methods in the service interface unless explicitly overridden by a method declaration.payloadFunction(Function<MethodArgsHolder, ?> defaultPayloadFunction) AFunctionthat will be used to generate thepayloadfor all methods in the service interface unless explicitly overridden by a method declaration.proxyDefaultMethods(boolean proxyDefaultMethods) Indicate ifdefaultmethods on the interface should be proxied as well.replyChannel(String channelName) Identifies the default channel the gateway proxy will subscribe to, to receive replyMessages, the payloads of which will be converted to the return type of the method signature.replyChannel(MessageChannel replyChannel) Identifies the default channel the gateway proxy will subscribe to, to receive replyMessages, the payloads of which will be converted to the return type of the method signature.replyTimeout(long replyTimeout) Allows to specify how long this gateway will wait for the replyMessagebefore returning.requestTimeout(long requestTimeout) Provides the amount of time dispatcher would wait to send aMessage.
- 
Field Details- 
PARSER
- 
gatewayRequestChannel
- 
gatewayProxyFactoryBean
- 
gatewayMethodMetadata
- 
headerExpressions
 
- 
- 
Constructor Details- 
GatewayProxySpec
 
- 
- 
Method Details- 
beanNameSpecify a bean name for the targetGatewayProxyFactoryBean.- Parameters:
- beanName- the bean name to be used for registering bean for the gateway proxy
- Returns:
- current GatewayProxySpec.
 
- 
replyChannelIdentifies the default channel the gateway proxy will subscribe to, to receive replyMessages, the payloads of which will be converted to the return type of the method signature.- Parameters:
- channelName- the bean name for- MessageChannel
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
replyChannelIdentifies the default channel the gateway proxy will subscribe to, to receive replyMessages, the payloads of which will be converted to the return type of the method signature.- Parameters:
- replyChannel- the- MessageChannelfor replies.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
errorChannelIdentifies a channel that error messages will be sent to if a failure occurs in the gateway's proxy invocation. If noerrorChannelreference is provided, the gateway will propagateExceptions to the caller. To completely suppressExceptions, provide a reference to thenullChannelhere.- Parameters:
- errorChannelName- the bean name for- MessageChannel
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
errorChannelIdentifies a channel that error messages will be sent to if a failure occurs in the gateway's proxy invocation. If noerrorChannelreference is provided, the gateway will propagateExceptions to the caller. To completely suppressExceptions, provide a reference to thenullChannelhere.- Parameters:
- errorChannel- the- MessageChannelfor replies.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
requestTimeoutProvides the amount of time dispatcher would wait to send aMessage. This timeout would only apply if there is a potential to block in the send call. For example if this gateway is hooked up to aQueueChannel. Value is specified in milliseconds.- Parameters:
- requestTimeout- the timeout for requests in milliseconds.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
replyTimeoutAllows to specify how long this gateway will wait for the replyMessagebefore returning. By default, it will wait 30 seconds.nullis returned if the gateway times out. Value is specified in milliseconds.- Parameters:
- replyTimeout- the timeout for replies in milliseconds.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
asyncExecutorProvide a reference to an implementation ofExecutorto use for any of the interface methods that have aFuturereturn type. ThisExecutorwill only be used for those async methods; the sync methods will be invoked in the caller's thread. Usenullto specify no async executor - for example if your downstream flow returns aFuture.- Parameters:
- executor- the- Executorto use.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
payloadExpressionAn expression that will be used to generate thepayloadfor all methods in the service interface unless explicitly overridden by a method declaration. The root object for evaluation context isMethodArgsHolder.- Parameters:
- expression- the SpEL expression for default payload.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
payloadFunctionAFunctionthat will be used to generate thepayloadfor all methods in the service interface unless explicitly overridden by a method declaration.- Parameters:
- defaultPayloadFunction- the- Functionfor default payload.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
payloadExpressionAn expression that will be used to generate thepayloadfor all methods in the service interface unless explicitly overridden by a method declaration. The root object for evaluation context isMethodArgsHolder. a bean resolver is also available, enabling expressions like@someBean(#args).- Parameters:
- expression- the SpEL expression for default payload.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
headerProvides custom message header. The default headers are created for all methods on the service-interface (unless overridden by a specific method).- Parameters:
- headerName- the name ofr the header.
- value- the static value for the header.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
headerProvides custom message header. The default headers are created for all methods on the service-interface (unless overridden by a specific method).- Parameters:
- headerName- the name ofr the header.
- valueFunction- the- Functionfor the header value.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
headerProvides custom message header. The default headers are created for all methods on the service-interface (unless overridden by a specific method). This expression-based header can get access to theMethodArgsHolderas a root object for evaluation context.- Parameters:
- headerName- the name ofr the header.
- valueExpression- the SpEL expression for the header value.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
mapperAnMethodArgsMessageMapperto map the method arguments to aMessage. When this is provided, nopayload-expressions orheaders are allowed; the custom mapper is responsible for creating the message.- Parameters:
- mapper- the- MethodArgsMessageMapperto use.
- Returns:
- current GatewayProxySpec.
- See Also:
 
- 
proxyDefaultMethodsIndicate ifdefaultmethods on the interface should be proxied as well.- Parameters:
- proxyDefaultMethods- the boolean flag to proxy default methods or invoke via- MethodHandle.
- Returns:
- current GatewayProxySpec.
- Since:
- 5.3
- See Also:
 
 
-