Class TcpOutboundGatewaySpec
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageHandlerSpec<TcpOutboundGatewaySpec,TcpOutboundGateway>
org.springframework.integration.ip.dsl.TcpOutboundGatewaySpec
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<TcpOutboundGateway>,org.springframework.beans.factory.InitializingBean,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,org.springframework.integration.dsl.ComponentsRegistration
public class TcpOutboundGatewaySpec extends org.springframework.integration.dsl.MessageHandlerSpec<TcpOutboundGatewaySpec,TcpOutboundGateway> implements org.springframework.integration.dsl.ComponentsRegistration
A
MessageHandlerSpec for TcpOutboundGateways.- Since:
- 5.0
-
Field Summary
Fields Modifier and Type Field Description protected AbstractClientConnectionFactoryconnectionFactory -
Constructor Summary
Constructors Constructor Description TcpOutboundGatewaySpec(TcpClientConnectionFactorySpec connectionFactorySpec)Construct an instance using the supplied connection factory spec.TcpOutboundGatewaySpec(AbstractClientConnectionFactory connectionFactoryBean)Construct an instance using an existing spring-managed connection factory. -
Method Summary
Modifier and Type Method Description TcpOutboundGatewaySpecasync(boolean async)Set to true to release the sending thread and receive the reply asynchronously.TcpOutboundGatewaySpeccloseStreamAfterSend(boolean closeStreamAfterSend)Set to true to close the connection output stream after sending without closing the connection.java.util.Map<java.lang.Object,java.lang.String>getComponentsToRegister()TcpOutboundGatewaySpecremoteTimeout(long remoteTimeout)<P> TcpOutboundGatewaySpecremoteTimeout(java.util.function.Function<org.springframework.messaging.Message<P>,?> remoteTimeoutFunction)Configure aFunctionthat will be invoked at runtime to determine the destination to which a message will be sent.TcpOutboundGatewaySpecunsolictedMessageChannelName(java.lang.String channelName)Set the unsolicited message channel name.TcpOutboundGatewaySpecunsolictedMessageChannelName(org.springframework.messaging.MessageChannel channel)Set the unsolicited message channel.Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
-
Field Details
-
Constructor Details
-
TcpOutboundGatewaySpec
Construct an instance using an existing spring-managed connection factory.- Parameters:
connectionFactoryBean- the spring-managed bean.
-
TcpOutboundGatewaySpec
Construct an instance using the supplied connection factory spec.- Parameters:
connectionFactorySpec- the spec.
-
-
Method Details
-
remoteTimeout
- Parameters:
remoteTimeout- the remote timeout to set.- Returns:
- the spec.
- See Also:
TcpOutboundGateway.setRemoteTimeout(long)
-
remoteTimeout
public <P> TcpOutboundGatewaySpec remoteTimeout(java.util.function.Function<org.springframework.messaging.Message<P>,?> remoteTimeoutFunction)Configure aFunctionthat will be invoked at runtime to determine the destination to which a message will be sent. Typically used with a Java 8 Lambda expression:.remoteTimeout(m -> m.getHeaders().get('rto'))- Type Parameters:
P- the message payload type.- Parameters:
remoteTimeoutFunction- the function.- Returns:
- the spec.
- See Also:
TcpOutboundGateway.setRemoteTimeoutExpression(org.springframework.expression.Expression)
-
closeStreamAfterSend
Set to true to close the connection output stream after sending without closing the connection. Use to signal EOF to the server, such as when using aByteArrayRawSerializer. Requires a single-use connection factory.- Parameters:
closeStreamAfterSend- true to close.- Returns:
- the spec.
- Since:
- 5.2
-
async
Set to true to release the sending thread and receive the reply asynchronously.- Parameters:
async- true for asynchronous request/reply.- Returns:
- the spec.
- Since:
- 5.3
-
unsolictedMessageChannelName
Set the unsolicited message channel name.- Parameters:
channelName- the name.- Returns:
- the spec.
- Since:
- 5.4
-
unsolictedMessageChannelName
public TcpOutboundGatewaySpec unsolictedMessageChannelName(org.springframework.messaging.MessageChannel channel)Set the unsolicited message channel.- Parameters:
channel- the channel.- Returns:
- the spec.
- Since:
- 5.4
-
getComponentsToRegister
public java.util.Map<java.lang.Object,java.lang.String> getComponentsToRegister()- Specified by:
getComponentsToRegisterin interfaceorg.springframework.integration.dsl.ComponentsRegistration
-