Commit Graph

7696 Commits

Author SHA1 Message Date
Artem Bilan
85866a2ea8 INT-3427: Add JsonNodeToStringConverter
JIRA: https://jira.spring.io/browse/INT-3427

INT-3427: Workaround for String -> File converter

INT-3427: PR comments
2014-08-20 10:04:22 -04:00
Artem Bilan
f0ab3b03bd INT-3402 ChannelNames lazy-resolution Refactoring
JIRA: https://jira.spring.io/browse/INT-3402

After applying introduction of `AbstractMessageProducingHandler` there was need some simply refactoring to follow with DRY
2014-08-19 17:16:57 -04:00
Gary Russell
8b5c1c5053 INT-3499 AMQP Confirms/Returns Polishing
JIRA: https://jira.spring.io/browse/INT-3499

- Suppress expected exception from log in test case
- Suppress (log) 'null' payload error when no correlation data
- Enforce a specific amqp template reference in the parser when using confirms/returns
- Change tests to use a dedicated template for confirms/returns
2014-08-19 15:47:01 -04:00
Artem Bilan
d43b89dedc INT-2791 temp-channel-transacted for AMQP Channel
JIRA: https://jira.spring.io/browse/INT-2791

* Add `template-channel-transacted` attribute for the `<amqp:channel>`s to separate configuration for
container and RabbitTemplate
* Make container's `channelTransacted` as `false` by default
* Upgrade to `S-AMQP-1.4.0`
* Add `AmqpHeaders.PUBLISH_CONFIRM_NACK_CAUSE` according to the new `RabbitTemplate.ConfirmCallback#confirm` signature

Conflicts:
	src/reference/docbook/whats-new.xml

Conflicts:
	src/reference/docbook/whats-new.xml

INT-2791: Polishing

Upgrade to S-AMQP-2.0

Fix for mock publisher confirm/return tests, since `channel` is now physically closed, if the `ConnectionFactory` isn't `CachingConnectionFactory`
2014-08-19 15:43:17 -04:00
Artem Bilan
d0cf1a8080 INT-3488: Map Content-Disposition HTTP header
JIRA: https://jira.spring.io/browse/INT-3488

The `Transfer-Encoding` has been remained as unmapped for the `DefaultHttpHeaderMapper.inboundMapper()`
2014-08-19 14:15:53 -04:00
Artem Bilan
507fd42d01 INT-3422: Add ChannelInterceptorAware.remove()
JIRA: https://jira.spring.io/browse/INT-3422

* Add two methods:
```
boolean removeInterceptor(ChannelInterceptor interceptor);
boolean removeInterceptor(int index);
```

The method `removeInterceptorsOfType(Class<?> clazz)` isn't good, because we lead undesired behavior, when several provided interceptors might be of the same type (e.g. by superclass)

INT-3422: PR comments
2014-08-19 12:45:35 -04:00
Stéphane Nicoll
463c185b38 Refactor AbstractHeaderMapper
This commit updates AbstractHeaderMapper in a number of ways:

* The 'userDefinedHeaderPrefix' property has been removed as some
  advanced tests revealed that the feature is actually broken right
  now and there is no easy way to fix it. A new richer hook point
  that indicates if the property comes from the target object or the
  standard MessageHeaders has been added.
* A HeaderMatcher interface has been introduced to replace the
  lengthy checks in shouldMapHeader. Several implementations
  of that interface are provided
* An additional pattern has been added that maps any header that is
  *not* a standard header. It uses the standardHeaderPrefix property
  for that purpose
* A number of protected method that were only used to create the
  instance have been removed in favour of a non default constructor.
  Subclasses should provide those *static* values in their own default
  constructor.
* The list of transient headers can now be customized. Transient
  headers are headers that should never be mapped. The standard
  ErrorChannel and ReplyChannel headers have also been removed from
  the default transient headers list as they no longer need to be
  transient

header-mapper: Polishing
2014-08-19 12:02:01 +03:00
David Liu
84421fd91c INT-2856: Add Management for RecipientListRouter
JIRA: https://jira.spring.io/browse/INT-2856

INT-2856:Add support for adding/removing individual recipients to the RecipientListRouter

INT-2856: allow recipient channel null on init

INT-2856: Polishing
2014-08-19 11:30:35 +03:00
Artem Bilan
59c7c0edc1 INT-3496: JMX Metrics: Int->Long for All count
JIRA: https://jira.spring.io/browse/INT-3496

**Cherry-pick to 4.0.x & 3.0.x**

INT-3496: revert `int` methods and introduce `long` methods for `count` metrics
2014-08-18 13:30:13 -04:00
Artem Bilan
248c97098c INT-1197: Add Support for WebSockets: Client Side
JIRA: https://jira.spring.io/browse/INT-1197

INT-1197: Add JavaDocs and some polishing

Further changes

* Upgrade to SF 4.1
* Rename `SubProtocolHandlerContainer` to the `SubProtocolHandlerRegistry`
* Add `MessageConverter` support to the adapters
* Add `ClientWebSocketContainer.openConnectionException` to be thrown on `getSession` request
* Add `ClientWebSocketContainer.connectionLatch` to wait the connection establishing on first request.
Since the WebSocket connection process is run in the separate Thread, we need to wait it from the first `message send` do not lose the message, if connection hasn't been established yet.

INT-1197: Add `PassThruSubProtocolHandler`

Add `StompIntegrationTests`

INT-1197: Polishing according PR comments

INT-1197: Use SockJs from tests

Fix other detected vulnerabilities

INT-1197: `@Gateway` with `@MessageMapping` test

INT-1197: PR comments

Skip non `SimpMessageType.MESSAGE` to send to the `outputChannel` from `WebSocketInboundChannelAdapter`

Polishing
2014-08-18 12:02:35 -04:00
Artem Bilan
4dd5064152 INT-3486: Fix typo in the name of MutableMessageBuilderFactory class 2014-08-18 10:01:49 -04:00
Artem Bilan
81f993f0d8 INT-3486 SimplePool suppress InterruptedException
JIRA: https://jira.spring.io/browse/INT-3486

Previously the undesired StackTrace has been logged in case of Thread interruption, e.g. component `stop()`

Suppress `InterruptedException` in the `SimplePool#getItem()`.
Since we do the `Thread.currentThread().interrupt();` on the `catch (InterruptedException e) {` it does not make sense
to rethrow it as a `MessagingException`, because the thread is interrupted anyway.
2014-08-18 10:01:49 -04:00
Artem Bilan
8ac4bfbd2c INT-3477: Add Reactor Promise<?> for Gateway
JIRA: https://jira.spring.io/browse/INT-3477

INT-3477: Fix `reactorEnvironment` propagation

* `MessagingGatewayRegistrar` parser the value for the `reactorEnvironment`
* Provide more interest test-case
* Polishing docs

INT-3477 Require `Environment` in case of Promise

* Do not use Reactor `Environment` as default instance.
* Require `Environment` reference, when is `Promise` method
* Polishing for tests
* Apply Gary's polishing for docs

INT-3477: Assert.notNull -> Assert.state

INT-3477: PR review
2014-08-18 09:53:28 -04:00
Artem Bilan
0674abcacb MQTT: BackToBackAdapterTests: use TemporaryFolder
https://build.spring.io/browse/INT-MJATS41-38

Use `TemporaryFolder` for `BackToBackAdapterTests#testAsyncPersisted()`
to avoid concurrent builds cross-talk.

There is no need to do anything around the Paho `FileLock`, because the code looks like in the `MqttAsyncClient`:
```
this.persistence.open(clientId, serverURI);
this.comms = new ClientComms(this, this.persistence);
this.persistence.close();
```
So, the lock is released before the real connect to the Broker.
2014-08-15 17:01:08 -04:00
Artem Bilan
d69c8cb718 INT-3495 Add FileTailInChAFBean#setErrorChannel
JIRA: https://jira.spring.io/browse/INT-3495

**Cherry-pick to 4.0.x & 3.0.x**

INT-3495 Add `error-channel` to `<tail-i-c-a>`

JIRA: https://jira.spring.io/browse/INT-3495

* Fix `AbstractEndpoint` JavaDoc
2014-08-15 11:28:23 -04:00
Artem Bilan
edbbcef5b3 INT-3470: Fix SF 4.1 Compatibility
JIRA: https://jira.spring.io/browse/INT-3470

According to the commit https://github.com/spring-projects/spring-framework/commit/c06ac06,
the `MessagingException` is now `NestedRuntimeException` including nested StackTrace.
Hence test-cases have to be changed to the `Mathers.containsString` instead of `equals` for the `e.getMessage()`

**Cherry-pick to the 4.0.x**
2014-08-12 07:24:51 -04:00
David Liu
938d61f1b0 INT-3460: Add AbstractMessageProducingHandler
JIRA: https://jira.spring.io/browse/INT-3460
2014-08-12 12:42:21 +03:00
David Liu
0aec26ad4f INT-3478 SftpPAOnceFileListFilter use getFilename
JIRA: https://jira.spring.io/browse/INT-3478

INT-3478: add test case

Polishing
2014-08-06 13:41:13 +03:00
Gary Russell
4382a5796e INT-3479 Improve ServiceActivatingHandler.toString
JIRA: https://jira.spring.io/browse/INT-3479

- Remove null `beanName` in `AbstractStandardMessageHandlerFactoryBean`
- Change `ServiceActivatingHandler.toString()`
- Fix aggregator test timing
2014-08-06 13:14:07 +03:00
Kris Jacyna
d2da16145b INT-3485: Remove final from AE.stop(Runnable)
JIRA: https://jira.spring.io/browse/INT-3485

Delegate to doStop() instead of overriding stop() directly

Delegated call to doStop() rather than stop(), added author tag and added unit test for custom doStop(runnable)

Polishing
2014-08-06 13:08:58 +03:00
Gary Russell
6b8bdc7e5e INT-3455 Orderly Shutdown Improvements
JIRA: https://jira.spring.io/browse/INT-3455

Do not stop schedulers and executors - allows mid-flow
QueueChannels to be drained.

Stop all inbound MessageProducers (that are not OrderlyShutdownCapable).

INT-3455 Polishing; PR Comments

Change deprecate method usage to the new version
2014-08-05 22:18:24 +03:00
David Liu
5f214ea559 INT-2474: MGS: logging Exception at debug level
JIRA: https://jira.spring.io/browse/INT-2474
2014-08-05 13:23:45 +03:00
Artem Bilan
1458f56102 INT-3402: Late Resolution for Channel Names
JIRA: https://jira.spring.io/browse/INT-3402

* Move `channel name to channel` resolution logic to the action, e.g. `sendReplyMessage`
* Remove resolution logic from `MessagingAnnotation` Processors
* Fix `AggregatorAnnotationPostProcessor` to invoke `handler.afterPropertiesSet()` one more time,
because of `AbstractMethodAnnotationPostProcessor` `this.beanFactory.initializeBean(handler, handlerBeanName)`
* `Filter` annotation: allow `property-placeholder` for the `discardWithinAdvice`
* Fix `EnricherParserTests4-context.xml` duration: use just `0` for the `reply-timeout`

INT-3402: Add `synchronized double check`

INT-3402: Polishing according PR comments

INT-3402: Optimization for `AbstractCorrelatingMH`
2014-08-04 18:47:34 -04:00
Gary Russell
403c91801d INT-3412 (S)FTP Append, rmdir, Client Access
JIRA: https://jira.spring.io/browse/INT-3412

Initial commit - review only.

TODO:
- SFTP Tests
- Namespace/Adapter support for file append
- Docs

INT-3412 Polishing

- Addressed PR comments
- Completed SFTP implementation
- Added namespace/parser support for `FileExistsMode` (append, etc)
- Added SFTP Tests
- Created Embedded SFTP server for tests (similar to FTP)
- Converted tests that needed a real server to use the embedded server

INT-3412 Docs and Polish (PR Comments)
2014-08-04 15:08:34 +03:00
Gary Russell
bc3db5d4a9 Fix Timing in GemFire Delayer Reschedule Test
https://build.spring.io/browse/INT-MEIGHT-JOB1-166
2014-08-04 13:43:43 +03:00
David Liu
9d0089d51d INT-3384: Rework JMS/XML Module XSD Enumerations
JIRA: https://jira.spring.io/browse/INT-3384

Polishing
2014-08-04 13:42:15 +03:00
Gary Russell
1c84305f8d Fix Occasional Reaper Expiry Test Failure
https://build.spring.io/browse/INT-MJATS41-32/

Also add a test for expiring a group within an aggregator.

Polishing
2014-07-31 22:43:12 +03:00
Artem Bilan
5992fc201b Update CONTRIBUTING.md 2014-07-31 14:09:48 +03:00
David Liu
afc8214c52 INT-3200: SFTP: use byte[] for the PrivateKey
JIRA: https://jira.spring.io/browse/INT-3200

INT-3200: Remove reduntant test case

INT-3200: remove trailing space
2014-07-31 09:56:29 +03:00
Artem Bilan
36cabb7f3c INT-2634: Test for gateway's Map parameter
JIRA: https://jira.spring.io/browse/INT-2634

The Map entries with non-String keys are now skipped just with WARN message,
instead of `IllegalArgumentException` as it was before
2014-07-30 18:04:46 +03:00
Artem Bilan
48ea677b41 SftpServerTests: BASE64Decoder -> apache..Base64 2014-07-29 18:15:11 +03:00
Gary Russell
46a6259140 Add Sftp Server Tests
Using Apache Mina
2014-07-29 08:56:10 +03:00
Gary Russell
edebfed62c INT-3420 Aggregator Expiry Doc Clarification
JIRA: https://jira.spring.io/browse/INT-3420

New documentation implied that if `expire-groups-upon-timeout`
was true, the group would NOT be removed if the group
was released by the release strategy in `forceComplete()`.

"...if it does so, then expiration is controlled by..."

In fact, `afterRelease()` (which is where `expire-groups-upon-completion`
is only invoked if `expire-groups-upon-timeout` is false.

Clarify that if the release strategy releases the group during timeout
then the group will always be expired if `expire-groups-upon-timeout` is
true (default).
2014-07-27 09:24:42 -04:00
Artem Bilan
7fdc0d4660 INT-3483: Fix AbstractCorrelatingMH deadlock
JIRA: https://jira.spring.io/browse/INT-3483

**Cherry-pick to 4.0.x & 3.0.x**
2014-07-25 10:03:11 -04:00
Clément Garnier
815f6bfce1 INT-3480: public DefaultPahoMC.setPayloadAsBytes
JIRA: https://jira.spring.io/browse/INT-3480

In docs, it s said:
```
The DefaultPahoMessageConverter can be configured to return the raw byte[] in the payload by declaring it as a <bean/> and setting the payloadAsBytes property.
```
http://docs.spring.io/spring-integration/docs/4.0.0.M3/reference/html/mqtt.html
2014-07-25 13:15:36 +03:00
David Liu
aaf88ecc7c INT-3104:Add auto-start attribute to Gemfire Adapters
JIRA: https://jira.spring.io/browse/INT-3104

Add phase and remove unnecessary auto-starup

INT-3104: Remove reduntant code and format

Polishing and fixing parser tests
2014-07-25 13:08:28 +03:00
Gary Russell
eff1c7b7d8 INT-3464 Fix Test Filenames 2014-07-24 10:55:35 -04:00
Gary Russell
a20fa9a029 INT-3464 Exceptions and AcceptOnceFileListFilter
JIRA: https://jira.spring.io/browse/INT-3464

Previously, if an IO exeption occurred while synchronizing
files, and an AcceptOnceFileListFilter is being used, files that were
not transferred would not be fetched next time.

Add strategy `ReversibleFileListFilter` that can rollback previously
accepted files.

Implement this interface on `AcceptOnceFileListFilter` and
`AbstractPersistentAcceptOnceFileListFilter`.

Add test cases.

Polishing
2014-07-24 16:56:38 +03:00
Gary Russell
5b3b557cba INT-3474 Suppress DEBUG StackTrace in MIMHelper
JIRA: https://jira.spring.io/browse/INT-3474

When the MethodInvokingMessageHandler skips ineligible methods while
searching it emits a stack trace under DEBUG logging. This is not
needed, a simple log message is enough to convey the information.

Some POJOs gain ineligible methods when wrapped in a proxy so this
is no fault of the developer.

Other reasons for skipping methods (improperly set annotations etc)
continue to emit a stack trace.

INT-3474: Polishing

Rethrow `IneligibleMethodException` as `IllegalArgumentException` in case of a single `method` for processor
2014-07-24 16:42:02 +03:00
Gary Russell
3b49d606ac INT-2371 DefaultHeaderChannelRegistry Improvements
JIRA: https://jira.spring.io/browse/INT-3471

- Make final fields protected so they are available to subclasses
- Add property `removeOnGet` allowing the map entry to be removed immediately when it is used
- Add `time-to-live-expression` allowing override of the reaper delay

Polishing

Conflicts:
	src/reference/docbook/whats-new.xml
2014-07-24 11:45:06 +03:00
Liujiong
302edf9221 INT-3465:Content Enricher Improvements
JIRA: https://jira.spring.io/browse/INT-3465

Add support for adding/removing individual recipients to the RecipientListRouter

Modify documentation in what's new and spring-integration-4.1.xsd

Polishing

`AbstractRemoteFileOutboundGateway`: close `outputStream` before `file.delete()` to release exclusive file-lock
2014-07-23 21:42:45 +03:00
Gary Russell
40f1122df2 INT-3420 Aggregator expire-groups-upon-timeout
JIRA: https://jira.spring.io/browse/INT-3420

Add option to allow the empty group to remain after timeout
so late arriving messages can be discarded.

INT-3420 Add Callout Hyperlinks

The aggregator configuration documentation had hyperlinks
from the attribute descriptions to the attribute in the
XML, but not vice-versa. For a large number of attributes
such as this, bi-directional hyperlinks are useful.

INT-3420 Doc Polishing
2014-07-23 10:20:43 +03:00
Gary Russell
e21d32f4fd INT-3452 Http Response Documentation
JIRA: https://jira.spring.io/browse/INT-3452

Document that `expected-response-type` is required when a response
contains a body.
2014-07-22 21:21:15 +03:00
Artem Bilan
7abefb08df INT-3475: Integer.MAX_VALUE / 2 Phase for MDEs
JIRA: https://jira.spring.io/browse/INT-3475

Change the phase for `SourcePollingChannelAdapterFactoryBean`, `AbstractPollingEndpoint`, `MessageProducerSupport`, `JmsMessageDrivenEndpoint`
to the `Integer.MAX_VALUE / 2`
2014-07-22 11:07:31 -04:00
liujiong1982
5bb2141fe2 INT-3238:Delete the FTP Temporary File (get)
JIRA: https://jira.spring.io/browse/INT-2438

If a get operation fails in the outbound gateway,
clean up (remove) the temporary file if present.

Test Polishing
2014-07-22 10:46:14 -04:00
Gary Russell
d5b831d210 Remove Unnecessary Deprecation Suppression
Deprecated API usage has been removed from the affected modules.
2014-07-18 15:04:49 -04:00
Artem Bilan
81cacf340c INT-651: Add Iterator Support for Splitter
JIRA: https://jira.spring.io/browse/INT-651

INT-651: Polishing according PR comments

INT-651: Polishing #2

Doc Polishing
2014-07-18 13:21:33 -04:00
Artem Bilan
a64b53a1b5 INT-3473: Set Inactive TcpNioFactory Before Stop
JIRA: https://jira.spring.io/browse/INT-3473

A simple fix to prevent `Selector closed` error loging message on `TcpNioServerConnectionFactory#stop()`

Polishing
2014-07-17 15:37:05 -04:00
Artem Bilan
3890e892d8 INT-3470: SF 4.1 Compatibility #2
JIRA: https://jira.spring.io/browse/INT-3470

* Apply the last `ChannelInterceptor` changes - just `extends ChannelInterceptorAdapter`
* Change some tests to check content according to the new changes to the `GenericMessage#toString()`

**Cherry-pick to 4.0.x**
2014-07-17 14:32:50 -04:00
Gary Russell
84e3d4e126 INT-3467 MQTT Modify Subscribed Topics at Runtime
JIRA: https://jira.spring.io/browse/INT-3467

Add methods and managed operations to the inbound
channel adapter to allow the subscribed topics to be
changed at runtime, programmatically, or using a
control-bus.
2014-07-15 11:12:10 +03:00