Commit Graph

7448 Commits

Author SHA1 Message Date
Gary Russell
dd6af7b387 INT-2864 Enforce Ref/Expression Mutual Exclusivity
Delegating consumer endpoints (<service-activator/> etc)
may not have both 'expression' and 'ref' attributes.
Previously, 'expression' was ignored when 'ref' was present.

- Enforce mutual exclusivity in AbstractDelegatingEndpointParser.
- Add tests for illegal combinations.
- Improve error message when 'method' used with <expression/>.
- Change parser to use reader.error() instead of Assert.
- Add element description to all parser errors.
2013-01-18 11:56:00 -05:00
Gary Russell
e64a167479 INT-2885 Remove DOS Newlines
MessageGroupStoreReaper
2013-01-16 13:37:22 -05:00
Gary Russell
05021f1e24 Merge pull request #705 from artembilan/INT-2880 2013-01-16 13:12:49 -05:00
Artem Bilan
03053a8450 INT-2880 Fix System.out Concurrent Race Condition
Gradle may run tests using multiple threads.

Using shared resources (e.g. `System.out`) may produce concurrency issues.

* Remove usage of `System.out`
* Add mocking around `LoggingHandler#messageLogger`.

JIRA: https://jira.springsource.org/browse/INT-2880
2013-01-16 13:10:54 -05:00
Gary Russell
3b2489ea3e Merge pull request #704 from artembilan/INT-2878 2013-01-16 12:55:07 -05:00
Artem Bilan
2a419ba6d8 INT-2878: MessageGroupStoreReaper's Lifecycle Fix
`MessageGroupStoreReaper` continues to expire `MessageGroups` via `scheduled-task`
when not `running`.

* Add check `isRunning()` to `run()` & `destroy()`
* Additional `MessageGroupStoreReaper` polishing
* Add test-case

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

INT-2878: Polishing : PR Comments
2013-01-16 12:54:22 -05:00
Gary Russell
b48bed486f INT-2868 Fix SSL Key Store Resource Handling
Documentation indicates that the keystore and truststore
arguments can be resource patterns (file:..., classpath:..., etc)
but the code always used a ClasspathResource.

Use a PathMatchingResourcePatternResolver to interpret the
pattern correctly.

Add tests.
2013-01-16 12:39:12 -05:00
Gary Russell
df6a8dee04 Merge pull request #693 from artembilan/INT-2858 2013-01-16 12:06:13 -05:00
Artem Bilan
a994b40b47 INT-2858: Fix for Repeatable invocation.proceed()
Heretofore there wasn't ability to make some scenario like this, when we want to make failure notification on each retry:

<service-activator>
  <request-handler-advice-chain>
      <bean class="org.springframework.integration.handler.advice.RequestHandlerRetryAdvice"/>
      <bean class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice"
	    p:onFailureExpression="#exception" p:failureChannel-ref="errorOnEachRetryChannel"/>
  </request-handler-advice-chain>
</service-activator>

The second Advice was invoked only once. This was because `ProxyMethodInvocation` keeps the index of current interceptor
on each `invocation.proceed()`, which is recursive by design.

So, change `AbstractRequestHandlerAdvice` to use `((ProxyMethodInvocation) invocation).invocableClone().proceed();`
This way, we get a fresh `MethodInvocation` for the current `Advice` with nested desired advices.

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

INT-2858: Polishing; PR Comments

Introduce `AbstractRequestHandlerAdvice.ExecutionCallback#cloneAndExecute()` especially for repeatable Advices, e.g. `RequestHandlerRetryAdvice`
to avoid overhead from `clone()` on simple Advices

INT-2858: Doc ExecutionCallback#cloneAndExecute()

INT-2858 Polishing

Rework docs; add Javadoc; add to test case.
2013-01-16 12:04:03 -05:00
Gunnar Hillert
0ff2a2027b Merge pull request #700 from garyrussell/INT-2875
* garyrussell-INT-2875:
  INT-2875 Fix CPU Usage In JMS Test
2013-01-15 15:24:23 -05:00
Gary Russell
c958b243d3 INT-2875 Fix CPU Usage In JMS Test
Reply Container was spinning receiving StubMessages.

Set auto-startup to false on the gateways configured with
a <reply-listener/>.
2013-01-15 15:11:02 -05:00
Gary Russell
f3b1c9d9d2 Merge pull request #696 from ferstl/INT-2863 2013-01-15 13:15:32 -05:00
Stefan Ferstl
f9aea7d5f5 INT-2863 Add Release Strategy to Resequencer
- allow the configuration of release strategies on resequencers
-- adjust the xsd to allow the definition of a release strategy
-- move release strategy parsing to AbstractCorrelatingMessageHandlerParser
-- add unit tests

For reference see: https://jira.springsource.org/browse/INT-2863

INT-2863 Polishing

Fix white space; add @author; update copyright.

INT-2863 Resequencer/Aggregator Docs

Add docs for correlation and release strategis to Resequencer.

Add *.expression docs to Aggregator.
2013-01-15 13:04:56 -05:00
Gunnar Hillert
3c59d377f4 Merge pull request #703 from garyrussell/INT-2847
* garyrussell-INT-2847:
  INT-2847 Fix Test with Java 7
2013-01-14 23:50:27 -05:00
Gary Russell
ef48e6ad10 INT-2847 Fix Test with Java 7
Java 7 stores the comparator directly in the PriorityBlockingQueue
rather than in a nested PriorityQueue as in earlier JDKs.
2013-01-14 23:48:38 -05:00
Gary Russell
bcaf11c3f8 Merge pull request #694 from dturanski/INT-2859 2013-01-14 12:07:40 -05:00
David Turanski
50bea87e0e INT-2859 Fix Python OOM Error
INT-2859 - Remove Unnecessary Guard Condition
2013-01-14 12:06:20 -05:00
Gary Russell
0cbde92b5a Merge pull request #691 from artembilan/INT-2845 2013-01-14 10:48:26 -05:00
Artem Bilan
2bc3ecb9d7 INT-2845: Gradle: Check XSD Versions in Tests
In many cases IDEs import into test configs Namespace-resources
with hardcoded versions of Spring & Spring Integration XSDs.

This may produce build issues with different Spring versions.

It also causes an issue during the transition to a new Spring Integration version (e.g. 3.0).

* Add Gradle task 'checkTestConfigs' to check test configs for hardcoded resources' versions.
* Add to 'test' task dependency on new task 'checkTestConfigs'
* Fix hadrcoded versions in the test configs.

JIRA: https://jira.springsource.org/browse/INT-2845
2013-01-14 10:45:03 -05:00
Gary Russell
a80c6e9ce6 Merge pull request #692 from artembilan/INT-2846 2012-12-03 08:57:54 -05:00
Artem Bilan
24bdd39790 INT-2846: ImapMailReceiverTests: fix OS newLine
* Add `trim()` to the actual value
* Remove '\n' from expected value
* Remove redundant Mocks

JIRA: https://jira.springsource.org/browse/INT-2846
2012-12-03 12:40:21 +02:00
Gary Russell
2d6239edd1 INT-2844 Fix Http Test If Building With Spring 3.0
In Spring 3.1, DefaultResponseErrorHandler.getResponseBody() is
tolerant of a null InputStream on the response. With Spring 3.0
a null response causes an assertion exception.

The mock in the tests was not set up to return an InputStream
and so the test failed when building with Spring 3.0.

Configure the mock to return an empty InputStream.

Also added a text response to response.getStatusText().

Tested with Spring 3.0 and 3.1.
2012-12-01 14:08:57 -05:00
Spring Buildmaster
4f606d9c46 [artifactory-release] Next development version 2012-11-30 14:25:59 -08:00
Spring Buildmaster
d195747c4b [artifactory-release] Release version 2.2.0.RELEASE 2012-11-30 14:25:48 -08:00
Mark Fisher
675dc4cf60 Merge pull request #689 from ghillert/INT-2843
* INT-2843: Doc: with 2.2 Java serialization over HTTP not enabled by default

* INT-2842: Doc: Re-order 'What's New in 2.2' section
2012-11-30 16:19:59 -05:00
Gunnar Hillert
37ad09ab55 INT-2843 - Document that with 2.2 Java serialization over HTTP is not enabled by default
INT-2842 - Doc: Re-order 'What's New in 2.2' section

For reference see:

* https://jira.springsource.org/browse/INT-2842
* https://jira.springsource.org/browse/INT-2843
2012-11-30 16:05:30 -05:00
Gary Russell
3d0ffd2e7b INT-2833 Fix Test Race Condition
Empty message group expiry used a < test instead of <=. This caused
the group in the test to be not deleted when it was expected to be.
2012-11-30 15:56:21 -05:00
Mark Fisher
120410f78c Merge pull request #683 from garyrussell/INT-2832-2833
* INT-2832-2833:
  INT-2832/2833 Aggregator Fix and Documentation
2012-11-30 15:38:57 -05:00
Gary Russell
3ea05576b3 INT-2832/2833 Aggregator Fix and Documentation
Expire empty groups.

Due to indentation changes, the code changes look more extensive
than they are. In effect the if (group.size() > 0) test is moved
to a narrower scope and the remove(group) is now performed if the
group is empty.

Document expire-groups-upon-completion.

INT-2832 Doc Polishing

PR Review + punctuation.

INT-2833 Add Delay For Expiring Empty Groups

minimumTimeoutForEmptyGroups
2012-11-30 15:31:36 -05:00
Mark Fisher
84f4bea5e7 Merge pull request #685 from garyrussell/INT-2837a
* INT-2837a:
  INT-2837 Fix Accept Hdr for Serializable Response
2012-11-30 13:59:01 -05:00
Gary Russell
7ef66e2e3f INT-2837 Fix Accept Hdr for Serializable Response
When the expected-response-type was Serializable,
no Accept: header was added.

The SerializingHttpMessageConverter overrides
canRead() from the superclass.

The superclass method allows null in the mediaType
parameter to return true. RestTemplate.AcceptHeaderRequestCallback
calls canRead() with null in the mediaType, preventing
the Accept header from being completed.

Remove the overridden method.

INT-2837 Disable Java Serialization over Http

Previously, Java serialization was enabled by default by
adding the SerializingHttpMessageConverter to the converter
lists (inbound and outbound endpoints). However, there was
a problem in that the Accept header was not set properly on
outbound requests.

Correcting the header could cause other side effects, such as
existing JSON applications using Java serialization instead.

It was felt that it would be safest to disable Java serialization
by default, while retaining the ability to use Java serialization
by explicitly configuring the message converter.

Update tests to deal with the fact the converter is not
configured by default.

INT-2837 Fix Schema Version in Test

Inadvertently added a spring 3.1 schema version.
2012-11-30 13:40:58 -05:00
Mark Fisher
4ce08ad6dc Merge pull request #688 from ghillert/INT-2841
* INT-2841: Fix broken links
2012-11-30 12:04:38 -05:00
Gunnar Hillert
a54312dc6f INT-2841 - Fix broken links 2012-11-30 12:03:12 -05:00
Mark Fisher
28fa4407b9 Merge pull request #687 from ghillert/INT-2840
* INT-2840: Fix build failure against Spring 3.0.7

For reference see: https://jira.springsource.org/browse/INT-2840
2012-11-30 11:56:55 -05:00
Gunnar Hillert
911ddc11af INT-2840 - Fix build failure against Spring 3.0.7
For reference see: https://jira.springsource.org/browse/INT-2840
2012-11-30 00:09:51 -05:00
Gary Russell
734eae72a7 INT-2839 Fix Test Race Condition
A secondary part of the new gateway test was to ensure we
reused the cached connection. However, there was a race condition
in that the connection may not yet have been returned to the pool
by the reader thread that received the response.
2012-11-29 21:30:52 -05:00
Mark Fisher
3d04e15fd3 Merge pull request #686 from garyrussell/INT-2839
* INT-2839: Fix TCP Caching Connections with Gateways
2012-11-29 21:06:39 -05:00
Gary Russell
32251bf6f2 INT-2839 Fix TCP Caching Connections with Gateways
Using the CachingClientConnectionFactory with a gateway
doesn't work. The Listener (gateway) was not being set up
properly by the wrapper. Instead, the actualListener in the
wrapped connection was set to null. This caused the connection
to "close" itself (return to the pool) immediately after the send.

In addition, even with the actualListener set up to properly
reference the gateway, it still wouldn't work because the
gateway can't correlate the reply (the cached connectionId is
prefixed with "cached:" so the gateway can't find the reply.

Further, when onMessage() returned, it caused the reader loop
to end.

Fixes:

1. Properly set up the cached connection with the real listener
so that ultimately the underlying connection sees there is an
actualListener and so doesn't close itself after the send.
2. Override getListener() on the cached connection to return the
real listener.
3. Override onMessage() in order to fix up the connection id in
the message, and return true (intercepted) so the connection doesn't
close itself (terminate the reader thread).
4. close() (return to the pool) after invoking the gateway's
onMessage().
5. Add test cases to verify proper operation including an assertion
that the pooled connection is reused.

This is made a little more complex by the tangle between
connections and connection interceptors; mainly because single-use
connections close themselves after use. This will be addressed in
3.0 (INT-2829) making connection interceptors simpler.
2012-11-29 15:17:24 -05:00
Spring Buildmaster
734c3308ff [artifactory-release] Next development version 2012-11-21 15:44:15 -08:00
Spring Buildmaster
f39251ff49 [artifactory-release] Release version 2.2.0.RC3 2012-11-21 15:44:07 -08:00
Gunnar Hillert
12375ec052 Merge pull request #682 from garyrussell/INT-2828
* garyrussell-INT-2828:
  INT-2828 Remove Package Tangle
2012-11-21 17:45:35 -05:00
Gary Russell
c4a4b59848 INT-2828 Remove Package Tangle
* Remove Class Tangle in JPA
* tcp.connection
* tcp.connection.support
* Add Comment to MessageGroupCallback
  - Comment that it is moving into MGS in 3.0.
  - Convert DOS newlines to Unix.

For reference see: https://jira.springsource.org/browse/INT-2828
2012-11-21 17:44:02 -05:00
Gary Russell
9bed860838 Merge pull request #680 from ghillert/INT-2826 2012-11-21 09:29:01 -05:00
Gunnar Hillert
1709028d14 INT-2686 MessageGroupQueue Optimization
INT-2826 - Minimize calls to MessageGroupQueue.size() when infinite capacity
For reference see: https://jira.springsource.org/browse/INT-2826

INT-2826 - Code Review Changes
2012-11-21 09:25:23 -05:00
Gary Russell
de5082a25d Merge pull request #676 from ghillert/INT-2674 2012-11-21 09:24:16 -05:00
Gunnar Hillert
a5d7de848d INT-2674 - Add JdbcChannelMessageStore
INT-2674 - Added slow/failing JDBC Message Store Tests

INT-2674 - Code Review Changes

INT-2674 - Add support for HSQL

INT-2674 - Add documentation
* Refactor Test Cases
* Code Review Changes

INT-2674 - Code Review Changes

INT-2674 - Code Review Changes

INT-2674 - Renamed classes

INT-2674 - Code Review Changes
2012-11-21 09:22:20 -05:00
Mark Fisher
84cfb62592 Merge pull request #677 from garyrussell/INT-2815a
* INT-2815a: Refactor AbstractPollingEndpoint
2012-11-20 20:40:24 -05:00
Gary Russell
6f4800a904 INT-2815 Refactor AbstractPollingEndpoint
Recent changes to APE were sub-optimal because the subclasses
had to call back into the parent abstract class.

Deprecate doPoll() on APE.

Introduce a temporary intermediate abstract class that supports
transaction synchronization.

This class will be deprecated in 3.0.0 when its methods will
be pulled up into APE.

INT-2815 Polishing

Make ATSPE package visibility.

Add helpers to enable early migration to 3.0 structure.

INT-2815 Polishing

Fix javadoc to emphasize that doPoll() will no longer
be overridable in 3.0.

Rename doReceive() to receiveMessage() to match more closely
with handleMessage().

INT-2815 Polishing

Fix message in UnsupportedOperationException.
2012-11-20 19:54:21 -05:00
Mark Fisher
4822d9b209 Merge pull request #681 from garyrussell/INT-2827
* INT-2827: Fix Amqp Gateway Tests
2012-11-20 19:47:47 -05:00
Gary Russell
617cc4237c INT-2827 Fix Amqp Gateway Tests
Use a unique channel for each gateway in
AmqpOutboundGatewayParserTests.
2012-11-20 18:37:17 -05:00