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
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
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
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
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.
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.
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.
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
`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).
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
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`
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
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
JIRA: https://jira.spring.io/browse/INT-3402
After applying introduction of `AbstractMessageProducingHandler` there was need some simply refactoring to follow with DRY
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
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`
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
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
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
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
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.
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
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.
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
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
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`