Commit Graph

594 Commits

Author SHA1 Message Date
Artem Bilan
d2eba0927d INT-3939: Consistency for Redis Queue Gateways
JIRA: https://jira.spring.io/browse/INT-3939

Previously `RedisQueueInboundGateway` and `RedisQueueOutboundGateway` used different `RedisSerializer`s
for non-String objects.

* Change the default to the `JdkSerializationRedisSerializer` for the consistency in case of client/server scenarios.

The previous behavior with the `StringRedisSerializer` can be reinstated with `serializer` injection.

Doc Polishing.
2016-01-28 15:49:29 -05:00
Artem Bilan
2d33495437 INT-3816: Superclass Mapping for EMExcTypeRouter
JIRA: https://jira.spring.io/browse/INT-3816

Add `cause` `supperclass` mapping ability to the `ErrorMessageExceptionTypeRouter`

Address PR comments:

Introduce `classNameMappings` to store exception classes on the mapping population.
Override all `@ManagedOperation` s to modify `classNameMappings` as well.

Address PR comments:

* Remove redundant local variable
* Fix concurrency access around `channelMapping`
* Add `ClassNotFoundException` test for the `ErrorMessageExceptionTypeRouter`
* Add `What's New` note about the `ClassNotFoundException` during init

Get rid of `synchronized`, use atomic changes

Additional polishing to avoid `ConcurrentModificationException `

Polishing
2016-01-22 13:14:26 -05:00
Gary Russell
62db308c22 INT-3935: Add Jsch Proxy Factory Bean
JIRA: https://jira.spring.io/browse/INT-3935
2016-01-19 17:27:55 -05:00
Gary Russell
c97afe92fe INT-3934: HTTP Requests Without Content-Type
JIRA: https://jira.spring.io/browse/INT-3934

Coerce a missing Content-Type to `application/octet-stream`.
2016-01-18 11:28:05 -05:00
Artem Bilan
b1a09f5b0d INT-3881: MQTT: add XML recovery-intervalattr
JIRA: https://jira.spring.io/browse/INT-3881

Also fix a couple typos in the WS xsd
2016-01-15 13:12:36 -05:00
Rainer Frey
84c5b7b193 INT-3932: Redis: add rightPop and leftPush
JIRA: https://jira.spring.io/browse/INT-3932

PR review:

* remove unnecessary spaces

* fix code and doc style

* use property name rightPop/right-pop (default true)

* add reversed feature to the outbound adapter

* add new options to reference manual

* Polishing according PR comments
2016-01-15 12:08:26 -05:00
Gary Russell
c7724c340c INT-3574: File Outbound - Don't Flush File
JIRA: https://jira.spring.io/browse/INT-3574

Initial commit.

Polishing

Prevent the flusher task from closing while a write is in process.

Add MessageTriggerAction

Flush file(s) on demand.

Polishing - PR Comments

Add FlushPredicate

Polishing - PR Comments

Polishing - More PR Comments and Schema

Polish and Namespace

Docs

flushIfNeeded Must be Synchronized

Fix Race on Stop

Flush immediately after the write if the handler has been stopped.

Remove states from the internal store if handler is stopped.
2016-01-14 17:48:14 -05:00
Ryan Barker
201f0fc2b1 INT-3846: SimpleMessageStore Improvements
JIRAs:
https://jira.spring.io/browse/INT-3830
https://jira.spring.io/browse/INT-3523
https://jira.spring.io/browse/INT-3846

* Fix the OOM condition, when we `release()` `UpperBound` independently of the previous `remove` result (https://jira.spring.io/browse/INT-3846)
* Fix "confuse" around `groupCapacity`, when we really didn't care about individual groups (https://jira.spring.io/browse/INT-3523)
* Add `upperBoundTimeout` to have a hook to wait some time for the empty slot in the store (https://jira.spring.io/browse/INT-3830)
* Fix some JavaDocs warnings
* Fix some typos

* Fix inconsistency in the `DelayHandler` around `removeMessageFromGroup` when `MS` is `SimpleMessageStore`
 * Remove `UpperBound.release()` operation from `SimpleMessageStore.removeGroup()`.
 The waiting process should worry about the new `UpperBound` instance.

Some other polishing

`tryAcquire` outside of the `lock`

Move `tryAcquire` within the `addMessageToGroup` outside of `lock`.
But do that only for groups which already exist.
For the new groups we have a fresh `UpperBound`, so no need to worry about dead lock and
 we can obtain  a permit immediately.

SimpleMessageGroup: BlockingQueue -> LinkedHashSet

`SimpleMessageStore`: use "unsynchonized" `SimpleMessageGroup`

Make some synchronization fixes according to the migration to the `LinkedHashSet`

Avoid extra `Collection`

`ResequencingMessageHandler`: compare `size()` of collections instead of `containsAll()`

Fix `ConcurrentModificationException` in the `AbstractKeyValueMessageStore`

Add `SimpleMessageStore.clearMessageGroup()`

Accept polishing and fix `RedisChannelMessageStoreTests`

`@Deprecated` `MessageGroupStore.removeMessageFromGroup()`

Fix some typos

Introduce `SimpleMessageGroupFactory`

Extract `MessageGroupFactory` and address PR comments

Polishing after rebase

JavaDocs and Reference Manual

Fix JavaDocs
2016-01-12 11:51:05 -05:00
Artem Bilan
afc286a66a INT-3927: Docs for IntegrationComponentScan
JIRA: https://jira.spring.io/browse/INT-3927

PR Comments
2016-01-07 11:59:15 -05:00
Gary Russell
11ba07e3e3 INT-3890: AMQP: Content-Type Conversion Outbound
JIRA: https://jira.spring.io/browse/INT-3890
2016-01-06 12:31:09 -05:00
Artem Bilan
2be12160e9 INT-3726: Support Path for FileHeaders.FILENAME
JIRA: https://jira.spring.io/browse/INT-3726

Since the `FileHeaders.FILENAME` header is relaxed String, we can use any value there.
For example some use-cases (e.g. unzipping) would like to use the relative path together with the file name
to restore the original directory structure in the target directory using `FileWritingMessageHandler`.

Use `resultFile.getParentFile().mkdirs()` in the `FileWritingMessageHandler` to recreate the directory hierarchy before the target file manipulating.

Add Documentation

Address PR comments
2016-01-05 17:08:03 -05:00
Gary Russell
eb34d5c9e6 Reference Copyright -> 2016 2016-01-05 12:10:11 -05:00
Artem Bilan
2546ac3d52 INT-3924: Fix RedisQueueInboundGateway
JIRA: https://jira.spring.io/browse/INT-3924

* The `RedisQueueInboundGateway` and `RedisQueueMessageDrivenEndpoint` used `MICROSECONDS` for the wait for stop condition.
  - Change to `MILLISECONDS`
* Both of them may pick up data from the Redis List even after the `stop()`.
  - Add `rightPush()` to the `RedisQueueInboundGateway` to emulate `rollback`.
  - Even if we have `rollback` there we may "steal" messages after the `context.stop()` causing unexpected race condition.
     So change the logic between `stopTimeout` and `receiveTimeout` to `max`, thus we wait for stop more than for `rightPop`.
* Some attributes have been missed for the XML configuration.
  - add `stop-timeout` and `recovery-interval` attributes to the XSD and parsers code.
  - adjust `RedisQueueGatewayIntegrationTests` to use those new attributes.
* Some tests needed polishing:
  - Rework `RedisStoreOutboundChannelAdapterIntegrationTests` to be based on `@ContextConfiguration` for better performance
  - `RedisChannelParserTests` used to `mock` channels for the same Redis topic. Change of of them to different name to avoid `Dispatcher has no subscribers`
    from the `testPubSubChannelUsage()` when the second `SubscribableRedisChannel` doesn't have subscribers.
* Polishing for `redis.adoc`

Address PR comments

* Rework logic to the `Math.min(this.stopTimeout, this.receiveTimeout)` on the adapter/gateway `stop()`
* Fix JavaDocs and `redis.adoc` to describe `stopTimeout` properly.
* Rework `RedisQueueGatewayIntegrationTests` to be based on the `randomUUID` for the queue name to send and receive.

Address PR comments.
2016-01-04 16:43:45 -05:00
Marcin Pilaczynski
8bf8caa22e INT-3883: UDP: destination and socket expressions
JIRA: https://jira.spring.io/browse/INT-3883

UDP Outbound Channel Adapter is able to use given UDP Inbound Adapters
server socket (outgoing packets will have source port same as incoming
packets destination port).

* Introduce `destinationExpression` instead of hard-coded `host/port` logic in the `DatagramPacketMessageMapper`
* Make `UnicastSendingMessageHandler.destinationExpression` mutually exclusive with `host/port` pair
* Move `socketExpression` to the setter as it is absolutely different option from the `destination`
* Make `UnicastSendingMessageHandler` expressions logic based on the `requestMessage`

INT-3883 Code review fixes.

Further polishing

Polishing according PR comments

Rework the String socket address logic just to the expected `URI` style.
Accept `2016` for changed classes.
2016-01-04 14:31:40 -05:00
Gary Russell
41c48548f1 Fix AsciiDoctor Conversion Problems 2016-01-01 11:25:42 -05:00
Artem Bilan
1bd955bef0 @Publisher and @Gateway JavaDocs
PR Comments

Additional info

Polishing
2015-12-30 13:13:01 -05:00
Gary Russell
d71236ee76 (S)FTP Doc Polishing 2015-12-25 10:46:42 -05:00
Artem Bilan
59eb565296 Fix handler-advice.adoc
Cherry-pick to `4.2.x`
2015-12-22 18:16:25 -05:00
Gary Russell
6bc619dc22 INT-3921: SimplePollSkipAdvice
JIRA: https://jira.spring.io/browse/INT-3921

Polishing - PR Comments

Also increased some timeouts in JsonPathTests (and fixed a loop counter).
2015-12-21 14:37:23 -05:00
Artem Bilan
b7aa54a016 INT-2456: Polish http.adoc
JIRA: https://jira.spring.io/browse/INT-2456

Note: I don't see reason to extract separate paragraphs for gateway/adapter pairs.
2015-12-16 18:48:04 -05:00
Gary Russell
758a6bdab1 INT-3914: Add CompoundTriggerAdvice
JIRA: https://jira.spring.io/browse/INT-3914
2015-12-16 15:08:52 -05:00
grafjo
52e690bc89 Fix sftp.adoc typos 2015-12-15 19:49:02 -05:00
Gary Russell
180ada63b0 INT-3912: TCP Server Listening Event
JIRA: https://jira.spring.io/browse/INT-3912

Polishing - PR Comments
2015-12-15 10:15:13 -05:00
Artem Bilan
cf528c0b5d INT-3665: Remove Deprecations and Resolve Issues
https://jira.spring.io/browse/INT-3665

Fixes according Travis report

Introduce `...ExpressionString(String)` setter

Some further fixes and polishing

Address PR comments
2015-12-08 16:48:29 -05:00
Gary Russell
ddb4321e1d INT-3900: Fix Doc
QOS > 0, not > 1.
2015-12-07 14:23:04 -05:00
Gary Russell
9fff767f71 INT-3900: MQTT: Don't Unsubscribe if !cleanSession
JIRA: https://jira.spring.io/browse/INT-3900

The message-driven adapter should not unsubscribe if `cleanSession` is
`false`.

INT-3900: MQTT: Changes for 4.3 Only

Doc Polishing
2015-12-07 14:10:24 -05:00
Gary Russell
4ff19def3f Router Doc Polishing - Formatting 2015-11-26 12:14:00 -05:00
Artem Bilan
51b161ae4d INT-3534:MethodInvokingMLP Don't Copy Collection
JIRA: https://jira.spring.io/browse/INT-3534

Previously the `MethodInvokingMessageListProcessor` copied `Collection<Message<?>>`
in its `process()` method for the `delegate` to a new `Collection` unconditionally.

To improve performance, the collection is no longer copied unconditionally
in the `ExpressionEvaluatingMessageGroupProcessor`.

Also add an `important` note to the `aggregator.adoc` about the restriction with `unmodifiableCollection`.
2015-11-24 14:45:59 -05:00
Artem Bilan
15e2187fd2 INT-2787: Map correlationId to JMS Property
JIRA: https://jira.spring.io/browse/INT-2787

The `correlationId` is `UUID` object by default Framework behavior.
This type isn't allowed for JMS Message properties mapping.

Add the mapping for the `IntegrationMessageHeaderAccessor.CORRELATION_ID` header as a `String`,
since on the other side it simply can be converted to the `UUID` object back.
For example `AbstractCorrelatingMessageHandler` does that automatically on the correlation function using `UUIDConverter`.

The provided `SplitterAggregatorTests` demonstrates the scenario when we weren't be able to aggregate by the unsupported `UUID` type.

I don't consider this as back-port fix, because the same can be simply achieved with the custom `JmsHeaderMapper`.
From other side this fix maybe like some side-effect breaking change.

I don't consider any `UUID` message header as a candidate to be converted to String and mapped, because to do that unconditionally
may cause some undesired issues. From other side it can be done with the custom `JmsHeaderMapper` in the end-application.
2015-11-24 13:32:19 -05:00
Gary Russell
b4218982da INT-3984: UDP: OS Selected Server Port
JIRA: https://jira.spring.io/browse/INT-3894

Allow UDP server port (and sender Ack port) to be selected by the operating system.

Also fix multicast tests to run on all platforms.

Change tests to use OS selected port.
2015-11-23 17:16:23 -05:00
Gary Russell
f80c0db0df INT-3861: Mail Namespace Support for userFlag
JIRA: https://jira.spring.io/browse/INT-3861

Allow the custom `userFlag` to be configured using the namespace.

Polishing according PR comments
2015-11-18 18:12:00 -05:00
Gary Russell
33a40f6cae INT-3884: Outbound Gateway replyChannel in Chain
JIRA: https://jira.spring.io/browse/INT-3884

Previously, an outbound gateway within a chain allowed a `reply-channel` attribute
but it was ignored. The gateway's output channel is set to send the message to
the next element in the chain, or the chain's output channel if the gateway is
the last element.

Tighten the parser logic to detect and disallow a reply channel within a chain.

Polishing
2015-11-18 17:41:54 -05:00
Gary Russell
051b393ed0 Prepare Master for 4.3
Reference to 4.3

Refactor `what's new` for 4.3
2015-11-17 12:12:49 -05:00
Artem Bilan
b9730cd183 INT-3882: StompSession Reconnection Logic
JIRA: https://jira.spring.io/browse/INT-3882

Add reconnect support for the StompSession:
* Introduce `recoveryInterval` for the `AbstractStompSessionManager`
* Add reconnect scheduled task
* Add handling of the `ConnectionLostException` into the `AbstractStompSessionManager`,
as well as for the `StompInboundChannelAdapter` and `StompMessageHandler`
* Cover adapters reconnection feature with tests
* Documentation polishing

Rework logic according PR comments

* Make `StompMessageHandler` as a "lazy-load" for the connection
* Add "direct" connect interaction for the `AbstractStompSessionManager`
* Polishing tests

Polishing

Fix `StompAdaptersParserTests#testStompSessionManagerReconnect()` to use "fake" server port

Address PR comments

The further polishing

Some further polishing

* `AbstractStompSessionManager`: `reconnectFuture.cancel(true)` on each `scheduleReconnect()` to avoid something like "DDoS attack"
* Add reconnect feature test for the `StompInboundChannelAdapterWebSocketIntegrationTests`, closing and then refreshing again the `serverContext`
2015-11-13 14:19:18 -05:00
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
febea4fe40 MQTT: Document Java Config
http://stackoverflow.com/questions/33655970/eclipse-paho-mqtt-spring-java-configuration
2015-11-12 12:12:12 -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
c75a95c555 JMS: Doc: Explain Gateway Correlation Techniques 2015-11-04 18:31:30 -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
Gary Russell
e5577b1e50 Fix Control Bus Doc Typo
s/JMS/JMX/
2015-10-28 10:31: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
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
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
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