Commit Graph

125 Commits

Author SHA1 Message Date
Gary Russell
0f46176c3d INT-2287 Timing Hole With Send-and-Forget TCP
If a tcp client connection factory was configured for single-use
connections (one socket per message), and it was used by an outbound
channel adapter (send and forget), the socket is closed immediately
after sending the message.

This could cause issues with the connection handling because certain
failures could occur. For example, the close could occur before we
ever registered the channel for read selection, resulting in a
ClosedChannelException. Secondly, there was a small timing hole
where a selection key could be invalidated between the isValid()
call and isReadable().

These problems have been corrected.
2011-11-30 16:23:33 -05:00
Gary Russell
3fff33c99b INT-2268 Fix Spurious Failing Test
Occasional test failures caused because test HelloWorldInterceptor
could prematurely close the connection, depending on timing.

Also added some minor cleanup to the tests themselves.
2011-11-29 11:50:32 -05:00
Mark Fisher
6c1454ae3d INT-2238 removing warnings in JavaDoc 2011-11-22 21:48:34 -05:00
Oleg Zhurakousky
43f60dae08 INT-2238 interim commit
INT-2238 fixing warning comments

INT-2238 fixing warning comments

INT-2238 fixing warning comments
2011-11-22 21:10:32 -05:00
Gary Russell
7c3f2ee8c4 INT-2184 Lifecycle Problem With TCP OB Adapter
Autostartup defaulted to false and isRunning() returned
the status of the associated connection factory instead
of its own status. Precluded it being started because
LifeCycle processor thought it was already started.
2011-10-17 11:56:48 -04:00
Gary Russell
e9778b7526 INT-2167 Code Polishing
Missing braces.

Add private constructors to utility classes.

Remove unnecessary logger overrides.

Remove unnecessary null check.

Remove redundant 'implements BeanNameAware'.

Improve Synchronization in UDP.

Removed Unused Obsolete Constants
2011-10-17 11:50:21 -04:00
Gary Russell
57121604d3 INT-1872 Allow Indefinite Socket Timeout
Previously, for single-use server sockets, and for client sockets
that have a collaborating inbound adapter, the socket timeout
was set to 10 seconds, with no way to set to infinity. The work
around was to set it to Integer.MAX_VALUE.

The intent was to avoid DoS attacks and mis-behaved clients, but
some users have expressed a desire to be able to set an infinite
timeout in both scenarios.

A future release may remove the 10 second default from the client
socket that has a collaborating inbound adapter, and default to
infinity. For this reason, that case now emits a warning.

The default 10 second timeout on single-use server sockets will
likely remain.

INT-1872 Remove WARN Log

We decided to eliminate the log message regarding a possible
future change to the default timeout for client sockets used
for request/reply.
2011-10-17 11:45:08 -04:00
Gary Russell
9f302172c6 INT-2183 Fix Multicast Regression Issue
Multicast tests are @Ignored because multicast has specific
requirements on the build machine. A regression issue was
introduced by INT-2050.
2011-10-15 13:53:53 -04:00
Gary Russell
a7bda6bbb2 INT-1770 Support Client Mode For TCP Endpoints
Add client mode for inbound endpoints, and for the
outbound adapter.

INT-1770 Allow Inbound Adapter to Open Connection

Normally, inbound adapters use server sockets and wait for incoming
connection. There are use cases where the adapter should establish
the connection and wait for inbound messages.

INT-1770 Open Connection on Start

Allow configuration of outbound adapter to permit
connection establishment when the adapter is started
rather than when the first message arrives.

INT-1770 Allow Inbound Gateway to Open Connection

Normally, inbound gateways listen for connections. There are
use cases where an inbound gateway might open the connection
and then wait for incoming requests.

INT-1770 Parsers

Update parsers and tests to support attributes for setting
endpoints in client-mode.

INT-1770 Docs

Update reference with client-mode information.

INT-1770 Add Control Bus for Client Mode

Enable control bus commands to check status and to attempt
connection establishment.
2011-10-14 18:10:06 -04:00
Gary Russell
1cb7990f6c INT-2179 Fix NPE If Connection Id Header Missing
ip_connection_id header is used to determine to which socket
a message should be written. If this header is missing, we
can't send the message and we log an error. Previously, an
NPE was thrown.

This applies to inbound gateway replies and asynchronous
outbound server messages.
2011-10-13 17:08:10 -04:00
Mark Fisher
e09a5da3ec versionless schemas for http and ip modules 2011-10-10 12:49:30 -04:00
Gary Russell
7ff2861168 INT-2168 Reinstate Port in Tcp Connection Id
Port was always zero; broken by INT-1822.
2011-10-05 17:41:15 -04:00
Gary Russell
7981855c78 INT-2050 Code Polishing
INT-1876 Add AutoStart and Phase to TCP Endpoints

There was no way for an application to control the startup
of TCP endpoints. This is particularly an issue for controlling
availability of inbound endpoints.

The TCP Endpoints are mostly static, with dynamic behavior
being contained in connection factories. The factories
implement SmartLifecycle but there is no way to
configure auto-startup.

Adds auto-startup and phase attributes to all TCP endpoints

Starting/stopping an endpoint will start/stop the underlying
connection factory. When a connection factory is stopped,
all open connections are closed, and no new connections will
be acceptedi (inbound) or allowex (outbound).

While the factories implement SmartLifecycle, they return
false to auto-startup. We rely on the fact that
the endpoints are dependent on factories and
the factories will be started because of this dependency.

Finally, with collaborating endpoints (where an inbound and
outbound adapter are bound to the same factory), starting/
stopping one endpoint will affect the collaborating
endpoint too.

INT-1876 Polish Schema Docs

Doc was incorrectly talking about connection factories instead
of endpoints.

INT-2162 Add apply-sequence to Connection Factory

When messages are generated as a result of incoming tcp messages, and this
attribute is true (default=false), the sequenceNumber and
correlationId headers will be set. This will facilitate
downstream resequencing if necessary.

The 'ip_connection_id' header is still required for internal correlation
of reply messages to the right socket (regardless of whether downstream
components have altered the correlationId), and will contain the same value
as the correlationId (if set). This will not use up more memory for the
header content because they will both point to the same heap object.

The 'ip_connection_seq' header is deprecated and may be removed
in a future release.

TcpConnection.getConnectionSeq() has been renamed to
incrementAndGetConnectionSequence() because it is not a simple
getter method, it increments the connection's sequence number.

INT-2162 Update Docs for apply-sequence

Add documentation for apply-sequence attribute on
TCP Connection Factories.
2011-10-03 15:20:57 -04:00
Gary Russell
5624feacc0 INT-2154 Minor Refactoring
Factor out socket creation to a protected method, to facilitate
easier subclassing, enabling something other than the default
Socket factories to be used.
2011-09-27 11:56:17 -04:00
Mark Fisher
9f59001230 removed deprecated trigger sub-elements non-core 2011-08-31 12:54:22 -04:00
Mark Fisher
7c5603fe83 INT-2092 update schema imports to use 2.1 version 2011-08-31 05:26:02 -04:00
Oleg Zhurakousky
935cd01d07 INT-1512 changed the type of ID attribute to be xsd:string in all related 2.1 schema files 2011-08-08 23:34:12 -04:00
Mark Fisher
3e71b5a83b INT-2004 added 2.1 versions of all XML schemas and adjusted spring.schemas files accordingly 2011-08-05 11:07:20 -04:00
Gary Russell
9b626c946b INT-1937 Fix NIO Connection State on Exception 2011-06-11 10:35:12 -04:00
Gary Russell
fc7f3e9f83 INT-1895 Use FactoryBean to Allow Late-Binding of using-nio Attribute 2011-06-09 19:16:36 -04:00
Oleg Zhurakousky
765503daa4 polishing, fixed warning messages 2011-05-03 19:20:57 -04:00
Gary Russell
06b9752af9 INT-1854 Allow restart after stop 2011-04-27 10:30:48 -04:00
Gary Russell
31e90fcca3 INT-1854 Remove unused imports; fix copyright dates 2011-04-26 21:26:47 -04:00
Gary Russell
8b0b8a76ae INT-1854 Shutdown task executor (if internal), close all sockets on close() 2011-04-26 21:11:22 -04:00
Gary Russell
6acb07ce00 INT-1877 Support Byte, Short, and Int Length Headers 2011-04-25 18:33:27 -04:00
Gary Russell
16b0248791 INT-1848 Add order Attribute to tcp, udp, jdbc Outbound Endpoints 2011-03-25 15:49:00 -04:00
Gary Russell
9a5c26581b INT-1822 Add Attribute to Suppress Reverse DNS Lokup 2011-03-04 18:53:51 -05:00
Gary Russell
5e02a7e63b INT-1823 Protect NIO Selector from Unexpected Exceptions 2011-03-02 18:37:02 -05:00
Gary Russell
69b4a0db78 INT-1797 Polishing 2011-02-20 20:29:44 -05:00
Gary Russell
73e31e52ea INT-1797 Polish trace log entry 2011-02-20 15:51:19 -05:00
Gary Russell
2ddbf35cfb INT-1797 Polishing; fix failing test 2011-02-20 15:35:27 -05:00
Gary Russell
ecff2ce21e INT-1797 Remove ERROR Log on NIO Socket Close; Refactor common NIO Client/Server factory code to AbstractConnectionFactory 2011-02-20 15:05:56 -05:00
Gary Russell
97617355ee INT-1785 Add Raw Single-Shot (De)Serializer 2011-02-09 14:54:50 -05:00
Gary Russell
cfd61c4218 INT-1707 Don't set SO_LINGER unless specified; close socket on send when appropriate, unless SO_LINGER=0; ensure any self-called close() is properly routed through any interceptors; suppress error on read when socket closed normally 2010-12-22 17:22:23 -05:00
Gary Russell
c5dba36865 INT-1552 Add error-channel to other endpoint docs; schema doc polishing 2010-11-18 18:21:14 -05:00
Mark Fisher
f3e854b10c INT-1568 removed the MessageHeaders.PREFIX constant since it's no longer necessary. Also added @ManagedOperation to the IntegrationMBeanExporter's getChannelSendRate(..) method. 2010-11-18 00:03:58 -05:00
Gary Russell
cf5f51fdb5 INT-1624 Polish ip and jms schemas for error-channel 2010-11-17 16:49:13 -05:00
Gary Russell
bfeee039bb INT-1623 INT-1624 Add error-channel to ip inbound adapters and tcp inbound gateway - parsers, XSD and tests only - super classes already do the heavy lifting 2010-11-16 19:20:03 -05:00
Mark Fisher
d7ad37de4b renamed SocketIoUtils to SocketUtils 2010-11-13 23:49:36 -05:00
Mark Fisher
a78d361538 renamed SocketUtils in src/test to SocketTestUtils 2010-11-13 23:44:41 -05:00
Mark Fisher
bc10b621e3 INT-1619 removed cycle by moving SocketIoUtils into the util package 2010-11-13 23:43:22 -05:00
Gary Russell
35aeaff97b INT-1597 Fix Sporadic Test Failure in IP 2010-11-09 22:31:29 -05:00
Mark Fisher
b2f3235d7e removing warnings 2010-11-09 17:35:08 -05:00
Mark Fisher
308231f669 avoiding warnings 2010-11-05 18:33:53 -04:00
Mark Fisher
d9045e1904 INT-1568 removed '$' prefix for headers. Now there is NO prefix. 2010-10-28 15:32:24 -04:00
Gary Russell
64fec64d40 INT-1546 Tcp Interceptors - polish and doc 2010-10-23 12:15:24 -04:00
Mark Fisher
c98af91aa6 INT-1487 fixed package name in some ip module test configs for DefaultSerializer/DefaultDeserializer 2010-10-22 22:05:41 -05:00
Mark Fisher
d0ef062c2e INT-1487 updated some test config references to commons.serializer as well as tooling annotations in schemas 2010-10-22 21:50:09 -05:00
Mark Fisher
180753ca5b INT-1487 now using Spring 3.0.5 core Serializer/Deserializer, INT-1490 import version is now resolved since it's included in 'core' import, and INT-1526 updated the affected template.mf files for 3.0.5 as the minimum (will address others next) 2010-10-22 21:12:22 -05:00
Gary Russell
d09dfd7c45 INT-1529 NPE in inbound gateway when reply is null 2010-10-17 12:46:16 -04:00