Class TcpOutboundGatewaySpec
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageHandlerSpec<TcpOutboundGatewaySpec,TcpOutboundGateway>
org.springframework.integration.ip.dsl.TcpOutboundGatewaySpec
- All Implemented Interfaces:
DisposableBean
,FactoryBean<TcpOutboundGateway>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
public class TcpOutboundGatewaySpec
extends MessageHandlerSpec<TcpOutboundGatewaySpec,TcpOutboundGateway>
implements ComponentsRegistration
A
MessageHandlerSpec
for TcpOutboundGateway
s.- Since:
- 5.0
- Author:
- Gary Russell, Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ConstructorDescriptionTcpOutboundGatewaySpec
(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 TypeMethodDescriptionasync
(boolean async) Set to true to release the sending thread and receive the reply asynchronously.closeStreamAfterSend
(boolean closeStreamAfterSend) Set to true to close the connection output stream after sending without closing the connection.remoteTimeout
(long remoteTimeout) remoteTimeout
(Function<Message<P>, ?> remoteTimeoutFunction) Configure aFunction
that will be invoked at runtime to determine the destination to which a message will be sent.unsolicitedMessageChannel
(MessageChannel channel) Set the unsolicited message channel.unsolicitedMessageChannelName
(String channelName) Set the unsolicited message channel name.unsolictedMessageChannelName
(String channelName) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.in favor ofunsolicitedMessageChannel(MessageChannel)
due to the typo in method name.Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, get, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Field Details
-
connectionFactory
-
-
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:
-
remoteTimeout
Configure aFunction
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'))
- Type Parameters:
P
- the message payload type.- Parameters:
remoteTimeoutFunction
- the function.- Returns:
- the spec.
- See Also:
-
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
@Deprecated(since="6.1", forRemoval=true) public TcpOutboundGatewaySpec unsolictedMessageChannelName(String channelName) Deprecated, for removal: This API element is subject to removal in a future version.in favor ofunsolicitedMessageChannelName(String)
due to the typo in method name.Set the unsolicited message channel name.- Parameters:
channelName
- the name.- Returns:
- the spec.
- Since:
- 5.4
-
unsolicitedMessageChannelName
Set the unsolicited message channel name.- Parameters:
channelName
- the name.- Returns:
- the spec.
- Since:
- 6.1
-
unsolictedMessageChannelName
@Deprecated(since="6.1", forRemoval=true) public TcpOutboundGatewaySpec unsolictedMessageChannelName(MessageChannel channel) Deprecated, for removal: This API element is subject to removal in a future version.in favor ofunsolicitedMessageChannel(MessageChannel)
due to the typo in method name.Set the unsolicited message channel.- Parameters:
channel
- the channel.- Returns:
- the spec.
- Since:
- 5.4
-
unsolicitedMessageChannel
Set the unsolicited message channel.- Parameters:
channel
- the channel.- Returns:
- the spec.
- Since:
- 6.1
-
getComponentsToRegister
- Specified by:
getComponentsToRegister
in interfaceComponentsRegistration
-
unsolicitedMessageChannelName(String)
due to the typo in method name.