Commit Graph

85 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
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
Mark Fisher
e09a5da3ec versionless schemas for http and ip modules 2011-10-10 12:49:30 -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
Mark Fisher
9f59001230 removed deprecated trigger sub-elements non-core 2011-08-31 12:54:22 -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
69b4a0db78 INT-1797 Polishing 2011-02-20 20:29:44 -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
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
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
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
3c93433baf INT-1486 polish; rename byte array 'serializers' and all test usage 2010-09-28 22:25:54 -04:00
Gary Russell
b339157a34 INT-1486 polish; rename byte array 'serializers' and all test usage 2010-09-28 22:25:04 -04:00
Mark Fisher
68648dcb94 INT-1486 updated IP module for refactored Serialization code 2010-09-28 15:56:01 -04:00
Gary Russell
3764d30911 INT-1458 Add Sequence Header to Tcp Messages To Facilitate Resequencing 2010-09-23 21:19:55 -04:00
Oleg Zhurakousky
0be4d2ef60 INT-1263, more MessageHistory related changes 2010-09-22 22:18:45 -04:00
Oleg Zhurakousky
b6e058c59b INT-1263, added more changes and tests related valdating MessageHistory in every module 2010-09-22 18:44:51 -04:00
Oleg Zhurakousky
c4d31af848 INT-1257, added tests and minor modification to support MessageHistory in MAIL, JDBC, IP, HTTP modules 2010-09-21 22:15:37 -04:00
Mark Fisher
3b15a0dd38 INT-1390 moved MessageBuilder into the 'support' package, moved GenericMessage and ErrorMessage into the 'message' package 2010-08-31 02:51:27 +00:00
Mark Fisher
7c1ab04cd5 INT-1390 Refactoring: moved MessageChannel to the root package, and moved ChannelResolver and BeanFactoryChannelResolver into a new 'suport.channel' package 2010-08-31 01:53:45 +00:00
Mark Fisher
432a8ec381 INT-1389 removed all dependencies on StringMessage from unit tests in spring-integration-ip and spring-integration-stream 2010-08-30 18:48:54 +00:00
Gary Russell
df3464ed25 INT-1369 Fix Remaining Timing Hole in TcpNioConnection Where Possibly No Message Assembler Running 2010-08-25 20:41:06 +00:00
Gary Russell
06b7d00113 INT1346 INT-1369 Fix Test Timing Issues 2010-08-24 00:35:00 +00:00
Gary Russell
32358bafca INT1346 INT-1369 Fix Test Timing Issues 2010-08-23 23:41:10 +00:00
Gary Russell
4090905770 INT-1369 Improve Asynchrony of NIO Connections 2010-08-23 23:05:19 +00:00
Gary Russell
920822c504 INT-1346 Use Unique Port For All Unit Tests To Avoid Crosstalk - Previously, timing made it possible for the client from one test to talk to the server for another. 2010-08-18 17:21:52 +00:00
Gary Russell
85059fd815 INT-1346 Outbound Gateway Tests Were Not Waiting for Test Listener to Start 2010-08-17 13:14:40 +00:00
Gary Russell
fe8dca0785 INT-1346 Fix Test Timing Problem Where Second (expected) Failure Returned Before First (Good) Message. 2010-08-17 00:49:11 +00:00
Gary Russell
a54c7ed5f1 INT-1279 Namespace Updates For New Gateways; Remove Old Gateways/Adapters; Migrate All Tests to New Gateways/Adapters 2010-08-13 22:05:59 +00:00
Gary Russell
390cc84c5b INT-1279 TCP ib and ob Gateways Using Connection Factories - namespace and docs to follow 2010-08-10 20:47:18 +00:00