Commit Graph

9623 Commits

Author SHA1 Message Date
Gary Russell
e5269bb265 INT-3886: TCP Fix Socket Timeout: Raw Deserializer
JIRA: https://jira.spring.io/browse/INT-3886

An SO user reported a short message delivery when an NIO connection was timed out.

See JIRA for link.

We could not produce the problem with his deserializer but it did identify a problem
with the standard `ByteArrayRawSerializer`.

With NIO, socket timeouts were reported to the deserializer as a normal EOF (-1). This
caused the raw serializer to emit a short message - it's signal for end of message is the
socket closure.

We can't treat a timeout as a normal EOF.

If the socket is forcibly timed out due to no recent data, throw a `SocketTimeoutException` to
the deserializer.

Just in case the old behavior is being relied upon, a boolean has been added to restore that
behavior. This is not recommended, as using timeout to delimit messages is not reliable.

* Fix typos
* Increase `MongoDbInboundChannelAdapterIntegrationTests` timeouts
* Some code polishing
2015-11-12 21:35:03 -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
Artem Bilan
febea4fe40 MQTT: Document Java Config
http://stackoverflow.com/questions/33655970/eclipse-paho-mqtt-spring-java-configuration
2015-11-12 12:12:12 -05:00
Gary Russell
79745c8b08 Add Debug for Amqp Channel Tests 2015-11-10 12:58:50 -05:00
Gary Russell
81cd1e1ad9 Increase File Test Timeouts 2015-11-10 12:57:49 -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
1107bfacb4 Fix Stomp Test Race Condition
Message producers are started in phase `Integer.MAX_INT / 2`.

The test case has a stomp inbound adapter and an event producer.

Since they are both in the same phase, the event producer can miss the `StompReceiptEvent`.

Change the phase of the event producer to ensure it is started before other message producers.
2015-11-10 09:47:51 -05:00
Gary Russell
f5fa979681 MQTT: Possible NPE
Examining the code revealed a possible (but improbable) NPE.

Checking the connection was disjoint from the publish; encapsulate the check within publish.
Synchronize the connectionLost method so it can't null the client while it is being checked.

Add `@SuppressWarnings("deprecation")` on the deprecated `connectIfNeeded()` usage.
2015-11-09 18:29:14 -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
240e14fca1 Fix ZookeeperLeaderTests Race Condition
Leadership was yielded before testing whether the adapter was started when leadership was granted.
It was possible for the adapter to be stopped again before testing `isRunning()`.
2015-11-08 13:29:22 -05:00
Gary Russell
1849cda1c1 Extract LogAdjustingTestSupport
Also add test debugging to JmsOutboundGatewayTests.
2015-11-07 11:06:19 -05:00
Artem Bilan
b041fe9992 INT-3880: Document File Reading Comparator
JIRA: https://jira.spring.io/browse/INT-3880

Polishing
2015-11-06 13:33:03 -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
b3dd85fb4b INT-3879: Mail: Configurable USER Flag
JIRA: https://jira.spring.io/browse/INT-3879

Namespace support to follow in 4.3.

Simple polishing and fix some typos in the `mail.adoc`
2015-11-05 17:13:49 -05:00
Eric Bottard
eec937b6d9 Fix asciidoc typo 2015-11-05 08:48:44 +01: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
Gary Russell
c75a95c555 JMS: Doc: Explain Gateway Correlation Techniques 2015-11-04 18:31:30 -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
Artem Bilan
9918304954 INT-3873: Fix STOMP WebSocket test
JIRA: https://jira.spring.io/browse/INT-3873

Phase I: add `Log4jLevelAdjuster` to the `StompInboundChannelAdapterWebSocketIntegrationTests` to have more info on the next CI failure.
2015-11-03 11:47:56 -05:00
Gary Russell
fb766a951c TCP: Tests: Let OS Choose Test Port
https://build.spring.io/browse/INT-MJATS41-434

BindException.

Avoid using `findAvailableServerSocket()` where easily possible.

Some still remain, but they would require major rework of the tests.

Also fix a race in `TcpOutboundGatewayTests.testGoodNetGWTimeoutGuts()`. Although an
`AtomicBoolean` was used, both threads might still see the lower (500ms) timeout.

Polishing
2015-10-29 19:24:16 -04:00
Gary Russell
e5577b1e50 Fix Control Bus Doc Typo
s/JMS/JMX/
2015-10-28 10:31:26 -04:00
Spring Buildmaster
68e9e175f8 [artifactory-release] Next development version 2015-10-26 16:28:58 -07:00
Spring Buildmaster
f62fcfc615 [artifactory-release] Release version 4.2.1.RELEASE 2015-10-26 16:28:37 -07:00
Artem Bilan
095aeea703 @Ignore a couple nasty tests 2015-10-26 18:02:51 -04:00
Artem Bilan
4c331a26f0 SocketSupportTests: change server port to 0
Rely on the OS server port resolution and use the real port for the `client` from the `server`
2015-10-26 17:18:33 -04:00
Artem Bilan
7ef053da22 Increase timeouts for FileToChannelIntTests
https://build.spring.io/browse/INT-B41-JOB1-460
2015-10-26 16:37:39 -04: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
1012e588e4 Increase remoteTimeout for TcpOutbound test
Looks like `5000` isn't enough to wait for reply from server in high-loaded environment:
https://build.spring.io/browse/INT-B41-JOB1-456
2015-10-22 18:30:12 -04:00
Artem Bilan
9039a1b4c5 INT-3859: Fix NPE in the ImapMailReceiver
JIRA: https://jira.spring.io/browse/INT-3859

The Java Mail `MessageCache.getMessageBySeqnum()` has the code:
````java
if (msgnum < 0) {		// XXX - < 1 ?
    if (logger.isLoggable(Level.FINE))
	logger.fine("no message seqnum " + seqnum);
        return null;
}
````
about which the `IMAPFolder.search` doesn't care:
````java
matchMsgs[i] = getMessageBySeqNumber(matches[i]);
````
therefore pops `null`s to the top for the `ImapMailReceiver`

* Fix `NPE` filtering the `Message[]` from `null` items

Note: its enough difficult to reproduce it because it isn't clear how we can end up with:
````java
if (seqnums[msgnum-1] > seqnum)
		break;		// message doesn't exist
````

in the `MessageCache`.
That's why there is no test-cases on the matter.

**Cherry-pick to 4.1.x**

Polishing

- Only create a new array if needed.
- Add a test case
2015-10-22 17:09:54 -04:00
Artem Bilan
df85b87d5b Fix some JavaDocs Warnings 2015-10-22 11:13:26 -04:00
Gary Russell
279c30d1b0 Typo in Previous Commit 2015-10-22 09:47:07 -04:00
Gary Russell
3965e6977f Document 'trapException` for EERHAdvice 2015-10-22 09:44:16 -04:00
Artem Bilan
d0af90db62 Another fix for failing tests
* `JmsOutboundGatewayTests`: just increase timeouts. Looks like embedded ActiveMQ Broker takes more time to interact on high-loaded builds
* `TcpOutboundGatewayTests`: Rework the race condition fix to the atomic `remoteTimeout`  change using mocks
2015-10-21 19:04:01 -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
Artem Bilan
8637f86d74 Increase timeouts for JMS tests
The `ExtractRequestReplyPayloadTests` uses `3000` for `reply-timeout`.
This value might not be enough on high-loaded environment such a CI Server:
https://build.spring.io/browse/INT-B41-450

* Increase the timeouts for adapters to the `10000` to have more chances to pass on the CI.
* Some simple code polishing for the `ExtractRequestReplyPayloadTests`
2015-10-21 16:11:04 -04:00
Artem Bilan
152f46719a INT-3858: Doc File Inbound scanner and filter
JIRA: https://jira.spring.io/browse/INT-3858

PR Comments
2015-10-21 15:39:03 -04:00
Gary Russell
3118596427 INT-3860: TCP - Fix Port Conflicts
JIRA: https://jira.spring.io/browse/INT-3860

Similar to INT-3794, if some other process is bound to all adapters

    $ lsof -i tcp -nP | grep 9000
    java       6604 grussell  380u  IPv6 0x407e749ec47fa337      0t0  TCP *:9000 (LISTEN)

The socket utils reports that the localhost is available for binding; however, the test then
binds to all adapters.

1. Where (easily) possible, change tests to use port=0 and let the OS choose.
2. For other tests, use high-numbered ports.
3. Change tests to explicitly bind to localhost (like the utility did).
4. Fix `tcpOutboundGatewayInsideChain` test to use the correct port.

Polishing - Fix Travis

Bind SOLingerTests to localhost.

Since we're using port 0, we have to wait until listening before calling getPort().
2015-10-20 18:17:05 -04:00
Gary Russell
b3571a1705 INT-3857: Avoid ctor Injection in Aggregator FB
JIRA: https://jira.spring.io/browse/INT-3857

Setter injection avoids early instantiation of FB properties.

Enhance aggregator parser tests to include several new properties to
check coverage in FB.

Clean up other tests.

Polishing - PR Comments
2015-10-20 16:35:07 -04:00
Artem Bilan
56374212d1 INT-3853: Fix ${} resolution for Ann & XML mix
JIRA: https://jira.spring.io/browse/INT-3853

Previously the placeholder definitions for the Messaging Annotation weren't be resolved
if we use `<context:property-placeholder>` instead of `@PropertySource`.

Fix `MessagingAnnotationPostProcessor` and its "kindergarten" to use
`beanFactory.resolveEmbeddedValue()` instead of `environment.resolvePlaceholders()`.
2015-10-19 16:33:52 -04:00
Gary Russell
6d9e36e47f Spring Framework 4.2.2; AMQP 1.5.1 2015-10-16 16:24:56 -04:00
Artem Bilan
e1e89915ce INT-3855: Docs: File adapters - Java & DSL Config
JIRA: https://jira.spring.io/browse/INT-3855

PR Comments
2015-10-16 16:20:16 -04:00
Gary Russell
2fb039004d INT-3852: Support ObjectName Customization
JIRA: https://jira.spring.io/browse/INT-3852

Custom object names in `@IntegrationManagedResource` were ignored.

Some EIP objects were wrapped with their `Lifecycle` in order to expose
a single MBean with all attributes and operations.

This process "hid" the annotation so the object namer failed to detect the
presence of a custom object name or the other attributes.

Also, update the `@IntegrationManagedResource` to use the Spring 4.2 `@AliasFor` annotation.

INT-3852: Polishing

Polishing - Test with Proxy
2015-10-14 15:24:44 -04:00
Artem Bilan
ccc1568b89 INT-2541: Fix @ManagedResource JMX registration
JIRA: https://jira.spring.io/browse/INT-2541

The `IntegrationMBeanExporter` doesn't register any `@ManagedResource` automatically.
Its `autoDetection` is disabled by default.
Hence such a components like `AbstractMessageGroupStore`
or `WireTap` aren't exposed to the JMX by the `IntegrationMBeanExporter`.
From other side `MBeanExporterHelper` aims to help to avoid duplicate exposing if
an `MBeanExporter` is presented in the CTX.
But `MBeanExporterHelper` did that unconditionally just for the whole `org.springframework.integration` package.
Therefore components which aren't EIP ones aren't exposed to the JMX at all.

* Fix `MBeanExporterHelper` to deal for exclusion based on the `@IntegrationManagedResource` annotation.
* Remove `@IntegrationManagedResource` from those components which aren't EIP.
* Make some polishing in the JMX tests.
2015-10-13 12:32:07 -04:00
Artem Bilan
f049541b00 INT-3809: Improve SimpleIncrIdGenerator JavaDoc
JIRA: https://jira.spring.io/browse/INT-3809
2015-10-12 11:22:53 -04:00
Gary Russell
4d57acb45e INT-3851: Docs - Fix Typo
JIRA: https://jira.spring.io/browse/INT-3851
2015-10-12 09:19:01 -04:00
Artem Bilan
d21b42dbcf Java & DSL Config for the QueueChannel
Also fix some typos in the `mongodb.adoc`
2015-10-09 15:51:37 -04:00
Artem Bilan
bbfde40694 INT-3850: Fix SpEL usage in the CacheWritingMH
JIRA: https://jira.spring.io/browse/INT-3850

**Cherry-pick to 4.1.x, 4.0.x, 3.0.x**
2015-10-09 12:50:48 -04:00
Gary Russell
b6467e1329 INT-3849: Fix File Inbound Adapter Regression
JIRA: https://jira.spring.io/browse/INT-3849

A file inbound adapter with just a `filter` attribute (no implied filter attributes)
did not get its filter injected.

The parser took an early exit from the filter configuration if none of the implied
filter attributes were specified.

Work around is to explicitly set `ignore-hidden="true"`.
2015-10-09 11:03:02 -04:00