Commit Graph

9623 Commits

Author SHA1 Message Date
王小冋
1a0fdc6e53 INT-3522: MQTT XSD: Fix client-factory attr type
JIRA: https://jira.spring.io/browse/INT-3522
2014-09-26 10:04:22 +03:00
Artem Bilan
a5bddddac2 INT-3515: Fix Some WebSockets Issues
JIRA: https://jira.spring.io/browse/INT-3515

Change test suite to the Tomcat according IO

INT-3515: IllegalStateException for the `WebSocketInboundChannelAdapter`, when `useBroker = true`, but there is no Broker Relay in the Context
2014-09-25 15:15:37 +01:00
Artem Bilan
2587ed6bd0 INT-3518: Upgrade versions and some cleanup
JIRA: https://jira.spring.io/browse/INT-3518
2014-09-25 14:35:21 +01:00
Kris Jacyna
30b58836e5 INT-3500: Consider to add "error-channel" to the <enricher>
JIRA: https://jira.spring.io/browse/INT-3500

* add 'error-channel' to the <enricher> component
* delegate errorChannel to the internal gateway in ContentEnricher
* added tests for xml based and java based enrichers with error channels

INT-3500: Consider to add "error-channel" to the <enricher>

* Fixed typos and comments
* Reworked xml integration test to use the outputChannel and increased timeout
* Added overview in whats-new doc

INT-3500: Consider to add "error-channel" to the <enricher>

* Ensure requestChannel is set if an errorChannel is set
* Increased timeout to fix unit test
* Added details to content-enricher ref doc

Polishing
2014-09-15 14:46:23 +03:00
Gary Russell
17b91592fb Fix ListenableFuture Docs
s/Thread/String/
2014-09-09 07:53:19 -05:00
Spring Buildmaster
443dd9f98f [artifactory-release] Next development version 2014-09-05 06:45:43 -07:00
Spring Buildmaster
5e2009db5c [artifactory-release] Release version 4.1.0.M1 2014-09-05 06:45:37 -07:00
Artem Bilan
dfed17baf7 Whats-new: Move Boon note to the new-components 2014-09-05 15:52:18 +03:00
Andreas Falk
ee60f38f90 INT-3510: Fixed 'missing INT_MESSAGE_SEQ' error
JIRA: https://jira.spring.io/browse/INT-3510

There has been an error in schema creation scipt for message store on postgresql database:

The statement for creating sequence 'INT_MESSAGE_SEQ' was executed AFTER creating the table that actually uses this sequence
which resulted in sequence not found error.

Further problem was that the the corresponding index 'MSG_INDEX_DATE_IDX' in creation script does not match the index name
'INT_CHANNEL_MSG_DATE_IDX' in drop script. Therfore an error occurred when executing drop schema script for postgresql.

Fixes:

1.Moved creation of sequence 'INT_MESSAGE_SEQ' to first line to be executed before creating the corresponding table
2.Renamed index 'MSG_INDEX_DATE_IDX' to 'INT_CHANNEL_MSG_DATE_IDX' in create script to make drop script work again
On branch INT-3510
2014-09-05 09:45:08 +03:00
Artem Bilan
b413239a83 INT-1198: WebSockets: Server Side
JIRA: https://jira.spring.io/browse/INT-1198

INT-1198: WebSocket: Add namespace support

Polishing components according to the namespace support experience

Parser for `<server-container>` and tests

INT-1198: Add parser tests for `<int-websocket:outbound-channel-adapter>`

Introduce `use-broker` on server side

Polishing according PR comments

`What's New` note
2014-09-04 17:27:31 -04:00
Gary Russell
3d32acf78c Update SPR 4.1, AMQP 1.4 M1, Retry 1.1.1 2014-09-04 16:45:44 -04:00
Artem Bilan
054f473287 INT-3508: HTTP: Map MessageHeaders.CONTENT_TYPE
JIRA: https://jira.spring.io/browse/INT-3508

Before SI 4.0 and moving `MessageHeaders` to the Spring Messaging the `MessageHeaders.CONTENT_TYPE` had a value as `content-type`,
which was mapped to the HTTP Header `Content-Type` well.
Starting with SF 4.0 `MessageHeaders.CONTENT_TYPE` has a value `contentType`. It doesn't allow to map HTTP headers properly.

* Add `contentType` mapping logic to the `DefaultHttpHeaderMapper`, to map to the `Content-Type` HTTP header and vice versa.
* Fix bug in the `DefaultHttpHeaderMapper#toHeaders`: `ObjectUtils.containsElement` -> `containsElementIgnoreCase`.
Some HTTP servers can return `Content-Type` as `Content-type` or even `content-type`, although it is `Content-Type` anyway.
* Add test-case with `<int:object-to-json-transformer/>`, when the `application/json` value from `MessageHeaders.CONTENT_TYPE` is properly
mapped to the HTTP `Content-Type`. Prior to this fix we had to remap `MessageHeaders.CONTENT_TYPE` to the `Content-Type` manually using `<header-enricher>`

Reformat code

Use only `MessageHeaders.CONTENT_TYPE` for mapping to/from SI

Move `MessageHeaders.CONTENT_TYPE` logic to the `fromHeaders`

Performance Improvements

Remove toLowerCase() calls within loop of `shouldMapHeader()`.

Pre-build lower case versions of arrays.
2014-09-03 14:38:36 -04:00
Artem Bilan
de1d8b9806 INT-3509 Add Convert Node & DOMSource to Document
JIRA: https://jira.spring.io/browse/INT-3509

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

Polishing

- Javadoc
- Refactor duplicated code
2014-09-02 16:02:45 -04:00
Artem Bilan
af2ec0567a INT-3503 equals & hashCode for ToStringFriendlyJN
JIRA: https://jira.spring.io/browse/INT-3503

**Cherry-pick to 4.0.x**

PR Comments and test
2014-09-02 12:55:19 -04:00
Gary Russell
b64bf03fce INT-3506 Async Gateway Improvements
JIRA: https://jira.spring.io/browse/INT-3506
JIRA: https://jira.spring.io/browse/INT-3428

Support flows downstream of the gateway that support
returning a `Future<?>` payload.

Currently, any method that returns a type that is assignable
to `Future<?>` runs async and returns a `FutureTask<?>`.

This prevents a service-interface method that returns a
custom `Future<?>` object from being invoked without wrapping
that `Future<?>` in a `FutureTask<?>`.

Allow the async-executor to be set to `null` causing any method
returning `Future<?>` to run on the calling thread.

Add support for `ListenableFuture<?>`.

If the return type is a `RunnableFuture`, `ListenableFuture` or
`Future`, or exactly a `FutureTask` or `ListenableFutureTask`, run the flow
on the executor (if present); otherwise run on the calling thread.

INT-3506 Fix Object returnType

INT-3506 Polishing - PR Comments

Perform dummy invocations of `submit` and `submitListenable` to
determine the actual return types so that we can determine at
runtime whether the executor will return a type that is compatible
with the method return type. If not, run on the caller's thread.

Add DEBUG Log If Incompatible Future<?>

INT-3506 Add Support for MessagingGateway

Add a constant to indicate no executor.

Add tests.

INT-3506 Polishing and Docs

- Docbook
- XSD
- Change test to send calling thread in payload so we can determine whether
   we need to return a Future or not; previously relied on the thread name
   which was brittle.

Polishing JavaDocs.
Change `amqp.xml` to use `org.springframework.amqp.support.AmqpHeaders` instead of an old one.
2014-08-29 22:17:03 +03:00
Gary Russell
e4eac27b12 INT-3507 TCP - Use BufferedOutputStreams
JIRA: https://jira.spring.io/browse/INT-3507

TcpNoDelay (false) helps to buffer IOs but only after the
first write.

Use `BufferedOutputStreams` for TCP writes.

Use the socket `sendBufferSize` for the buffer size.
2014-08-28 17:35:35 -04:00
Artem Bilan
0b917622a6 INT-3504: Deprecate AmqpHeaders
JIRA: https://jira.spring.io/browse/INT-3504

* Deprecate `AmqpHeaders` and extend it from `org.springframework.amqp.support.AmqpHeaders` for backward compatibility
* Change AMQP dependency to `1.4.0`
* Remove usage of deprecated `spring_reply_correlation` and `spring_reply_to` AMQP headers
* Fix syslog `DefaultMessageConverter` JavaDoc

Reformat code
2014-08-28 08:48:33 -04:00
Gary Russell
93b1224e99 INT-3501 Fix IMAP Idle
JIRA: https://jira.spring.io/browse/INT-3501

There were several problems:

When a `Folder` is open, an activity on the `Store` opens a new
connection.

The `PingTask` called `isConnected()` on the store, creating a new
connection. The pings (NOOPs)  were performed on this connection and
therefore did NOT cancel the `IDLE`.

In any case, the `IDLE` was issued on the folder not the store and
the only way to cancel that IDLE is to cause its `waitIfIdle()` to
be invoked. Conveniently, simply calling `isOpen()` invokes that
method and cancels the IDLE.

Finally, the `SimpleMessageCountListener` unnecessarily invoked
`message.getLineCount()` when a simple `folder.isOpen()` is
sufficient.

Fixes:

1. Do not invoke `openSession` if `this.folder` is not null.
2. Change the `PingTask` to simply invoke `isOpen()`.
3. Move the `PingTask to the receiver for a more efficient algorithm
    instead of running on fixed interval. Rename it `IdleCanceler`.
4. Increase the PING timer from 10 to 120 seconds; add setters for it
    and the `reconnectionDelay`.

TODO: Namespace support for 4.1. (Not to be back ported).

Add a test IMAP server (ported from Java DSL and enhanced to simulate IDLE
with a new message arriving for the first idle period.

INT-3501 Polishing - PR Comments
2014-08-27 19:16:30 +03:00
Andy Wilkinson
00a7b08c1d Use com.sun.mail:javax.mail for ReadableMime dependency
com.sun.mail:javax.mail is already part of the Spring IO Platform,
whereas com.sun.mail:mailapi is not.
2014-08-27 10:53:34 +01:00
David Liu
e3644d8792 INT-3369: Syslog Converter asMap Option
JIRA: https://jira.spring.io/browse/INT-3369

INT-3369: add option asMap in DefaultMessageConverter
* add test

GH-1250
2014-08-25 10:14:37 -04:00
Gary Russell
9766c8b4e7 Fix JavaMail Dependency
`ImapMessage` has a direct dependency on `ReadableMime`. It is
not clear why this started failing only on the MJATS41 build
but changing the `mailapi` dependency to `compile` fixes it
(tested by pointing the plan to my repo).
2014-08-23 14:45:57 -04:00
Artem Bilan
00c404f383 INT-3492: Deprecate @Payload and @Header(s)
JIRA: https://jira.spring.io/browse/INT-3492

Since `@Paylod` and `@Header(s)` annotations are in the Spring Framework,
there is no more need to support them in Spring Integration.

Deprecate them and leave for backward compatibility.
Will be removed in future releases.

Remove deprecated Gatewa's `#method` expression evaluation context variable

Tested `gradlew clean testall` with and without changed to the tests.

INT-3492: Add `MessagingAnnotationUtils#findMassagePartAnnotation`

Move `MessagingAnnotationUtils` to the `org.springframework.integration.util` package
2014-08-23 12:25:20 -04:00
Gary Russell
162ef1f227 Fix Tests SPR 4.1 Compatibility
GenericMessage.toString() changes.
2014-08-23 12:15:40 -04:00
Artem Bilan
7f74c571d4 INT-3402-3: Channels Late Resolution #3
JIRA: https://jira.spring.io/browse/INT-3402

* Add late resolution of channel names for the `MessagingGatewaySupport`
* Implement delegate logic for internal implementations like `ContentEnricher.Gateway`
2014-08-21 10:25:59 -04:00
Artem Bilan
1c051416ce INT-3489 Reschedule Aggregator's group-timeout
JIRA: https://jira.spring.io/browse/INT-3489

* Catch `MessageDeliveryException` and reschedule `group-time out task`: `AbstractCorrelatingMessageHandler#scheduleGroupToForceComplete`
* Apply `send-timeout` for the `discardChannel`
* Mark `groupRemove = false` in case of `MessageDeliveryException`
* Improve `send-timeout` docs

INT-3489: Recalculate `groupTimeout` on each rescheduling

Add Test for Zero Timeout
2014-08-21 09:23:31 -04:00
Artem Bilan
f84e798272 INT-3370: Add BoonJsonObjectMapper
JIRA: https://jira.spring.io/browse/INT-3370

* Add `BoonJsonObjectMapper`
* Provide some tests
* Remove deprecations
* Polishing test according removed deprecations
* Change `JsonObjectMapper#populateJavaTypes` to get deal with `payload`, not its `class`,
since we can't (and Jackson's `TypeFactory`, too) determine generic type from `Collection`.
Use `iterators` instead to retrieve the type from the first item.

Conflicts:
	build.gradle
	spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapperTests.java

INT-3370: Polishing according PR comments

* Apply Gary's polishing to the Docs
* Fix `RecipientListRouter` JavaDoc warn
* Fix typo in test name for `UdpUnicastEndToEndTests`
* Fix `RedisQueueOutboundChannelAdapterTests` do not use Jackson 1.x

Final Polish
2014-08-20 14:00:03 -04:00
Artem Bilan
cda4a99023 INT-3486: Poller: Prevent Interrupt StackTrace
JIRA: https://jira.spring.io/browse/INT-3486

INT-3486a: PR comments
2014-08-20 10:24:39 -04:00
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