Commit Graph

8396 Commits

Author SHA1 Message Date
Artem Bilan
105f5ef86d INT-4061: Fix FTP doc for dir changing calback
JIRA: https://jira.spring.io/browse/INT-4061

The `FTPClient.changeWorkingDirectory()` can be performed only after proper connection to the target FTP server

* Fix `ftp.adoc` to mention proper `postProcessClientBeforeConnect()` callback.
* Make other minor polishing for the `ftp.adoc`
2016-06-23 12:48:05 -04:00
Dave Syer
1752204eb6 INT-4058: Add leader initiator for lock registry
JIRA: https://jira.spring.io/browse/INT-4058

If you hold the lock, you are the leader. This simple idea gets you
a long way if there is no "native" leader initiator. E.g. you
can use this with a RDBMS with JdbcLockRegistry.

Add some docs on leader election under "endpoints"

Make thread name for leader initiator unique

In case there are multiple instances in the same context we would
like to be able to spot them in the logs.

INT-4058: Polishing

* Code refactoring in the `LockRegistryLeaderInitiator`: SI use 120 line length
* Add `Assert.notNull()` for required properties
* Add `this.lock.unlock()` and `Thread.sleep(LockRegistryLeaderInitiator.this.busyWaitMillis)` into the `catch` block to let distributed elections to work.
Otherwise there is a big chance that we will acquire the lock and become a leader again just after `yield()`
* Change `LockContext.toString()` to use simple `String` concatenation which is optimized by compiler to the `StringBuilder`.
That let to have some better micro-performance compared with with extra `Formatter` object in case of `String.format()`
* Add `JdbcLockRegistryLeaderInitiatorTests`

* Fix `yield()` logic based on the `Future.cancel(true)`.
Since one `FutureTask.cancel(true)` makes it as `INTERRUPTED` any subsequent `yield()` does not make any effect, therefore our infinite selector loop isn't interrupted one more time.
* Reschedule the `LeaderSelector` in the `yield()` after cancel(true).
* Rework `catch` in the selector loop just to the `InterruptedException` and `return null;` to stop looping and let reschedule the selector.
* Add one more `onRevoked` logic into the `final` of the selector loop to notify that we have lost leadership during `stop()`
* Improve `JdbcLockRegistryLeaderInitiatorTests` to ensure that several `yield()` on the same initiator work well.
* Add `What's New` note.
2016-06-22 15:43:12 -04:00
Artem Bilan
7b3d57a06e Fix some Reference Manual typos 2016-06-22 14:32:28 -04:00
Artem Bilan
65261567d2 Upgrade to Gradle 2.14 and SF-4.3.1
In addition optimize `dist` task a bit excluding `BOM` module
2016-06-20 13:49:02 -04:00
Dave Syer
d0538fdbec Make DefaultLockRepository constructor public
Otherwise you can't create an instance of it in @Configuration.
2016-06-15 10:56:22 -04:00
Artem Bilan
fe5ff04489 INT-4054: Eliminate usage of slf4j
JIRA: https://jira.spring.io/browse/INT-4054
Fixes GH-1833 (https://github.com/spring-projects/spring-integration/issues/1833)

The `DefaultCandidate` pulled requirement for the `slf4j` dependency via its `Logger` and `LoggerFactory` usage.

* Change `slf4j` to the standard Commons Logging
* Exclude `slf4j` transitive dependencies from `optional` direct dependencies like `reactor` and `json-path`
* Since they are `optional` it is safe to exclude their transitives to force our source code to be free from unexpected dependencies.
Anyway they don't appear in the target application as a SI transitives and end-user is forced to pull them manually to switch on the desired features.
If there is need in the `slf4j` for target application, it must be pulled manually as well.

**Cherry-pick to 4.2.x**
2016-06-14 15:22:36 -04:00
Spring Buildmaster
a9b4d206a3 [artifactory-release] Next development version 2016-06-13 17:11:27 +00:00
Spring Buildmaster
fff9743bdc [artifactory-release] Release version 4.3.0.RELEASE 2016-06-13 17:11:23 +00:00
Dave Syer
7c2731dbb9 INT-4048: Add JdbcLockRegistry support
JIRA: https://jira.spring.io/browse/INT-4048

The semantics of the locks are the same as for the default lock
registry (they have to be unlocked by the same thread that
locked them).

Updates from feedback

Add interface for JdbcClient so transactions can bind to proxy

Fix typo in exception message

Fix drop script

JdbcClient -> LockRepository

Make lock() contract more like native Lock

Make lockInterruptibly throw InterruptedException more

Delete all expired locks, not just the ones that we own

INT-4048: Polishing

* `DefaultLockRepository`: replace `prefix` only once in the `afterPropertiesSet()`
* Add JavaDocs to the `DefaultLockRepository`
* `JdbcLockRegistry`: add `Thread.sleep(100)` to lock loops do not request DB so often like in case of clean `while(true)`
* `JdbcLockRegistry`: implement more robust `tryLock(long time, TimeUnit unit)`. The logic mostly copied from `RedisLockRegistry`
* Add `testExclusiveAccess()` to be sure that JDBC locks have exclusive access to the data sequence

Document `JdbcLockRegistry`

Upgrade to SF-4.3 GA
2016-06-13 11:31:18 -04:00
Artem Bilan
eca8536678 INT-4053: Avoid Reactor dependency requirement
JIRA: https://jira.spring.io/browse/INT-4053

The recent changes to the `FileSplitter` introduced (by IDE autocompletion mistake) hidden dependency of Reactor using its `Assert` class instead of Spring's one

**Cherry-pick to 4.2.x**
2016-06-10 16:40:06 -04:00
Artem Bilan
0268a68b63 INT-4004: Improve MessageStore Docs
JIRA: https://jira.spring.io/browse/INT-4004
2016-06-09 21:50:58 -04:00
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