Commit Graph

7448 Commits

Author SHA1 Message Date
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
Gary Russell
f88a97332a Merge pull request #736 from nickspacek/INT-2920 2013-02-08 16:33:30 -05:00
Nick Spacek
6e6d1c60c9 INT-2920 Fix two hits to MessageStore
Reduce ClaimCheckOutTransformer's hits to the MessageStore.

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

Add @author and update copyright

Fixed missing semi-colon
2013-02-08 16:32:36 -05:00
Gunnar Hillert
9c7116a936 Merge pull request #740 from garyrussell/INT-2923
* garyrussell-INT-2923:
  INT-2923 3.0 Reference Changes
2013-02-08 15:07:24 -05:00
Gary Russell
8fd5995f78 INT-2923 3.0 Reference Changes
Move 2.2. "What's New" to Change History Appendix.
2013-02-07 16:39:33 -05:00
Gary Russell
35919ea2ee Merge pull request #738 from ghillert/INT-2697 2013-02-07 11:48:06 -05:00
Gunnar Hillert
e66c16bb44 INT-2697 - Remove Bundlor from build.gradle
For reference: https://jira.springsource.org/browse/INT-2697
2013-02-07 10:45:46 -05:00
Gary Russell
88782b8a34 INT-2921 Add 2013 to Reference Manual Copyright 2013-02-06 18:30:52 -05:00
Gunnar Hillert
0a24267041 Merge pull request #731 from garyrussell/INT-2915
* garyrussell-INT-2915:
  INT-2915 JMS Remove Deprecated Attributes
2013-02-06 16:44:02 -05:00
Gary Russell
501982c47d INT-2915 JMS Remove Deprecated Attributes
delivery-mode was deprecated (in favor of delivery-persistent)
in 2.0. Remove attribute from schema and parser.

Unfortunately, the setter on the gateway was never deprecated
so there is a possibility someone is using it programmatically,
with no knowledge that it is going away.

Deprecated the setter.

Also, added schema documentation for several attributes where
no documentation was provided.
2013-02-06 16:33:42 -05:00
Gary Russell
6d53e4b61c Merge pull request #726 from artembilan/INT-2908 2013-02-05 14:13:59 -05:00
Artem Bilan
f9f2d65477 INT-2908 Fix JMS Tests Concurrency Issue
Fix concurrency issues with timeouts field.

JIRA: https://jira.springsource.org/browse/INT-2908
2013-02-05 14:12:25 -05:00
Gary Russell
e9b47ff024 Merge pull request #712 from artembilan/INT-2893 2013-02-05 12:51:58 -05:00
Artem Bilan
dc59207df2 INT-2893: fix chain -> router -> bean or script
* add XSD element for nested router type
* add tests on the matter
* polishing for RouterParserTests

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

INT-2893: Polishing

INT-2893: after rebasing to 3.0

XSD changes reverted from 2.2 and moved to 3.0

INT-2893 Polishing

Factor out common elements; fixing missing documentation for
`expression` within a `router` within a `chain`.
2013-02-05 12:30:19 -05:00
Gunnar Hillert
90c54c5f74 Merge pull request #718 from garyrussell-INT-2682
* garyrussell-INT-2682-2:
  INT-2682 JMS GW - Support Expression for replyDest
2013-02-05 09:51:44 -05:00
Gary Russell
86d6d970d1 INT-2682 JMS GW - Support Expression for replyDest
Currently supports destination and destination name.

* Add support for replyDestinationExpression.
* Add Docs for JMS Outbound Gateway Attributes.
* Change method name for consistency.
2013-02-05 09:48:35 -05:00
Gunnar Hillert
ed4fe234c7 Merge pull request #717 from garyrussell/INT-2825
* garyrussell-INT-2825:
  INT-2825 Remove Temporary 2.2. Interface
2013-02-04 17:42:08 -05:00
Gary Russell
a127a46083 INT-2825 Remove Temporary 2.2. Interface
AbstractTransactionSynchronizingPollingEndpoint was introduced late in the 2.2 release process to avoid a breaking change to AbstractPollingEndpoint. For 3.0, its methods are now pulled-up into APE.

Further change:

* remove Deprecated Setter (PollerMetadata)
* fix failing test
2013-02-04 17:40:56 -05:00
Gary Russell
f3e59cda26 Merge pull request #725 from artembilan/INT-2907 2013-02-01 19:00:53 -05:00
Gary Russell
ef29d6b2a2 INT-2913 Fix Looping Mail Tests
Causes excessive CPU utilization and OOM Errors with
Gradle 1.4 (and 1.2 on some platforms).

Stop adapters when tests complete.
2013-02-01 18:58:27 -05:00
Artem Bilan
c4ca84e20b INT-2907: Upgrade to Gradle 1.4
JIRA: https://jira.springsource.org/browse/INT-2907
2013-02-01 16:01:04 -05:00
Gary Russell
3d9c87efe4 Merge pull request #721 from artembilan/INT-2884 2013-02-01 15:56:47 -05:00
Artem Bilan
877c62c5e7 INT-2884: Refactor Stream Tests to Use Mocks
Avoid hijacking stdout, stderr because the tests failed
when logging was enabled.
2013-02-01 15:50:52 -05:00
Mark Fisher
a9369a1ecf Merge pull request #716 from garyrussell/INT-2873
* INT-2873: Create 3.0 Schemas
2013-01-25 17:56:28 -05:00
Gary Russell
451beb424a INT-2873 Create 3.0 Schemas
Copy schemas, cleanup whitespace, update spring.schemas files,
update version in AbstractIntegrationNamespaceHandler.

For each schema compared the 2.2 version with the 3.0 version
(diff -w), ensuring the only difference is the import of
3.0 schemas (where appropriate) instead of 2.2.
2013-01-25 16:12:00 -05:00
Gary Russell
ac5263c5e9 Update Master to 3.0.0.BUILD-SNAPSHOT 2013-01-25 15:26:02 -05:00
Spring Buildmaster
e6bed29471 [artifactory-release] Next development version 2013-01-25 12:03:12 -08:00
Spring Buildmaster
a949b75317 [artifactory-release] Release version 2.2.1.RELEASE 2013-01-25 12:03:04 -08:00
Gary Russell
0c95a8f5bc INT-2902 Fix Groovy Test Timing Problem
A message could be released by the delayer before
the scheduler was destroyed.
2013-01-25 13:31:29 -05:00
Mark Fisher
afe6f25b81 Merge pull request #715 from garyrussell/INT-2895
* INT-2895: Update Bundlor Ranges for 2.2.1
2013-01-25 12:40:21 -05:00
Gary Russell
b1921607d9 INT-2895 Update Bundlor Ranges for 2.2.1 2013-01-25 12:31:09 -05:00
Mark Fisher
c817280ed9 Merge pull request #713 from garyrussell/INT-2894
* INT-2894: Do Not Leak ThrowableHolderException
2013-01-23 17:32:40 -05:00
Gary Russell
d928105ef1 INT-2894 Do Not Leak ThrowableHolderException
The AbstractRequestHandlerAdvice uses an internal wrapper for
Throwable, in a similar fashion to the TransactionInterceptor.

Exceptions are unwrapped properly when exiting the invoke method so
callers are unaware of the wrapping.

The technique is used to avoid user errors (for example catching OOM
Errors and not propagating). User code (subclasses) only catch
Exceptions.

However, in the case of the ExpressionEvaluatingRequestHandlerAdvice,
the exception is included in any ErrorMessage sent to a failureChannel.

User code should not have to navigate these internal exceptions within
the cause tree.

Add a method to the abstract class unwrapExceptionIfNecessary, which
will unwrap the root cause exception if possible.

Add a method to the abstract class unwrapThrowableIfNecessary, which
will unwrap the root cause Throwable if possible.

Update tests to reduce the cause() traversals to reflect the
ThrowableHolderExceptions are no longer in the tree.

Add a test to verify a Throwable (such as an OOM) is properly
propagated.

Add a test to verify that when the root cause is a Throwable (and not
an Exception), the ErrorMessage sent to the failureChannel does not include
the ThrowableHolderException.

qualified inner class @links (when merging)
2013-01-23 17:26:20 -05:00
Mark Fisher
cc6f07966f Merge pull request #699 from garyrussell/INT-2874
* INT-2874: Fix JSON/JMS Incompatibility
2013-01-23 13:07:33 -05:00
Gary Russell
3902c96a20 INT-2874 Fix JSON/JMS Incompatibility
2.2.0 changed ObjectToJsonTransformr to add content-type to
simplify AMQP applications.

However, in a JMS environment, the DefaultJmsHeaderMapper attempted
to map (and failed) to map the header, emitting a warning log entry.

JMS does not allow '-' in property names.

Add code such that:

1. If the ObjectToJsonTransformer is configured to use a
content-type of an empty String (after trimming), suppress the
addition of the header to the output message. For consistency, if
the inbound message already has a content type header, and the transformer
is configured with an empty String, remove the header.

2. Change the DefaultJmsHeaderMapper to map the MessageHeaders.CONTENT_TYPE
header (content-type) to/from a JMS compliant property name (content_type).

INT-2874 PR Comments

Move constant to JmsHeaderMapper interface and rename.

Fix failing test (explicit set content-type to "").

INT-2874 Documentation Updates

Add docbook and schema documentation clarifying the behavior
of the transformer with respect to setting the `content-type`
header.

INT-2874 Polishing - Remove Header Removal

After further discussion, we decided to not remove an
existing header, if 'content-type' is set to "".

This is because there was no way to handle the case of
NOT adding a header when none present, while retaining a
header if it was already present.

added test for empty content-type attrib and no existing header (while merging)
2013-01-23 13:00:42 -05:00
Mark Fisher
ed3cfe0271 Merge pull request #702 from garyrussell/INT-2876
* INT-2876: Use Custom InputStream For NIO
2013-01-22 16:12:12 -05:00
Gary Russell
462e0f8cb1 INT-2876 Use Custom InputStream For NIO
Previously TcpNioConnection used a pair of Piped(In|Out)putStreams
to pass data from the read event to the deserializer.

However, it is possible to get a 'Broken Pipe' exception if the
last thread that wrote to the pipe terminates.

Replace the use of this pair of streams with an inner class
ChannelInputStream, which provides the same functionality, but
with no dependency on threading.

Uses a BlockingQueue to store read buffers which are consumed by
the message assembler thread (read from the InputStream in the
Deserializer). To avoid OOM conditions, the queue is limited to
5 "unread" buffers; and a timeout will occur if the reader
doesn't consume some data to free up space in the queue.
2013-01-22 16:03:48 -05:00
Mark Fisher
a8aea3df17 Merge pull request #711 from garyrussell/INT-2890
* INT-2890: Remove Hard-Coded Port from HTTP Tests
2013-01-22 15:23:22 -05:00
Gary Russell
a6c8ba74b7 INT-2890 Remove Hard-Coded Port from HTTP Tests
Conflicts with other ports on build server.

Use SocketUtils to find an available port.
2013-01-22 15:20:58 -05:00
Mark Fisher
11e303744e Merge pull request #708 from garyrussell/INT-2886
* INT-2886: Fix TCP Connection Exception
2013-01-22 15:16:20 -05:00
Gary Russell
e72b101c52 INT-2886 Fix TCP Connection Exception
When an exception occurred while obtaining a connection,
the root cause was lost.

In addition, a MessageMappingException was thrown instead
of a MessageHandlingException.

- Deprecate getConnection() in favor of obtainConnection()
- Capture the underlying exception as the cause of a MessageHandlingException
- Add test case

fixed @link (when merging)

removed @return with no args (when merging)
2013-01-22 15:10:24 -05:00
Mark Fisher
3245fa58dc Merge pull request #698 from garyrussell/INT-2860
* INT-2860: Improve TCP Connection Timeout
2013-01-22 14:29:43 -05:00
Gary Russell
e4722de464 INT-2860 Improve TCP Connection Timeout
A connection used by a gateway may timeout prematurely.

Previously, the socket read timeout simply controlled when
a socket would be closed after the timeout occurred.

Consider a connection with so-timeout set to 10 seconds; the
application initializes at T+0 and the first message is sent,
with the server responding immediately; the timeout clock starts.
Next, a message is sent at T+5 to a service that takes 6 seconds
to respond. The connection will timeout at T+10 before the
response is received; the socket is closed and client does not
receive the response.

The solution is to wait 2 timeout cycles *IF* a message has
been sent within the current timeout.

Maintain a timer for the last send() operation. When a socket
timeout occurs, examine the last sent time; if within the
timeout, defer the close until the next timeout.

We cannot simply rely on the last send time because, when
using collaborating adapters, continuous sends (with no replies)
would defer the close indefinitely. Hence, the second test looking
to see if we have not had a successful read for the last 2 timeouts.

NIO does not directly support socket timeouts (because there is no
thread hanging on the read); instead, the timeout logic is
performed on the selector thread.

Rename DefaultTimeoutTests to ConnectionTimeoutTests.

Add tests (for both Socket and NIO connections) to assert the correct
operation when a send is performed within a timeout, as well as
when the server takes > 2x the timeout to respond.

INT-2860 Fix Typo in Exception Message

Error sending meeeage.

removed invalid comment from test (while merging)
2013-01-22 14:23:23 -05:00
Mark Fisher
be29f909ba Merge pull request #695 from garyrussell/INT-2861-2862
* INT-2861-2862:
  INT-2861/INT-2862 TCP Outbound Gateway Fixes
2013-01-22 12:30:51 -05:00
Gary Russell
90132686ae INT-2861/INT-2862 TCP Outbound Gateway Fixes
INT-2861

Close connection after 'remoteTimeout' because the
socket is dirty (may contain an in-flight reply).

Add test that demonstrates the problem and that it
is resolved.

INT-2862

Remove entries from pendingReplies (map of async responses
for which we are waiting).

Add an assertion to the above test to ensure cleanup.
2013-01-22 12:28:48 -05:00
Mark Fisher
e66a098149 Merge pull request #710 from garyrussell/INT-2889
* INT-2889: Fix Concurrency Problem in Type Converter
2013-01-18 15:36:47 -05:00
Gary Russell
1e9581b3a5 INT-2889 Fix Concurrency Problem in Type Converter
In the BeanFactoryTypeConverter, when falling
back to a PropertyEditor (when the source is non-
String and the target is String), the setValue() and getAsText()
methods are used.

This is not thread-safe and one thread might get another's
converted value.

Synchronize the use of the PropertyEditor.

Add test, that reliably reproduces the problem, to verify the
fix.
2013-01-18 15:31:21 -05:00
Gunnar Hillert
f3772914f2 Merge pull request #701 from garyrussell/INT-2838
* garyrussell-INT-2838:
  INT-2838 Allow @bean Expressions in (S)FTP Out
2013-01-18 13:01:36 -05:00
Gary Russell
969b3bec27 INT-2838 Allow @bean Expressions in (S)FTP Out
The message processors previously did not have a bean resolver.

* Add the bean factory
* Add tests
2013-01-18 12:57:27 -05:00
Gunnar Hillert
58a5fa3be8 Merge pull request #706 from garyrussell/INT-2864
* garyrussell-INT-2864:
  INT-2864 Enforce Ref/Expression Mutual Exclusivity
2013-01-18 12:48:01 -05:00