Commit Graph

2293 Commits

Author SHA1 Message Date
Artem Bilan
7628cc5439 INT-3950: Fix Aggregator documentation
JIRA: https://jira.spring.io/browse/INT-3950

Previously there was a mention of the `MessageGroupStore.expireMessageGroup(groupId)` which just doesn't existing
in the Framework and never has been there.

* Fix the documentation for the existing `MessageGroupStore.expireMessageGroups(timeout)`.
Although the mention there of `Control Bus` requires to have `@ManagedOperation` on the method.

* Add `@ManagedOperation` for the `MessageGroupStore.expireMessageGroups(timeout)` and confirm with the test-case: `AggregatorWithMessageStoreParserTests`
* Fix the same docs in the XSD for `<aggregator>`
* Fix other typos in the `aggregator.adoc` and `resequencer.adoc`
2016-02-05 11:08:14 -05:00
Artem Bilan
2d33495437 INT-3816: Superclass Mapping for EMExcTypeRouter
JIRA: https://jira.spring.io/browse/INT-3816

Add `cause` `supperclass` mapping ability to the `ErrorMessageExceptionTypeRouter`

Address PR comments:

Introduce `classNameMappings` to store exception classes on the mapping population.
Override all `@ManagedOperation` s to modify `classNameMappings` as well.

Address PR comments:

* Remove redundant local variable
* Fix concurrency access around `channelMapping`
* Add `ClassNotFoundException` test for the `ErrorMessageExceptionTypeRouter`
* Add `What's New` note about the `ClassNotFoundException` during init

Get rid of `synchronized`, use atomic changes

Additional polishing to avoid `ConcurrentModificationException `

Polishing
2016-01-22 13:14:26 -05:00
Artem Bilan
1760572c8b Change Reactor Assert to Spring Assert
`4.3` only
2016-01-21 17:18:53 -05:00
Artem Bilan
d4e9e25fdb Change Reactor Assert to Spring Assert
**Cherry pick to 4.2.x**
2016-01-21 17:15:46 -05:00
Artem Bilan
2024b8a4b3 INT-3898: Fix <xsd:all> usage
JIRA: https://jira.spring.io/browse/INT-3898

Some XML validator like `xercesImpl` doesn't allow `minOccurs` and `maxOccurs` on the `<xsd:all`.

* Remove them in favor of `minOccurs`/`maxOccurs` on the nested elements.
* Add `<poller>` for the `<int-jmx:notification-publishing-channel-adapter>`
2016-01-20 12:26:44 -05:00
Gary Russell
884aebcb07 JIRA: INT-3856 HeaderFilter pattern-match
JIRA: https://jira.spring.io/browse/INT-3856

Allow a property placeholder in the header filter `pattern-match` attribute.

See https://github.com/spring-projects/spring-xd/issues/1804#issuecomment-148845883

Remove versions from spring XSD references
2016-01-12 18:01:08 -05:00
Gary Russell
ce594d437e INT-3920: Handler Factory Bean Subclassing
JIRA: https://jira.spring.io/browse/INT-3920

Remove package and private protection from the message handler `FactoryBean` hierarchy.

Ease the creation of subclasses, for example, it was impossible to subclass
the `SplitterFactoryBean` to support default, expression, or file splitter here:

43c8c041d7 (diff-bb5468e093538789dcde1b222fe90693R62)

* Fix JavaDocs for published methods.
2016-01-12 16:42:15 -05:00
Gary Russell
996e6bb969 INT-3910: MessageProducerSupport.outputChannelName
JIRA: https://jira.spring.io/browse/INT-3910

- Support channel name on `MessageProducerSupport`.
- Defer validation until the endpoint is `start()`ed.
2016-01-12 12:29:20 -05:00
Ryan Barker
201f0fc2b1 INT-3846: SimpleMessageStore Improvements
JIRAs:
https://jira.spring.io/browse/INT-3830
https://jira.spring.io/browse/INT-3523
https://jira.spring.io/browse/INT-3846

* Fix the OOM condition, when we `release()` `UpperBound` independently of the previous `remove` result (https://jira.spring.io/browse/INT-3846)
* Fix "confuse" around `groupCapacity`, when we really didn't care about individual groups (https://jira.spring.io/browse/INT-3523)
* Add `upperBoundTimeout` to have a hook to wait some time for the empty slot in the store (https://jira.spring.io/browse/INT-3830)
* Fix some JavaDocs warnings
* Fix some typos

* Fix inconsistency in the `DelayHandler` around `removeMessageFromGroup` when `MS` is `SimpleMessageStore`
 * Remove `UpperBound.release()` operation from `SimpleMessageStore.removeGroup()`.
 The waiting process should worry about the new `UpperBound` instance.

Some other polishing

`tryAcquire` outside of the `lock`

Move `tryAcquire` within the `addMessageToGroup` outside of `lock`.
But do that only for groups which already exist.
For the new groups we have a fresh `UpperBound`, so no need to worry about dead lock and
 we can obtain  a permit immediately.

SimpleMessageGroup: BlockingQueue -> LinkedHashSet

`SimpleMessageStore`: use "unsynchonized" `SimpleMessageGroup`

Make some synchronization fixes according to the migration to the `LinkedHashSet`

Avoid extra `Collection`

`ResequencingMessageHandler`: compare `size()` of collections instead of `containsAll()`

Fix `ConcurrentModificationException` in the `AbstractKeyValueMessageStore`

Add `SimpleMessageStore.clearMessageGroup()`

Accept polishing and fix `RedisChannelMessageStoreTests`

`@Deprecated` `MessageGroupStore.removeMessageFromGroup()`

Fix some typos

Introduce `SimpleMessageGroupFactory`

Extract `MessageGroupFactory` and address PR comments

Polishing after rebase

JavaDocs and Reference Manual

Fix JavaDocs
2016-01-12 11:51:05 -05:00
Gary Russell
b8b7c1ec1c INT-3929: MessagingGateway Annotation Detection
JIRA: https://jira.spring.io/browse/INT-3929
2016-01-07 14:11:06 -05:00
Gary Russell
d684dc4d0e INT-3902: XML: SmartLifecycle, Order Attributes
JIRA: https://jira.spring.io/browse/INT-3902

Polishing

Polishing - PR Comments

Introduce `RouterFactoryBean.setSendTimeout` and deprecate `setTimeout`
2016-01-07 14:08:32 -05:00
Artem Bilan
74cbc58698 INT-3926: Add <poller> for all outbound tags
JIRA: https://jira.spring.io/browse/INT-3926

* Add `<poller>` for all `<outbound-adapter(gateway)>`
* Add/modify tests for `<queue>` as an input channel and particular `<poller>`
* Move XSD from the `xml` package to the `config` level to achieve the consistency throughout the project.
2016-01-07 12:16:40 -05:00
Artem Bilan
afc286a66a INT-3927: Docs for IntegrationComponentScan
JIRA: https://jira.spring.io/browse/INT-3927

PR Comments
2016-01-07 11:59:15 -05:00
Gary Russell
019470c769 INT-3922: Router FB - outputChannelName
JIRA: https://jira.spring.io/browse/INT-3922
2016-01-06 17:04:36 -05:00
Artem Bilan
fec2a36f42 INT-3916: Don't Use CTOR Injection in FactoryBean
JIRA: https://jira.spring.io/browse/INT-3916

The `JpaOutboundGatewayFactoryBean` used CTOR injection for the `JpaExecutor`.
That one, in turn, uses CTOR injection for the `EntityManagerFactory`.

Such a dependency may cause the `early bean instantiating` in case of `AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()`.
And we end up with the `BeanCurrentlyInCreationException`.

Therefore no one `FactoryBean` should use CTOR injection if there is a potential hierarchical dependency.

NOTE: there is no tests on the matter, since we don't change the components behavior.
The `JPA` sample application will be changed to the Boot to track this fix.

**Cherry-pick to 4.2.x**

Address PR comments and fix other `FactoryBean`s for the same issue, when it is reasonable

Polishing

Address PR comments

Make setter `setSockJsTaskScheduler` as `public`
2016-01-06 12:02:26 -05:00
Gary Russell
2f56bb1329 INT-3899: Defer Poller Creation Until start()
JIRA: https://jira.spring.io/browse/INT-3899

Previously, within `AbstractPollingEndpoint`, the `Poller` object was
created from `afterPropertiesSet()` as well as `start()` if previously `stopped()`
(`this.initialized == false`).

This precluded modification of the advice chain (e.g. in tests when using
`autoStartup == false`).

Move the poller creation to `start()` so that it is always created then, and does
not require a previous `stop()` to change the advice chain.
2016-01-05 14:43:28 -05:00
Artem Bilan
1bd955bef0 @Publisher and @Gateway JavaDocs
PR Comments

Additional info

Polishing
2015-12-30 13:13:01 -05:00
Artem Bilan
6e32deb60f Upgrade some dependencies for 4.3 2015-12-23 09:47:14 -05:00
Gary Russell
6bc619dc22 INT-3921: SimplePollSkipAdvice
JIRA: https://jira.spring.io/browse/INT-3921

Polishing - PR Comments

Also increased some timeouts in JsonPathTests (and fixed a loop counter).
2015-12-21 14:37:23 -05:00
Gary Russell
758a6bdab1 INT-3914: Add CompoundTriggerAdvice
JIRA: https://jira.spring.io/browse/INT-3914
2015-12-16 15:08:52 -05:00
Gary Russell
aca5646181 Retry Advice Test Polishing
Clean up and add test with recovery.
2015-12-15 19:49:58 -05:00
Artem Bilan
68c0df5286 INT-3911: Restore removed @Deprecated
JIRA: https://jira.spring.io/browse/INT-3911

Deffer the removal to `5.0`
2015-12-14 12:35:00 -05:00
Artem Bilan
8a82585121 INT-3908: Fix NPE in the AbstractAggrMGProcessor
JIRA: https://jira.spring.io/browse/INT-3908

**Cherry-pick to ALL**
2015-12-14 12:06:08 -05:00
Artem Bilan
5bc3208096 INT-3832: Upgrade to JsonPath-2.1.0
JIRA: https://jira.spring.io/browse/INT-3832
2015-12-08 19:30:44 -05:00
Artem Bilan
cf528c0b5d INT-3665: Remove Deprecations and Resolve Issues
https://jira.spring.io/browse/INT-3665

Fixes according Travis report

Introduce `...ExpressionString(String)` setter

Some further fixes and polishing

Address PR comments
2015-12-08 16:48:29 -05:00
Artem Bilan
84fdd98428 INT-3904: Fix NPE in the JsonPropertyAccessor
JIRA: https://jira.spring.io/browse/INT-3904

When we use the same expression several times, the SpEL engine cache an `accessor` after the first use.
The next evaluation just bypass `canRead()` and in case of JSON that mean that we don't check that the income has the field or not.
For this case the `read()` must return `TypedValue.NULL` instead of just `null`.
2015-12-08 15:55:54 -05:00
Gary Russell
d16cd9748c INT-799: Remove Core Deps from s-i-test
JIRA: https://jira.spring.io/browse/INT-799

Some test classes (e.g. `TestUtils`) were duplicated in core to avoid cyclic
dependency.

Now that core messaging has been moved to spring-messaging, it is possible
to remove the dependencies on `spring-integration-core` from `spring-integration-test`.

A few minor test cases have been moved to `spring-integration-core`.

The simple polishing to the `build.gradle` and `ServiceActivatorOnMockitoMockTests`
2015-12-07 20:39:00 -05:00
Gary Russell
255247ca9a Code Polishing (Sonar)
- remove redundant modifiers
- overridable methods called from ctors

Polishing - PR Comments
2015-12-07 15:39:13 -05:00
Gary Russell
e3d6f3fb6c INT-3884: Javadoc Fixes 2015-11-29 20:39:09 -05:00
Artem Bilan
51b161ae4d INT-3534:MethodInvokingMLP Don't Copy Collection
JIRA: https://jira.spring.io/browse/INT-3534

Previously the `MethodInvokingMessageListProcessor` copied `Collection<Message<?>>`
in its `process()` method for the `delegate` to a new `Collection` unconditionally.

To improve performance, the collection is no longer copied unconditionally
in the `ExpressionEvaluatingMessageGroupProcessor`.

Also add an `important` note to the `aggregator.adoc` about the restriction with `unmodifiableCollection`.
2015-11-24 14:45:59 -05:00
Artem Bilan
1cc1b2ef79 INT-3895: Fix MonitorTests Race Condition
JIRA: https://jira.spring.io/browse/INT-3895

* `@Ignore` `DelayerUsageTests.testDelayWithCustomScheduler()` as very weak test. (We can consider it to remove at all: doesn't test anything from our side)
* Add `LogAdjustingTestSupport` diagnostic to the `OutboundGatewayFunctionTests`

Tentative commit to see more logs from Travis

Additional diagnostics

More STOMP Diagnostics
2015-11-23 15:02:10 -05:00
Artem Bilan
c67cce1563 INT-3892: Make ExpRatioTests Thread.sleep()-free
JIRA: https://jira.spring.io/browse/INT-3892

 **Cherry-pick to 4.2.x**
2015-11-19 11:49:51 -05:00
Gary Russell
33a40f6cae INT-3884: Outbound Gateway replyChannel in Chain
JIRA: https://jira.spring.io/browse/INT-3884

Previously, an outbound gateway within a chain allowed a `reply-channel` attribute
but it was ignored. The gateway's output channel is set to send the message to
the next element in the chain, or the chain's output channel if the gateway is
the last element.

Tighten the parser logic to detect and disallow a reply channel within a chain.

Polishing
2015-11-18 17:41:54 -05:00
Gary Russell
051b393ed0 Prepare Master for 4.3
Reference to 4.3

Refactor `what's new` for 4.3
2015-11-17 12:12:49 -05:00
Gary Russell
9500d308a0 INT-3823: Fix EnableIntTests Race Condition
JIRA: https://jira.spring.io/browse/INT-3823

The test stops the endpoint.

The previous poller thread can 'steal' the `input` message, but since
it is interrupted, it can't send the message to the `publishedChannel`.

Add logic to wait until the previous poller has been interrupted in `receive()`.

Increase the endpoint `receiveTimeout` to ensure the thread will be interrupted.

Bump SF Version to 4.2.3

Remove `TRACE` logging from the `EnableIntegrationTests` since we have the fix already
Make some optimization around `@DirtiesContext`
2015-11-16 10:49:27 -05:00
Artem Bilan
0327666ca7 Fix RedisMessageGroupStore Tests: clean up DB
https://build.spring.io/browse/INT-B41-JOB1-493
2015-11-14 16:51:01 -05:00
Artem Bilan
9d8e2b61f6 Fixes for Sporadic Test Failures
* `ClientWebSocketContainer`: add some synchronization to avoid race conditions: https://build.spring.io/browse/INT-B41-492
* `TomcatWebSocketTestServer`: convert to `0` port to rely on the OS resolution for `localPort`
* Add `LogAdjustingTestSupport` for STOMP test
* `SftpServerTests`: use `0` port to rely on the OS resolution for `localPort`
* `ImapMailReceiver`, `OutboundGatewayFunctionTests` (JMS), `CachingClientConnectionFactoryTests`,
`AsyncGatewayTests`, `AsyncMessagingTemplateTests`, `GatewayParserTests`, `PriorityChannelTests`, `AggregatorIntegrationTests`: increase timeout
* `EnableIntegrationTests`: use `LogAdjustingTestSupport`
* `FileOutboundChannelAdapterParserTests`: rework `Thread.sleep()` with `CountDownLatch`
* `ConnectionToConnectionTests`: increase timeout and count iteration. Previously with `1sec` we may lose some events. And we can't just rely on the `10sec`,
because the last iteration will be so long
* `TcpOutboundGatewayTests`: `500ms` is so big timeout to wait for the `Exception` that in the high load environment we can yield to other Thread so long.
Like in our case to `server` Thread to send the reply for us. Therefore decrease the Exception timeout to the `50ms` and increase server delay to `2sec`
* `StompInboundChannelAdapterWebSocketIntegrationTests`: remove `@Qualifier("taskScheduler")` as a potential candidate to test against latest SF changes.
We're fine with `SF-4.2.2` and it is just a test-case. So, I don't see reason to wait for their fix here.

STOMP: `session = null` in adapters for any transportError

Polishing
2015-11-14 16:12:23 -05:00
Artem Bilan
f0d0772397 Increase timeouts for DelayHandlerTests
https://build.spring.io/browse/INT-B41-487
2015-11-12 19:18:11 -05:00
Gary Russell
79745c8b08 Add Debug for Amqp Channel Tests 2015-11-10 12:58:50 -05:00
Artem Bilan
f6b95630c4 INT-3871: Fix NPE in the JsonPropertyAccessor
JIRA: https://jira.spring.io/browse/INT-3871

**Cherry-pick to 4.1.x, 4.0.x, 3.0.x**
2015-11-10 11:27:57 -05:00
Gary Russell
90a485e6a9 Fix Race Condition in BarrierMessageHandlerTests
Main thread waited for map.size() to go to zero, which is the initial state; use a latch instead.
2015-11-09 11:37:15 -05:00
Gary Russell
1849cda1c1 Extract LogAdjustingTestSupport
Also add test debugging to JmsOutboundGatewayTests.
2015-11-07 11:06:19 -05:00
Gary Russell
b486247105 INT-3878: MQTT Application Events (inbound)
JIRA: https://jira.spring.io/browse/INT-3878

Publish `ApplicationEvent`s to report inbound channel adapter connection
status.

Fixing typos and simple polishing.
2015-11-05 17:39:08 -05:00
Gary Russell
895336f60a INT-3877: BarrierParser and requires-reply
JIRA: https://jira.spring.io/browse/INT-3877

Failed to set the `requires-reply` boolean.
2015-11-04 19:24:52 -05:00
Artem Bilan
bfebb78429 Adjust some sporadic tests
https://build.spring.io/browse/INT-B41-JOB1-470
https://build.spring.io/browse/INT-B41-JOB1-471
2015-11-04 17:28:20 -05:00
Artem Bilan
703bc5fb82 INT-3872: Document Gateway's Exception as Reply
JIRA: https://jira.spring.io/browse/INT-3872

Polishing

Also, we had no tests for method element parsing.
2015-11-04 14:30:24 -05:00
Artem Bilan
7edef1d9f1 INT-3874: Copy spel-functions from parent ctx
JIRA: https://jira.spring.io/browse/INT-3874

Previously the `IntegrationEvaluationContextFactoryBean` copied only those spel-functions which are defined
as beans in the ctx. Those which are specified through the `setFunctions` hasn't been copied from parent ctx to child.

This fix addresses and issue.
2015-11-03 16:51:45 -05:00
Gary Russell
37aaa82272 INT-3831: Fix MessagingGatewaySupport MBean Export
JIRA: https://jira.spring.io/browse/INT-3831

- Add `@IntegrationManagedResource`
- Suppress exporting as an endpoint

Fix `outputChannel` issue for anonymous `MessagingGatewaySupport`

INT-3831: Pure JavaConfig Test

INT-3831: Polishing

Check output channel name for anonymous message source metrics.

Don't use getter on MGS to avoid early channel resolution.

INT-3831: Fix Test - Avoid Second MBeanServer

Reference the `MBSFB` in the context rather than create a new `MBeanServer`.

Polishing
2015-10-26 14:28:29 -04:00
Artem Bilan
df85b87d5b Fix some JavaDocs Warnings 2015-10-22 11:13:26 -04:00
Artem Bilan
aa3e3c7098 Fix some failing tests
* Modify `ControlBusTests.testControlHeaderChannelReaper()` do not rely on the `timeout`.
Make artificial expiration for the entry in the `registry` to allow `reaper` to remove it according the test logic.
* Fix race condition around `gateway.setRemoteTimeout(5000);` in the `TcpOutboundGatewayTests`.
 The problem was that the gateway is called concurrently and `setRemoteTimeout` might be changed before the `handleMessage()` even for the first attempt.
2015-10-21 17:15:23 -04:00