From 1a39c27c5bc17826a4a2867cdc5b3636ab0e9956 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Sat, 17 Apr 2010 20:38:02 +0000 Subject: [PATCH] INT-1008 Documentation for Simple TCP Inbound Gateway --- spring-integration-reference/src/ip.xml | 117 +++++++++++++++++++++++- 1 file changed, 114 insertions(+), 3 deletions(-) diff --git a/spring-integration-reference/src/ip.xml b/spring-integration-reference/src/ip.xml index 6be598c190..07e8ab84c3 100644 --- a/spring-integration-reference/src/ip.xml +++ b/spring-integration-reference/src/ip.xml @@ -6,7 +6,8 @@ Spring Integration provides Channel Adapters for receiving and sending messages over internet protocols. Both UDP (User Datagram Protocol) and TCP (Transmission Control Protocol) adapters are provided. Each adapter provides for one-way communication - over the underlying protocol. Gateways providing two-way communication may be considered in a future release. + over the underlying protocol. + In addition, a simple inbound tcp gateway is provided.
Introduction @@ -24,6 +25,11 @@ and TcpNioReceivingChannelAdapter are the equivalent inbound channel adapters. The choice of which to use in what circumstances is described below. + + A simple inbound TCP gateway is provided; this allows for simple request/response processing. While + the gateway can support any number of connections, each connection can only process serially. The thread + that reads from the socket waits for, and sends, the response before reading again. +
UDP Adapters @@ -188,8 +194,33 @@ using-direct-buffers is not relevant.
-
- IP Adapter Attributes +
+ TCP Gateway + + The simple inbound TCP gateway SimpleTcpNetInboundGateway + uses java.net.Socket for communications. Each connection + can process a single request/response at a time. + + + This gateway delegates to a subclass of the TcpNetReceivingChannelAdapter + described above, so please read that section for more information. The difference + is that after constructing a message with the incoming payload and sending + it to the requestChannel, it waits for a response and sends the payload + from the response message by writing it to the socket, using the same + message format configured for the incoming message. + + + ]]> + A simple inbound TCP gateway; it uses '/r/n' delimited data and can be + used by a simple client such as telnet. + +
+
+ IP Endpoint Attributes IP Outbound Channel Adapter Attributes @@ -539,6 +570,86 @@
+ + TCP Inbound Gateway Attributes + + + + + + + + Attribute Name + Allowed Values + Attribute Description + + + + + port + + The port on which the gateway listens. + + + pool-size + + Specifies the number of concurrent connections supported + by the gateway. + + + receive-buffer-size + + The size of the + buffer used to reassemble incoming messages. Effectively the maximum + message size that can be received. + + + message-format + length-header, stx-etx, crlf, custom + The formatting that the tcp gateway uses for demarcating + incoming requests and formatting responses. Defaults to length-header. + See the discussion above for details about each format. + + + custom-socket- reader-class-name + Subclass of TcpNetSocket- Reader + When message-format is 'custom' the name of the class that + implements the custom format. Must be a subclass of the + TcpNetSocketReader. + + + custom-socket- writer-class-name + Subclass of TcpNetSocket- Writer + When message-format is 'custom' the name of the class that + implements the custom format. Must be a subclass of the + TcpNetSocketWriter. + + + so-timeout + + See java.net.Socket + setSoTimeout() for more information. + + + so-send-buffer-size + + See java.net.Socket + setSendBufferSize() methods for more information. + + + so-receive-buffer- size + + See java.net.Socket + setReceiveBufferSize() for more information. + + + so-keep-alive + true, false + See java.net.Socket. setKeepAlive(). + + + +