Commit Graph

8385 Commits

Author SHA1 Message Date
Artem Bilan
cabe507e0e INT-4051: Add PublisherAnnBPP when @EnableInt
JIRA: https://jira.spring.io/browse/INT-4051

Previously we can process `@Publisher` annotations only with the `<int:annotation-config>` or with an explicit `@EnablePublisher("")`

* Fix `PublisherRegistrar` to relax from the fact if we have `@EnablePublisher` or not and register `PublisherAnnotationBeanPostProcessor` without `defaultChannelName`
2016-06-09 21:23:44 -04:00
Artem Bilan
dbd034c17a Fix unused import in FileSplitter
https://build.spring.io/browse/INT-B43-230/
2016-06-08 22:21:36 -04:00
Gary Russell
d521031a7d INT-4049: FileSplitter: JSON File Markers
JIRA: https://jira.spring.io/browse/INT-4049

INT-4049: Json FileMarker Namespace Support

* Address PR comments
2016-06-08 22:07:55 -04:00
Artem Bilan
c620438913 INT-4046: Add FtpRemoteFileTemplate.ExistsMode
JIRA: https://jira.spring.io/browse/INT-4046

Since not all FTP servers provide proper `STAT` command implementation,
plus the `NLIST` doesn't work properly for directories cases, introduce the `FtpRemoteFileTemplate.ExistsMode`
to let:
* to perform `STAT` by default (previous) behavior;
* to switch to `NLIST` for `FtpRemoteFileTemplate` internal use;
* perform the full `NLIST` and `FTPClient.changeWorkingDirectory()` algorithm if needed.

* Improve (S)Ftp components to use proper `RemoteFileTemplate` for internal instantiation
* Introduce `FtpMessageHandler` to wrap `FtpRemoteFileTemplate` with the proper `NLIST` `ExistsMode`
* Cover `NLIST` switching from the `FtpOutboundChannelAdapterParser` and `FtpOutboundGatewayParser`
* Document the `FtpRemoteFileTemplate.ExistsMode`

* Fix typo in the recently introduced `RemoteFileOperations.getSession()` method name
* Add JavaDoc to `Session.exists()`
* Add `NLIST` support for the `FtpSession.exists()` to meet the API requirements

**Cherry-pick to 4.2.x and 4.1.x**

Addressing PR comments

Doc Polishing
2016-06-08 14:34:35 -04:00
Artem Bilan
009410deed INT-4031: Improve Docs for null Return in S-A
JIRA: https://jira.spring.io/browse/INT-4031

Polishing
2016-06-07 14:28:46 -04:00
Gary Russell
08718d1919 INT-4047: TCP: Add contentType Header
JIRA: https://jira.spring.io/browse/INT-4047

Polishing - PR Comments
2016-06-07 12:19:26 -04:00
Gary Russell
ae0939d55f GH-1824: Comment Out HeapDumper in s-i-test
Resolves #1824
2016-06-07 09:18:23 -04:00
Gary Russell
2650aef173 INT-4045: Fix NPE in ObjectToJsonTransformer
JIRA: https://jira.spring.io/browse/INT-4045

Handle the situation when the first element of a container type (or map)
is null; set the generic type of the container to `Object`.

Also, clarify how the compatibility between the transformer and Spring AMQP
message converter is achieved.
2016-06-06 11:35:23 -04:00
Gary Russell
c54d95b1aa More File Cleanup - Core 2016-06-05 10:12:18 -04:00
Gary Russell
90e5457260 File Cleanup - ws to xmpp 2016-06-04 12:50:39 -04:00
Gary Russell
dd1d2ecab4 File Cleanup - Scripting to Twitter 2016-06-04 12:36:10 -04:00
Gary Russell
6016a70cd5 File Cleanup - JPA to RMI 2016-06-04 12:08:24 -04:00
Gary Russell
8e3622757d File Cleanup - Event to JMX 2016-06-04 11:39:43 -04:00
Gary Russell
e16f084628 File Cleanup - Core 2016-06-04 10:40:57 -04:00
Gary Russell
a30809be38 INT-4042: Support Known Router Channels in Graph
JIRA: https://jira.spring.io/browse/INT-4042

```
...
  }, {
    "nodeId" : 24,
    "name" : "integrationGraphServerTests.Config.router.router",
    "stats" : {
       ...
      }
    },
    "componentType" : "router",
    "output" : "discards",
    "input" : "four",
    "routes" : [ "barChannel", "bazChannel" ],
    "errors" : "myErrors"
  }, {
...
    "from" : 3,
    "to" : 24,
    "type" : "input"
  }, {
    "from" : 24,
    "to" : 7,
    "type" : "output"
  }, {
    "from" : 24,
    "to" : 2,
    "type" : "error"
  }, {
    "from" : 24,
    "to" : 5,
    "type" : "route"
  }, {
    "from" : 24,
    "to" : 6,
    "type" : "route"
...
```

Add Graph Support for RecipientListRouter

The RLR is not an AMMR; it's the only router outside of that class hierarchy.

Polishing

Add Dynamically Routed-to Channels to Graph

Add ExpressionBased and Expose Expression in Graph

Polishing

Add getExpressionString() to IOS

Add ExpressionCapable; Set Primary Expression

Polishing - PR Comments

Router/Expression Docs

* Simple Java Docs polishing
2016-06-03 18:36:43 -04:00
Gary Russell
dae1a01003 INT-4043: Fix ExecutorChannel with datatypes Attr.
JIRA: https://jira.spring.io/browse/INT-4043

The `ExecutorChannel` overrides `onInit()` but fails to call the super
which is where the message converter for datatype conversion is set up.

Also, when Jackson is not on the class path and there are no converters in the
context, the default integration conversion service is not registered.

The `DefaultDatatypeChannelMessageConverter` overwites its default conversion
service with this bean, unconditionally - setting it to null in this case.

Check for a null conversion service before replacing the default.

* Polishing according PR comments
2016-06-03 14:32:59 -04:00
Sean Mills
17abf29da1 INT-4044: Fix WebSocketStompSessionManager API
JIRA: https://jira.spring.io/browse/INT-4044

The wrong method `WebSocketStompClient.connect()` has been used before because of `Object` vararg.

* Fix to the proper method invocation
* Modify `StompInboundChannelAdapterWebSocketIntegrationTests` with `origin` handshake header to prove the fix
2016-06-02 19:04:41 -04:00
Artem Bilan
4a1002b8db Upgrade to Spring AMQP-1.6.0.RELEASE 2016-05-31 15:26:52 -04:00
Gary Russell
e4d2484db6 INT-4037: Graph: Add Link Type To LinkNode
JIRA: https://jira.spring.io/browse/INT-4037

Provide type information in `LinkNode`s, input, output, error, discard.

This might be rendered as:

```
              +---(discard)
              |
         +----o----+
         |         |
         |         |
         |         |
(input)--o         o---(output)
         |         |
         |         |
         |         |
         +----o----+
              |
              +---(error)
```

  "links" : [ {
    "from" : 10,
    "to" : 9,
    "type" : "output"
  }, {
    "from" : 10,
    "to" : 1,
    "type" : "error"
  } ]

Document `link.type` in the `graph.adoc`
2016-05-26 13:35:41 -04:00
Artem Bilan
f5488efcaa INT-4039: Add Allowed Origins to WebSockets
JIRA: https://jira.spring.io/browse/INT-4039

Also add `suppressCors` for the `SockJsServiceOptions`

Polishing according PR comments
2016-05-26 12:02:52 -04:00
Gary Russell
d414383eac INT-4034: Channel Metrics Javadocs
JIRA: https://jira.spring.io/browse/INT-4034

Incorrectly showed time since last send was seconds instead of milliseconds.
2016-05-26 11:48:02 -04:00
Gary Russell
43b83bec53 INT-4038: Add GPFB Gateways to Graph
JIRA: https://jira.spring.io/browse/INT-4038

General format for node name: bean.method#n

The #n is needed to disambiguate methods with the same name.

Polishing according PR comments

* Fix generic type for `Collections.unmodifiableMap` usage
* Change the gateway method logic in the `IntegrationGraphServer` to include the method signature in the node name to distinguish them as unique
* Move `MutableMessageBuilderFactoryTests` into the separate nested `mutable` package since `@IntegrationComponentScan` sees a new `@MessagingGateway` in the `IntegrationGraphServerTests`.
See https://jira.spring.io/browse/INT-4040
* Document the `@MessagingGateway` representation in the `graph.adoc`
2016-05-26 11:16:28 -04:00
Gary Russell
16f9c9ae49 INT-4041: AMQP: Map receivedUserId
JIRA: https://jira.spring.io/browse/INT-4041

Polish the `AMQP-1.6.0` link to be more generic and refer
2016-05-26 11:13:44 -04:00
Artem Bilan
d57db56a39 INT-4035, INT-4008: Docs for Integration Graph
JIRA: https://jira.spring.io/browse/INT-4035, https://jira.spring.io/browse/INT-4008

Polishing
2016-05-25 09:29:00 -04:00
Manuel Jordan
c6821ec387 INT-3997: Add H2ChannelMessageStoreQueryProvider
JIRA: https://jira.spring.io/browse/INT-3997

* Created the `H2ChannelMessageStoreQueryProvider` class for the
`ChannelMessageStoreQueryProvider` interface
* The `LongRunningIntegrationTest` class needs the
`RUN_LONG_INTEGRATION_TESTS` variable defined in the 'system'
and set in true. It to let work the test methods for the
`H2TxTimeoutMessageStoreTests` class
* Updated reference documentation about `ChannelMessageStoreQueryProvider`
* Polishing
2016-05-19 15:47:04 -04:00
Artem Bilan
49985df858 Fix AbstractKeyValueMessageStore create time
The `RedisMessageGroupStoreTests.testMessageGroupUpdatedDateChangesWithEachAddedMessage()` can fail
 sporadically because there is no guaranty the several calls to the `System.getCurrentTimeMillis()` return the same value.

 * Fix `AbstractKeyValueMessageStore` to reuse `MessageGroup.timestamp` for the `lastModified` in case of a new group
2016-05-18 13:35:30 -04:00
Gary Russell
a5ee9bb7f9 INT-4032: Annotation Javadoc Fixes
JIRA: https://jira.spring.io/browse/INT-4032

Polishing according PR comments
2016-05-13 16:53:16 -04:00
Gary Russell
cb36618081 INT-4030: Sporadic JMS Test Failures
JIRA https://jira.spring.io/browse/INT-4030

Increase diagnostics.
2016-05-12 17:04:20 -04:00
Gary Russell
1275b99524 Revert "INT-4030: Sporadic JMS Test Failures"
This reverts commit 8ad560ee9b.
2016-05-12 17:03:42 -04:00
Gary Russell
8ad560ee9b INT-4030: Sporadic JMS Test Failures
JIRA https://jira.spring.io/browse/INT-4030

Backport a recent fix from master and increase diagnostics.
2016-05-12 16:56:51 -04:00
Artem Bilan
e388506321 Some fixes and improvements
https://build.spring.io/browse/INT-MJATS41-629

* Revert to SF and SA BUILD-SNAPSHOTs
* Upgrade to Spring Security 4.1
* Fix `RedisQueueMessageDrivenEndpointTests.testInt3442ProperlyStop()` for `atLeastOnce()` verification
because in between stop and the last `rightPush` there might be one more `pop` and push again because of `listening = false` state
* There is still sporadic `OutboundGatewayFunctionTests.testLazyContainerWithDest()`, so revise all the JMS tests for:
   - proper `ApplicationContext.stop()` in the end of test
   - `@DirtiesContext` if `SpringJUnit4ClassRunner` is in use
   - `TaskScheduler.destroy()` if that

The JMS fix might relate to the https://jira.spring.io/browse/INT-4030, therefore consider this fix for cherry-picking into `4.2.x` (excluding `build.gradle` changes)
2016-05-12 10:48:13 -04:00
Spring Buildmaster
2d8243d779 [artifactory-release] Next development version 2016-05-11 21:08:05 +00:00
Spring Buildmaster
1b0fa92e4b [artifactory-release] Release version 4.3.0.RC1 2016-05-11 21:07:59 +00:00
Artem Bilan
39ee4ea3b6 INT-4028: Fix ClientWebSocketContainer start/stop
JIRA: https://jira.spring.io/browse/INT-4028

Previously the `ClientWebSocketContainer` after the connection failure couldn't be restored even after `stop()/start()`
because the `openConnectionException` property hasn't been clear on `stop()`

* Add `openConnectionException = null` to `stopInternal()` logic
* Also clear `openConnectionException` and `clientSession` on `start()`
* Plus add recovery (restart) logic into the `getSession()` if the `!clientSession.isOpen()`

**Cherry-pick to 4.2.x**

Fix race condition around `start/stop`

The new `start/stop` logic brakes the in-flight connection.

* Introduce one more `connecting` flag to indicate that we are in connecting process.
* Absorb the a new test for `ClientWebSocketContainer` with the existing one. Looks like there is some extra session close in between.
* Adjust timeouts in the `StompIntegrationTests` to 20 secs. Add `org.apache.catalina` category for tracing logs
2016-05-11 16:04:15 -04:00
Gary Russell
06a1d503be INT-4029: TCP: Add Buffer Pooling to Deserializers
JIRA: https://jira.spring.io/browse/INT-4029

Support the use of buffer pools in the deserializer code to
allow buffer reuse.
2016-05-11 15:01:17 -04:00
Gary Russell
f11dd87f68 Spring Framework 4.3.0.RC2; Spring AMQP 1.6.0.RC1 2016-05-11 14:17:12 -04:00
Gary Russell
9e51ba4ea4 INT-4024: TcpNetConnection Do Not Cache Listener
JIRA; https://jira.spring.io/browse/INT-4024

When the `FailOverClientConnectionFactory` is used on top of a
`CachingClientConnectionFactory`, the underlying connection's listener
is changed to the new `CachedConnection` which in turn has its
listener set to the new `FailoverTcpConnection`.

Since the caching connection factory implies single-use (so the connection
is "closed" - returned to the cache), the `FOCCF`
is also forced to have single-use = true - hence the new ultimate listener.

The `TcpNetConnection` obtained its listener (`getListner()`) in the outer
block of its read loop and hence did not detect the listener change.

This caused the old listener (cached connection) to be invoked and when
the result was ultimately passed back to the `TcpOutboundGateway`, the
connection id did not match and the reply eventually timed out.

Change the `TcpNetConnection` to call `getListener()` for every message.

This was already the case in `TcpNioConnection`.
2016-05-10 19:07:08 -04:00
Artem Bilan
6c01056806 Fix timing issue in AdvisedMessageHandlerTests
https://build.spring.io/browse/INT-B43-199/

The `circuitBreakerTests()` relied on the enough short `Thread.sleep(100)`,
which may not be enough in the heavy-load environment like CI Server.
Therefor the time in between thread switching really can be much bigger than expected.

* Fix the test via timeout "emulation" using reflection to set the `lastFailure` somewhere in the past
to overcome `RequestHandlerCircuitBreakerAdvice.halfOpenAfter` barrier
2016-05-10 18:26:28 -04:00
Artem Bilan
4a5acaa162 INT-4016: Improve channel.adoc for cross-links
JIRA: https://jira.spring.io/browse/INT-4016
2016-05-10 16:30:48 -04:00
Artem Bilan
806bec33f1 INT-4023: Fix MongoDB MGSs timing issue
JIRA: https://jira.spring.io/browse/INT-4023

There is no guaranty that following `System.currentTimeMillis()` return the same value.
That is how the `assertEquals()` test for `created` and `modified` value may fail sporadically.

* Fix `MongoDbMessageStore` and `ConfigurableMongoDbMessageStore` do not use a new `System.currentTimeMillis()`
in case of `group create`

**Cherry-pick to 4.2.x**
2016-05-06 07:38:08 -04:00
Artem Bilan
10a6abf688 Add Xlint:-processing Compiler Option
* To avoid a compiling noise like:
```
warning: No processor claimed any of these annotations: org.springframework.integration.support.management.IntegrationManagedResource,org.springframework.jmx.export.annotation.ManagedResource
```
add `-processing` option to the `compileTestJava.options.compilerArgs`
* Remove such an option from the `JPA` module as redundant
* Fix typos in the `spring-integration-file-4.3.xsd`
2016-05-04 14:49:46 -04:00
Artem Bilan
5975a34106 Increase security test receive timeout
https://build.spring.io/browse/INT-B41-555/

**Cheery-pick to 4.2.x**
2016-05-03 14:18:14 -04:00
Gary Russell
f0079cefd5 Fix Final "Available Socket" Tests
https://build.spring.io/browse/INT-AT42SIO-141/

Also fix sftp .gitignore
2016-05-03 11:55:55 -04:00
Gary Russell
29fc5e6380 Fix Call Overridable Method From Ctor
https://sonar.spring.io/issues/search#componentRoots=org.springframework.integration%3Aspring-integration|createdAt=2016-05-03T02%3A58%3A49%2B0000|sort=UPDATE_DATE|asc=false
2016-05-03 09:10:13 -04:00
Artem Bilan
6c774638cc INT-4021: SimpleMessageStore: Disable lazy-load
JIRA: https://jira.spring.io/browse/INT-4021

Previously the `SimpleMessageStore` unconditionally followed with the super class options
and provided the `lazy-load` functionality by default.

* Since `persistent` and `lazy-load` logic does not make sense for the `in-memory` store, disable it in the `SimpleMessageStore`
* Fir `AggregatorTests` for better coverage.
* NOTE: The same message can't be persisted in the Persistent `MessageStore`. The store key is fully based on the `messageId`.
And also we provide the header which indicates that the messages has been stored before. See `JdbcMessageStore.addMessage()` for example:
```
if (message.getHeaders().containsKey(SAVED_KEY)) {
      Message<T> saved = (Message<T>) getMessage(message.getHeaders().getId());
      if (saved != null) {
		if (saved.equals(message)) {
			return message;
		} // We need to save it under its own id
	}
}
```
* Fix (S)FTP Streaming tests to use `AbstractPersistentAcceptOnceFileListFilter` instead of raw `AcceptOnceFileListFilter`,
which relies on the object identity, but neither `FtpFile`, nor  `ChannelSftp.LsEntry` provides good `equals()` and `hashCode()` implementations.
* Make `StompIntegrationTests` as `DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD` because the sporadic failure on the Travis around wrong value from the queue isn't clear (yet).
Looks like some interim event is generated by the Websocket Container on the Tomcat.
2016-05-02 15:11:20 -04:00
Artem Bilan
537fef8ec9 Fix feed module and downgrade to curator-2.10.0
1. The fix for `SI-feed` module wasn't proper and we still see a `deprecation` warns during testing with Gradle.

* Move all deprecated `com.rometools.fetcher` imports directly to their classes declaration in the `FeedEntryMessageSource`.
That allows `@SuppressWarnings("deprecation")` to work properly

2. The latest nightly tests against IO demonstrate that upgrading to the `curator-3.1.0` has been hasty.
And it pulls as transitive `ZK-3.5.1-alpha`. The last one isn't appropriate for our stable IO dependencies.
But on the other hand the first one isn't compatible with `ZK-3.4.x`:

> The are currently two released versions of Curator, 2.x.x and 3.x.x:

>  Curator 2.x.x - compatible with both ZooKeeper 3.4.x and ZooKeeper 3.5.x
>  Curator 3.x.x - compatible only with ZooKeeper 3.5.x and includes support for new features such as dynamic reconfiguration, etc.

* The consolidate decision with Spring Cloud team to stay with the latest curator version which pull the latest stable ZK version.
Therefore downgrade to `curator-2.10.0`
* Additional decision is always to rely on the curator's transitive dependency for ZK and don't provide explicit to avoid versions incompatibility.
2016-05-02 12:48:44 -04:00
Gary Russell
87b1af088f Fix Streaming (S)FTP Tests
https://build.spring.io/browse/INT-B43-190/

Add `AcceptOneFileListFilter`s.
2016-04-30 11:04:54 -04:00
Artem Bilan
aa9a3ffc25 INT-4020: Fix Unnamed Global Wire-Taps
JIRA: https://jira.spring.io/browse/INT-4020

The fix for `named` global `wire-tap`s (INT-2230) didn't covered testing for `unnamed`.
Therefore the fix unconditionally didn't picked up the issue that we used a wrong `BeanDefinition` to determine the current `id`

* Fix `WireTapParser` to use `wireTapBeanName` from the `resolveId()` when the `GlobalChannelInterceptorParser` invokes it.
* Add tests to demonstrate the issue and confirm the fix

**Cherry-pick to 4.2.x**
2016-04-30 10:31:05 -04:00
Artem Bilan
354975ecef INT-4006: Upgrade to rometools-1.6.0
JIRA: https://jira.spring.io/browse/INT-4006

* Upgrade to `rometools-1.6.0`
* Fix `FeedFetcher` typo in the XSD
* Since the `FeedFetcher` (and the whole `feed-fetcher` jar) is deprecated, provide an appropriate `@SupressWarning("deprecation")`
* Deprecate `FileUrlFeedFetcher` as well
2016-04-29 16:49:39 -04:00
Manuel Jordan
8cfb7414ad INT-4005: Fix channels' capacity with store
JIRA: https://jira.spring.io/browse/INT-4005

* The `<int:queue>` lets declare the `capacity` attribute together
with either `message-store` or `ref` attributes, which it is not
correct

* The `<int:queue>` lets declare the `capacity` attribute together
with either `message-store` or `ref` attributes, which it is not
correct
* The `priority-queue` lets declare the `capacity` attribute
together with the `message-store` attribute, which it is not
correct
* Reference documentation fixed for `channel.adoc` and `jdbc.adoc`,
doing mention about these restrictions

* Minor changes about conventions and formats applied.

Code polishing
2016-04-29 15:34:24 -04:00