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 Summary
FieldsModifier and TypeFieldDescriptionprotected final GatewayMethodMetadataprotected final GatewayProxyFactoryBean<?> protected final MessageChannelprotected final Map<String, Expression> protected static final SpelExpressionParser -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
beanName
Specify a bean name for the targetGatewayProxyFactoryBean.- Parameters:
beanName- the bean name to be used for registering bean for the gateway proxy- Returns:
- current
GatewayProxySpec.
-
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.- Parameters:
channelName- the bean name forMessageChannel- Returns:
- current
GatewayProxySpec. - See Also:
-
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.- Parameters:
replyChannel- theMessageChannelfor replies.- Returns:
- current
GatewayProxySpec. - See Also:
-
errorChannel
Identifies 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 forMessageChannel- Returns:
- current
GatewayProxySpec. - See Also:
-
errorChannel
Identifies 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- theMessageChannelfor replies.- Returns:
- current
GatewayProxySpec. - See Also:
-
requestTimeout
Provides 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:
-
replyTimeout
Allows 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:
-
asyncExecutor
Provide 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- theExecutorto use.- Returns:
- current
GatewayProxySpec. - See Also:
-
payloadExpression
An 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:
-
payloadFunction
AFunctionthat will be used to generate thepayloadfor all methods in the service interface unless explicitly overridden by a method declaration.- Parameters:
defaultPayloadFunction- theFunctionfor default payload.- Returns:
- current
GatewayProxySpec. - See Also:
-
payloadExpression
An 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:
-
header
Provides 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:
-
header
Provides 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- theFunctionfor the header value.- Returns:
- current
GatewayProxySpec. - See Also:
-
header
Provides 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:
-
mapper
AnMethodArgsMessageMapperto 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- theMethodArgsMessageMapperto use.- Returns:
- current
GatewayProxySpec. - See Also:
-
proxyDefaultMethods
Indicate ifdefaultmethods on the interface should be proxied as well.- Parameters:
proxyDefaultMethods- the boolean flag to proxy default methods or invoke viaMethodHandle.- Returns:
- current
GatewayProxySpec. - Since:
- 5.3
- See Also:
-