Commit Graph

310 Commits

Author SHA1 Message Date
Artem Bilan
be4fd62cea INT-3893: UnicastReceivingChannelAdapter: fix NPE
JIRA: https://jira.spring.io/browse/INT-3893

Polishing

Send on the calling thread if the executor is shut down.

Conflicts:
	spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/UdpChannelAdapterTests.java
Resolved.
2015-11-20 11:03:03 -05:00
Artem Bilan
1934d408c1 INT-3843: Backport NPE Fix for TCP ConFactories
JIRA: https://jira.spring.io/browse/INT-3843

**Cherry-pick to the 3.0.x**

Conflicts:
	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java
Resolved.
2015-10-07 12:38:58 -04:00
Gary Russell
d395e38890 INT-3837: TCP GW - Propagate Socket Timeout
JIRA: https://jira.spring.io/browse/INT-3837

INT-3103 introduced exception propagation to waiting gateway threads.

However, `SocketTimeoutException`s were not propagated (in all cases
since 4.2 and for single-use sockets since 3.0).

Conflicts:
	spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java

Resolved.

Remove beanfactory from backported test.
2015-09-28 10:27:25 -04:00
Gary Russell
539f9e89f0 INT-3453 NIO Always Release Assembler Thread
Fixed hung assembler described in INT-3453.

Used CountDownLatch instead of sleep()

INT-3453 Add Test Case

Currently failing for me - assembler thread stuck on CDL.

Remove redundant `if (TcpNioConnection.this.writingLatch != null)` from `ChannelInputStream#write`

Conflicts:
	spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionTests.java
2014-06-27 18:47:52 +03:00
Gary Russell
ec4c4b03b1 INT-3433 Delay Failed IOs
JIRA: https://jira.spring.io/browse/INT-3433`

If a read fails due to insufficient threads, delay the read
for (default 100ms) - do not re-enable OP_READ until that
time has elapsed. Avoids spinning the CPU.

INT-3433 More Polishing

If the assembler couldn't execute a new assembler after assembling
the current message (when it detected there is more data), in the
finally block it would "continue" only if the socket was still
open.

The test case closes the socket after sending 4 messages so when
this condition occurred, the assembler failed to continue and
data was left in the buffer.

Remove the `isOpen()` check in the finally block and always continue
if there's not another assembler running and there's data available.

INT-3433 More Polishing

We can still get starvation if the selector is in a long
wait (in select()) when a read is delayed.

Whenever a read is delayed, wake the selector so its next
select will use the readDelay timeout.

INT-3433 Reference Docs

Also remove Thread.yield().

Revert redundant boolean return from `TcpNioConnection#checkForAssembler()`

Conflicts:
	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java
	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java
2014-06-23 11:34:55 +03:00
JohnA2
eafbe9b6e3 INT-3433 NIO Thread Starvation with Fixed Pool
JIRA: https://jira.spring.io/browse/INT-3433

INT-3433 added the test-case

Conflicts:
	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java
2014-06-23 11:25:13 +03:00
Gary Russell
19443d6817 INT-3410 TCP NIO Deadlock with Bound TE
JIRA: https://jira.spring.io/browse/INT-3410

When running a fixed thread pool with a bound queue,
and CALLER_RUNS execution rejection policy, it
was possible to deadlock the IO selector thread.

Add a `CompositeExecutor` to use different threads for
IO to those used for message assembly.

Add a `CallerBlocksPolicy` to block the invoking thread
(for a specified time) if the pool is exhausted.

Add documentation.

Polishing
2014-05-20 17:42:45 +03:00
Gavin Gray
1eb501d272 INT-3290 Fix TCP Deserializer for 0 Length Message
ByteArraySingleTerminatorSerializer does not support multiple
subsequent terminators (zero length messages).

JIRA: https://jira.springsource.org/browse/INT-3290

* Add unit test to verify bug.
* Fix bug.

Polishing:

* Remove test for `n >= 0`; n cannot be < 0 here
* Move test case to `DeserializationTests`
2014-02-07 13:32:35 -05:00
Gary Russell
ced1a05df2 INT-3233 NIO, Windows 7 and Java 7/8
JIRA: https://jira.springsource.org/browse/INT-3233

With Windows 7 and Java 7/8 closing a server channel does
not close the underlying socket. Closing the Selector does
close the socket.

It is not clear why this is needed, given that a selector can
be used for multiple sockets.

However, we only use the server side selector for a single
server socket so there is no detriment in closing it.

Also close the selector on the client side (even though it is
used for multiple sockets, because we are stopping the factory
anyway and all sockets will be closed).

However, closing the selector opens us up to 'ClosedSelectorException's
in several places. Add catch blocks to deal with this exception, and only
log an error if the factory is active.

While debugging this issue, I found that a number of (older) tests
left threads running, sockets open etc.

INT-3233 Polishing - PR Comments
2013-12-13 20:50:32 +02:00
Artem Bilan
c2004f1ab3 INT-3228: Remove Previous versions' Deprecations
JIRA: https://jira.springsource.org/browse/INT-3228

Remove elements that were deprecated in earlier
versions; see the migration guide for more information

https://github.com/spring-projects/spring-integration/wiki/Spring-Integration-2.2-to-3.0-Migration-Guide

INT-3228: Revert FileTransferMH#setTempDirectory
2013-12-10 09:21:04 -05:00
Gary Russell
5f555e31b3 INT-3218 Spring 4 Compatibility
Use `Arrays.asList()` instead of `Collections.arrayToList()` in
places where a generic type needs to be supplied by the caller.

This maintains compile-time compatibility with both Spring 3 and 4,
where Spring 4 added the generic type to the utility class.

The four occurrences where this was needed are not impacted
by the fact that `Arrays.asList()` returns an unmodifiable list.
2013-11-26 17:32:20 -05:00
Artem Bilan
405fce672b INT-3212: Fix Failed Tests From CI Builds
JIRA: https://jira.springsource.org/browse/INT-3212

INT-3212 Fix Failing TCP Test

TcpNioConnections can deadlock when a fixed thread pool is being used.
The deadlock is detected after 60 seconds, but the test case failed
after 20 seconds - before the deadlock was detected.

Change the test to use a cached thread pool instead.

Also, increase concurrency by using threading in the test server
so each socket is handled on a separate thread.

Enchance connectionId to include both local and remote ports to
aid debugging.

Some minor formatting corrections.
2013-11-20 15:10:22 -05:00
Gary Russell
5bb6e550aa INT-3211 TCP Interceptor Events; Test Polishing
Intercepted TCP connections did not publish events.

TcpReceivingChannelAdapterTests did not close server factories after
tests.

Suppress 'no publisher' log messages.
2013-11-20 11:42:02 +02:00
Gary Russell
adc20970d9 INT-2870/INT-2714 Document IP MessageHeaders
JIRA: https://jira.springsource.org/browse/INT-2870
JIRA: https://jira.springsource.org/browse/INT-2714

INT-2870: Polishing IP Headers Table for PDF
2013-11-19 13:21:14 +02:00
Gary Russell
2bf8196353 INT-3178 Defer Publishing of TCP Open Event
Previously, the TcpConnectionOpenEvent was published as soon
as the socket was connected, but the TcpConnection was not yet
ready for use.

Defer publishing the event until the connection is fully
initialized and registered with the factory and thus available
for use.

Update the test cases to reflect this behavior.

Since the event is now published by the appropriate concrete
factory implementations, enhance the ConnectionToConnectionTests
to verify proper eventing with both Net and NIO implementations.

INT-3178: Add `theConnection` `ReadWriteLock`

INT-3178 Polishing

- Refactor obtainConnection() into obtainSharedConnection() and obtainNewConnection() for Net and NIO Client factories.
- obtainConnection is now common for these two factories, and overridden by the caching and failover factories.
- ReadWriteLock - double check for shared connection after lock obtained.

INT-3178: Polishing
2013-10-30 13:58:06 +02:00
Gary Russell
8dca61c62a INT-3163 Force Connection Close on Send Exception
Previously, when an exception occurred on a send, the
connection was not forcibly closed. When using a
CachingClientConnectionFactory, this prevented the connection
(albeit stale) from being returned to the cache.

Perform a forced (physical) close whenever a send fails.

Add test cases for both Net and NIO implementations, using
a CCCF, to verify the connection is returned to the pool so
the closed state can be detected on the next retrieval, causing
a refresh.

Also, change the synchronization in the NIO send to
synchronize on the socketChannel, not the mapper (which is
shared).

JIRA: https://jira.springsource.org/browse/INT-3163
2013-10-06 13:02:12 +03:00
Gary Russell
be87cfc365 INT-3152 Speed Up Build Times
Add a `@Rule` to skip long-runing tests during normal builds.

Add the rule to long-running tests in gemfire, ip, jms, jmx.

Add an environment variable `RUN_LONG_INTEGRATION_TESTS`; when set
to true, all tests are run.

Set the environment variable to true on all nightly builds.

Build now runs in 13 minutes on my 3 year old laptop.
2013-09-26 17:38:38 -04:00
Artem Bilan
19dd45a98a INT-3133: Add <spel-property-accessors> Support
* Add <spel-property-accessors> to configure a list of beans
that implement `org.springframework.expression.PropertyAccessor`
* Add `SpelPropertyAccessorRegistrar` to manage a list of PropertyAccessors
for Integration infrastructure
* Refactoring for `SpelFunctionRegistrar` and `IntegrationEvaluationContextFactoryBean`
to fix the issue when there is no `SpelFunctionRegistrar`(`SpelPropertyAccessorRegistrar`)
in the child AC, but there is one in the parent.
Previously the inheritance did't work for that reason.
* Now parent/child logic moved to `IntegrationEvaluationContextFactoryBean`
* Add documentation

JIRA: https://jira.springsource.org/browse/INT-3133

INT-3133: Rebasing, polishing and documentation

INT-3133: PropertyAccessors override support

* `@Ignore` `SOLingerTests#finReceivedNioLinger()` test

INT-3133: Change JavaDoc link to 3.0.0.RC1

Polishing

- Remove duplicate check - last bean def wins
- Doc Polishing
2013-09-24 16:55:08 -04:00
Gary Russell
00d9ba50ef INT-3146 Fix Another Test Timing Issue
Increase test timer for soTimeout detection.
2013-09-24 13:33:27 -04:00
Gary Russell
7c0c9e92fc INT-3146 Fix Test Timing Issue
Wait for server connection factory to start listening for new tests.
2013-09-24 12:30:06 -04:00
Gary Russell
f8cfecfc79 INT-3146 TCP SO Timeout with Caching Client CF
https://jira.springsource.org/browse/INT-3146

Incompatibility of using socket timeouts with a caching client
connection factory.

When a socket option timeout (soTimeout) is set on a TCP connection
and the timeout occurs, the socket is closed.

When a connection is intercepted, the close is performed through
the interceptor (for example to allow a closing handshake before the
physical close).

However, the caching client connection factory is implemented
using an interceptor, which returns the underlying connection to
the cache pool (for reuse). In the case of a TcpNetConnection,
the reader thread has terminated meaning that, the next time the connection
is used, no reply will ever be received.

The work-around (when using a gateway) is to use the 'remote-timeout'
attribute instead of relying on the soTimeout. There is no
work around when using collaborating channel adapters with a Net
connection. Using NIO works because there is no reader thread
in that case, but the socket is never closed on a timeout.

Always physically close the connection whenever an exception occurs
even if the close was delegated to an interceptor.

Add test cases for Net and NIO implementations.
2013-09-24 10:40:02 -04:00
Artem Bilan
f3d3f4ee4b INT-2998: Channel Adapters' Lifecycle Refactoring
* Add XSD attributeGroup `smartLifeCycleAttributeGroup`
* Use it for all adapters tags
* Refactoring `AbstractChannelAdapterParser` hierarchy
* Refactoring some `MessageHandler`'s that should not have `autoStartup` & `phase`.
    It is the responsibility of `AbstrctEndpoint`
* Polishing some tests according new logic

JIRA: https://jira.springsource.org/browse/INT-2998

INT-2998: Polishing

Polishing

 - Reformat schemas where indentation changed
 - Add SLC to the UDP inbound adapter
2013-09-23 17:58:58 -04:00
Gary Russell
772a01be79 INT-3098 TCP Suppress Error Log on Normal Close
Net connections suppress error logs, NIO connections did not.
2013-09-18 10:01:01 -04:00
Artem Bilan
35e8929f1c INT-3131: Compatibility with SPR 4.0
Polishing tests to follow with new changes in the SPR 4.0
Polishing build.gradle to be compatible with SPR 4.0

Build passes with SPR 3.2.4 too

JIRA: https://jira.springsource.org/browse/INT-3131
2013-09-03 11:08:08 -04:00
Gary Russell
9285867465 INT-3123 TCP Fix Error Propagation with Failover
The second chance NIO logic that detects a close being received
in a race condition with a reply needs to be enabled always because
a Failover or Caching connection factory might be using NIO
underneath.

Also, add an epoch to the FailoverTcpConnection's connectionId which
is incremented on each use to prevent a close after a previous
use being received by the current user.

Finally, add code in the FailoverTcpConnection to not propagate
messages from an old (defunct) delegate connection - if the
delegate has changed, the connection must be being used by
another client.
2013-08-29 14:51:44 -04:00
Gary Russell
06b06b1c8f INT-3103 Fix Connection Timeout Tests
Test cases could occasionally fail because an ErrorMessage is
now returned to the listener.
2013-08-26 22:01:24 -04:00
Gary Russell
0301f262e0 INT-3103 TCP Propagate Exceptions to GW Thread
Previously, when a calling thread was waiting for a reply, and an exception
occurred on the socket, the exception was not propagated to the thread and
it would eventually get a timeout, but with no indication of the problem.

Propagate the exception to the calling thread by invoking onMessage()
with an ErrorMessage.

Ignore the ErrorMessage in other TcpListeners (inbound adapter, gateway).

Ensure NIO closes are not missed by sending an ErrorMessage when the selector
thread detects a closed channel.

Add tests for Net, NIO, cached and failover connection factories.

Polishing

Remove left-over debug logs; add comment to setReply().

Add comments for ErrorMessages in onMessage().
2013-08-26 12:20:34 -04:00
Gary Russell
351af6b16b INT-3096 TCP Allow Stacking Cache and Failover
Support nesting the fail over and caching client connection
factories.

The TcpListener chain was not set up properly; this prevented
caching Failover connections, or Failover cached connections.

Each nested interceptor needs the next outer interceptor set
up as its listener, so the underlying connection calls
onMessage() all the way up to the ultimate listener (adapter
or gateway).

Fix the Listener hierarchy; add tests for caching failover
connections and failing over cached connections.

Don't overrwrite the actual connection id if it has already
been set up by a lower level wrapper.
2013-08-22 12:02:26 -04:00
Gary Russell
e73a5dc69f INT-3112 Fix OOM in SimplePool
The SimplePool maintains an 'allocated' set, for the sole reason
of preventing a "foreign" (non-managed) object being returned.

When a pool item is detected as stale, it is removed from the pool
but remains in the 'allocated' set.

Add a test to verify the allocated size is reduced when a stale
item is popped from the pool.

Add a FileTransferringMessageHandler test (where the problem was
discovered).

Fix a test in TCP to expect a close().

Polishing

Do not allow returning null items to just release a permit - it
cannot remove the item from allocated. Clients must return the
stale item to the pool so it can be refreshed on the next get.

Only used by the TCP caching CF when returning a connection when
the factory is not running; but should not be allowed.

Also, protect against double release - not currently an issue with
existing users of SimplePool, but should be protected against. Could
cause the permit count to exceed the pool size.

Add inUse Set to the pool so we can detect attempts to release an
item that has already been released.
2013-08-22 10:53:36 -04:00
Gary Russell
b8980d4064 INT-3111 Fix Close Cached TCP Connection
A TCP Connection is closed when an outbound gateway times out.

However, with the CachingClientConnectionFactory, the connection
was returned to the pool instead of being physically closed.

Override forceClose() and physically close the connection so the
next time it is retrieved from the pool it is detected as stale
and re-established.

Refactor test case and invoke it twice; once with a regular connection
factory and once with a cached factory.

Remove an unused logger.
2013-08-19 12:24:08 -04:00
Gary Russell
0699fdc6cf INT-1807 Add Mechanism For Headers with TCP
TCP streams have no standard message structure. Therefore, the
TCP implementation previously only transferred the message
payload.

If someone wanted to convey header information, they would have
to write their own wrapper and/or use Java serialization for
the entire message.

This change provides a strategy to allow users to determine
which headers are transferred, and how.

A MessageConvertingMessageMapper is now provided that invokes
any MessageConverter. A MapMessageConverter is provided that
converts the payload, and selected heades to a Map with two
entries ("payload") and ("headers").

A MapJsonSerializer is provided that converts a Map to/from
JSON. Jackson can't delimit multiple objects in a stream
so another serializer is required to encode/decode structure.
A ByteArrayLfSerializer is used by default, inserting a
linefeed between JSON objects.

The combination of these elements now allows header
information to be transferred over TCP. Of course, users
can implment their own (de)serializer to format the
bits on the wire exactly as needed by their application.

INT-1807 Polishing

Add a test that uses a Map MessageConverter with a
Java (de)serializer.

INT-1807: Polishing

INT-1807: Rebased and polished

Change `MapJsonSerializer` to use `JsonObjectMapper` abstraction

Doc Polishing
2013-08-16 16:54:00 -04:00
Gary Russell
ba557e617d INT-3099 Fix Package Tangle
Introduced by INT-3099 - tcp.connection and tcp.connection.event

Move events to connection.
2013-08-15 08:46:57 -04:00
Gary Russell
ccca04e830 INT-3099 Fix Javadoc 2013-08-14 18:46:12 -04:00
Gary Russell
5cbdfe9e43 INT-3099 Add IMAP Idle Application Events
Allow an application to be informed of problems on the IMAP idle
thread by emitting an event containing the exception.

Introduce IntegrationApplicationEvent hierarchy for all
events emitted by SI components.

INT-3099 Polishing (PR Comments)

Separate TCP events into discrete subclasses.
2013-08-14 17:42:57 -04:00
Gary Russell
14e556ce23 INT-2620 Fix Debug Log
New connection debug log should include this.getConnectionId() instead
of this.toString().

Noticed during backport to 2.2.x.
2013-06-11 16:40:58 +01:00
Artem Bilan
ecf15a9834 INT-2755: Support 'id' For <chain> Child Elements
* Introduce XSD 'id' attribute for all `<chain>` sub-components
* Register `<chain>` sub-components as Beans with names based on `<chain>` 'id'
* Generate aliases for sub-components based on element 'id'
* Add `<chain>` parser test to check sub-components as Beans within `BeanFactory`
* Ignore `NestedChainParserTests` as abnormal and confused for SI-configs
* Now `<chain>` sub-components are trackable by `MessageHistory`
* Now `<chain>` sub-components are eligible for JMX export
* Polishing some failed tests

https://jira.springsource.org/browse/INT-2755
https://jira.springsource.org/browse/INT-2321

INT-2755: Register as Beans only if 'id' provided

INT-2755: Set 'componentName' for handlers with 'id'

When components within `<chain>` are configured with an 'id' attribute
the 'componentName' of the handler is  constructed as:
chainHandler.componentName + '.' + handler.componentName.
Otherwise it is as was before.

INT-2755: Polishing

INT-2755: changes according PR's comments

* Add INFO about preference of `id` attribute for `<chain>` in the `ChainParser`
* Change `<chain>`'s sub-components `id` generation algorithm
* Configure `<chain>`'s sub-component `componentName` in the `ChainParser` instead of in the `MessageHandlerChain`
* Add `componentName` property to the `JpaOutboundGatewayFactoryBean`
* Add a note to the Reference Manual

INT-2755: Localize duplicate 'id' within chain

INT-2755: remove child beans aliasing

* Polishing tests
* Polishing docs

INT-2755 Polishing: Handle Nested Chain Bean Names

Previously named beans within a nested chain did not get unique
bean names.

INT-2755: Polishing nested chains

Doc Polishing
2013-05-21 12:26:27 -04:00
Gary Russell
474a00509b INT-2956 Fix NIO With Custom Deserializers
The TcpNioConnection uses an internal InputStream.

The standard deserializers only use the read() method.

Custom Deserializers might use read(byte[]); the
internal InputStream did not override these methods, possibly
causing the deserializer to hang awaiting data, when none
was coming.

Override these methods, with the appropriate semantics
from the super class...

- Block until at least one byte arrives.
- Return early if no data is available after at least one byte arrives.
- Return -1 if closed when no data arrived.
- Return the number of bytes actually read.

Polishing - PR Comments remove read(byte[]) because it doesn't do
anything different to the superclass method.
2013-05-07 12:36:22 -04:00
Gary Russell
b654044fd2 INT-2903 Fix Timing Problem in TCP Timeout Tests
Use latches and the new CLOSE event instead of arbitrary waits for
sockets to close.

Factor out common test code into setup methods.

removed system.out
2013-05-07 10:30:40 -04:00
Gary Russell
bf4005a92c INT-2620 Fix Race Condition in Failover Tests
Sporadic test failures (fairly consistently on Mac).

Problem was some tests sent a message to a client socket before the
close notification had been received.

Wait for client connection to close rather than waiting for the
server to stop.

Also, with NIO, close the channel on accept exception.

Also improve debugging by including a log of new connections
including the id.
2013-04-28 23:29:03 -04:00
Gary Russell
7908655883 INT-2982 Add Syslog Inbound Channel Adapter
* Supports UDP/TCP syslog messages.
* See docbook patch for more information.

For reference see: https://jira.springsource.org/browse/INT-2982
2013-04-23 23:36:36 -04:00
Gary Russell
00cb16ec21 INT-2996 Fix Class and Package Cycles
INT-2996 Fix Package Cycle

Move interface ...store.MetadataStore to ...store.metadata.

INT-2996 Fix Class Tangle

TcpConnectionEvent incorrectly referenced the
concrete TcpConnectionSupport instead of TcpConnection.
2013-04-16 19:10:48 -04:00
Gunnar Hillert
05062aa0b2 INT-2964 Various JavaDoc Fixes
INT-2964 - JavaDoc: <emphasis> should be <em>

INT-2964 - JavaDoc: <p/> should be <p>

INT-2964 - JavaDoc polishing

* <li></li> should be wrapped in <ul></ul>
* wrap code snippets in {@code myCode()}
* change <code>false</false> to <code>false</code>

INT-2964 - Polish - Fix more JavaDoc errors

* Mockito-all dependency causes JavaDoc error. Change dependency to Mockito-Core.
2013-04-15 17:11:38 -04:00
Gunnar Hillert
0271acaf4c INT-2916 - Upgrade to JUnit 4.11 in support of JDK7
For reference see: https://jira.springsource.org/browse/INT-2916

Changes:

* INT-2919 - Upgrade Spring Data Gemfire to 1.2.2.RELEASE
* Exclude Hamcrest transitive dependency from JUnit (as already explicitly declared)
* Set sourceCompatibility in build.gradle to 1.6
* Set targetCompatibility in build.gradle to 1.6
* Upgrade Hamcrest to 1.3 and fix deprications
  - Corematcher is(*class) change to is(instanceOf(*class))
  - Change org.junit.internal.matchers.TypeSafeMatcher to org.hamcrest.TypeSafeMatcher
  - Change import org.junit.matchers.JUnitMatchers.containsString to org.hamcrest.CoreMatchers.containsString
  - Change import org.junit.matchers.JUnitMatchers.both to org.hamcrest.CoreMatchers.both
  - Change import org.junit.matchers.JUnitMatchers.containsString to org.hamcrest.CoreMatchers.containsString
* Fix JUnit deprecations
  - changed junit.framework.Assert to org.junit.Assert
* Add few missing licenses headers to tests
* Marked several test classes with: @DirtiesContext(classMode=ClassMode.AFTER_EACH_TEST_METHOD)
  - SplitterIntegrationTests
  - GatewayInvokingMessageHandlerTests
  - FileToChannelIntegrationTests
  - FileInboundChannelAdapterWithRecursiveDirectoryTests
  - JdbcMessageStoreChannelTests
  - ChatMessageInboundChannelAdapterParserTests
* 3 Tests ignored (Still needs to be addressed):
  - testOperationOnPrototypeBean
  - testFailOperationWithCustomScope
  - testOperationOfControlBus
* Update SQL script (test-failure):
  - spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundSchema.sql
  - add drop table statements
  - add ignore-failures="DROPS" to "jdbcOutboundChannelAdapterCommonConfig.xml"

INT-2916 - Code Review Changes

INT-2916 - Fix ignored Tests

Fix 3 previously ignored tests in *GroovyControlBusTests*:

* testOperationOnPrototypeBean
* testFailOperationWithCustomScope
* testOperationOfControlBus

INT-2916 - CI Build Testing

INT-2963 - Remove JDK7 Compilation Warnings

* Upgrade Mockito to 1.9.5
* Fix failing SubscribableJmsChannelTests

INT-2916 - Standardize Hamcrest assertions
Ensure Hamcrest assertions are standardized to: is(instanceOf(...))
2013-04-04 13:40:46 -04:00
Gary Russell
d059abf4d1 INT-2932 TCP Connection Events - Doc and Polishing
INT-2932
- Reference Documentation

INT-2941
- Add getter for Throwable
- Add auto-startup to Parser, Endpoint (already in schema)
- Add phase to schema, Parser

(Schema changes are mostly indentation because the element now
extends SmartLifecycleType).
2013-03-07 17:26:32 -05:00
Gary Russell
f48d175e83 INT-2936 Fix TCP Binary DeSerialization with NIO
Inadvertent sign extension on binary data with bit 7 set
causes early termination of binary deserializers.

The ChannelInputStream (which replaced the piped input
and output streams) failed to mask off the top 24 bits
of "normal" bytes received, causing Deserializers to
believe the stream was closed.

Add a mask of 0xff to bytes read.

Add a test case.
2013-02-25 12:57:17 -05:00
Gary Russell
05cd1694c2 INT-2940 Fix Race Condition in TCP Connection Test
Assertion that server side connection was established could
occur after the connection was established, but before it was
added to the collection.

Add a latch.
2013-02-20 10:44:42 -05:00
Gunnar Hillert
bb5bd1169e Merge pull request #743 from garyrussell/INT-2877
* garyrussell-INT-2877:
  INT-2126 Add TcpConnection Event Publisher
2013-02-14 12:48:23 -05:00
Gary Russell
b045e8c2be INT-2126 Add TcpConnection Event Publisher
Reference: https://jira.springsource.org/browse/INT-2126

* Add TcpConnectionEvent for OPEN, CLOSE, EXCEPTION.
* Add Event Type Enum - Provides type safety for event types.
* Add <int-ip:tcp-connection-event-inbound-channel-adapter />
* Add the ability to filter events (restrict to one or more subclasses)
* Add publishEvent() to TcpConnectionSupport to permit, for example, connection interceptors to publish events via the connection, but the event source can only be the connection used to publish the event.
* Add documentation to Reference Documentation section *What's New*

INT-2871 Provide Mechanism to Find TCP Connections
Reference: https://jira.springsource.org/browse/INT-2871

* Add getOpenConnectionIds() to Abstract Connection Factory
* Add closeConnection(String connectionID)
* Introduce removeClosedConnectionsAndReturnOpenConnectionIds

INT-2877 TCP Extension Improvements
Reference: https://jira.springsource.org/browse/INT-2877

* Make improvements to make extension easier.
* Add setCustomHeaders() to mapper.
* Add mapper to connection factory namespace parser.
* Add plumbing for stateful Deserializers.
* Refactor setting standard headers
* rename setCustomHeaders to supplyCustomHeaders - returning a Map and not exposing the MessageBuilder to subclasses

INT-2872 Remove Deprecated Items in ip Module
Reference: https://jira.springsource.org/browse/INT-2872

* pool-size Attribute
* setScheduler
* TcpSendingMessageHandler.getConnection()
* Deprecated attribute on TCP Connection Factory.
2013-02-14 12:05:08 -05:00
Gary Russell
84e9c0ec36 INT-2911 IO Exceptions Not Logged as ERROR
TcpNetConnection IO errors were only logged under DEBUG.

* Code was added to suppress the error log when the exception was due to a normal close. This inadvertently suppressed all ERROR logs.
* Capture a local copy of this.noReadErrorOnClose before closing the socket after an exception.
* Add test case to ensure ERROR log is emitted.
2013-02-13 12:34:18 -05:00
Gary Russell
91722b7a5f INT-2830 Resolve Class Tangle
* MessageGroupStore <-> MessageGroupCallback
  - Change callback to be an inner interface of the MGS.
* INT-2829 Fix Class Tangle in IP Module
  - 3 way tangle between TcpSender, TcpConnection, TcpMessageMapper
  - Clean up interfaces (remove setters); add top-level support classes for TcpConnection, TcpConnectionInterceptor.
* INT-2829 Remove TCP Package Tangle
  - tcp.connection <-> tcp.connection.support
  - Remove ...connection.support package - move classes to ...connection.
2013-02-08 17:58:17 -05:00