public class TcpOutboundGatewaySpec extends MessageHandlerSpec<TcpOutboundGatewaySpec,TcpOutboundGateway> implements ComponentsRegistration
MessageHandlerSpec
for TcpOutboundGateway
s.Modifier and Type | Field and Description |
---|---|
protected AbstractClientConnectionFactory |
connectionFactory |
PARSER, target
logger
DEFAULT_PHASE
OBJECT_TYPE_ATTRIBUTE
Constructor and Description |
---|
TcpOutboundGatewaySpec(AbstractClientConnectionFactory connectionFactoryBean)
Construct an instance using an existing spring-managed connection factory.
|
TcpOutboundGatewaySpec(TcpClientConnectionFactorySpec connectionFactorySpec)
Construct an instance using the supplied connection factory spec.
|
Modifier and Type | Method and Description |
---|---|
TcpOutboundGatewaySpec |
async(boolean async)
Set to true to release the sending thread and receive the reply asynchronously.
|
TcpOutboundGatewaySpec |
closeStreamAfterSend(boolean closeStreamAfterSend)
Set to true to close the connection output stream after sending without
closing the connection.
|
Map<Object,String> |
getComponentsToRegister() |
<P> TcpOutboundGatewaySpec |
remoteTimeout(java.util.function.Function<Message<P>,?> remoteTimeoutFunction)
Configure a
Function that will be invoked at runtime to determine the destination to
which a message will be sent. |
TcpOutboundGatewaySpec |
remoteTimeout(long remoteTimeout) |
TcpOutboundGatewaySpec |
unsolictedMessageChannelName(MessageChannel channel)
Set the unsolicited message channel.
|
TcpOutboundGatewaySpec |
unsolictedMessageChannelName(String channelName)
Set the unsolicited message channel name.
|
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
protected final AbstractClientConnectionFactory connectionFactory
public TcpOutboundGatewaySpec(AbstractClientConnectionFactory connectionFactoryBean)
connectionFactoryBean
- the spring-managed bean.public TcpOutboundGatewaySpec(TcpClientConnectionFactorySpec connectionFactorySpec)
connectionFactorySpec
- the spec.public TcpOutboundGatewaySpec remoteTimeout(long remoteTimeout)
remoteTimeout
- the remote timeout to set.TcpOutboundGateway.setRemoteTimeout(long)
public <P> TcpOutboundGatewaySpec remoteTimeout(java.util.function.Function<Message<P>,?> remoteTimeoutFunction)
Function
that 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'))
P
- the message payload type.remoteTimeoutFunction
- the function.TcpOutboundGateway.setRemoteTimeoutExpression(org.springframework.expression.Expression)
public TcpOutboundGatewaySpec closeStreamAfterSend(boolean closeStreamAfterSend)
ByteArrayRawSerializer
.
Requires a single-use connection factory.closeStreamAfterSend
- true to close.public TcpOutboundGatewaySpec async(boolean async)
async
- true for asynchronous request/reply.public TcpOutboundGatewaySpec unsolictedMessageChannelName(String channelName)
channelName
- the name.public TcpOutboundGatewaySpec unsolictedMessageChannelName(MessageChannel channel)
channel
- the channel.public Map<Object,String> getComponentsToRegister()
getComponentsToRegister
in interface ComponentsRegistration