Fixed hung assembler described in INT-3453.
Used CountDownLatch instead of sleep()
INT-3453 Add Test Case
Currently failing for me - assembler thread stuck on CDL.
Remove redundant `if (TcpNioConnection.this.writingLatch != null)` from `ChannelInputStream#write`
Conflicts:
spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionTests.java
JIRA: https://jira.spring.io/browse/INT-3433`
If a read fails due to insufficient threads, delay the read
for (default 100ms) - do not re-enable OP_READ until that
time has elapsed. Avoids spinning the CPU.
INT-3433 More Polishing
If the assembler couldn't execute a new assembler after assembling
the current message (when it detected there is more data), in the
finally block it would "continue" only if the socket was still
open.
The test case closes the socket after sending 4 messages so when
this condition occurred, the assembler failed to continue and
data was left in the buffer.
Remove the `isOpen()` check in the finally block and always continue
if there's not another assembler running and there's data available.
INT-3433 More Polishing
We can still get starvation if the selector is in a long
wait (in select()) when a read is delayed.
Whenever a read is delayed, wake the selector so its next
select will use the readDelay timeout.
INT-3433 Reference Docs
Also remove Thread.yield().
Revert redundant boolean return from `TcpNioConnection#checkForAssembler()`
Conflicts:
spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java
spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java
JIRA: https://jira.spring.io/browse/INT-3423
Consider a message containing "one one" and a splitter
with expression "payload.split(' ')", only one message
is emitted.
The default Collection created by SpEL is a HashSet.
Change the ExpressionEvaluatingSplitter to expect a
List instead of a Collection.
Conflicts:
spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java
JIRA: https://jira.spring.io/browse/INT-3410
When running a fixed thread pool with a bound queue,
and CALLER_RUNS execution rejection policy, it
was possible to deadlock the IO selector thread.
Add a `CompositeExecutor` to use different threads for
IO to those used for message assembly.
Add a `CallerBlocksPolicy` to block the invoking thread
(for a specified time) if the pool is exhausted.
Add documentation.
Polishing
Reference docs in preface mention Spring Integration compatibility with
Java 8, once it's released. Since Java 8 is released, the extra note is
no longer relevant and should be removed.
This patch removes no longer relevant note of pending Java 8 release.
JIRA: https://jira.spring.io/browse/INT-3400
JIRA: https://jira.spring.io/browse/INT-3355
Previously, the RedisAvailableTests unconditionally
flushed Redis; this is not appropriate and could affect
other builds on the CI server (as well as wiping out the
developer's Redis DB).
Change the tests to clean up their own redis data.
Conflicts:
spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisStoreInboundChannelAdapterIntegrationTests.java
spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreOutboundChannelAdapterIntegrationTests.java
spring-integration-redis/src/test/java/org/springframework/integration/redis/rules/RedisAvailableTests.java
spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageGroupStoreTests.java
spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageStoreTests.java
Resolved.
JIRA: https://jira.spring.io/browse/INT-3346
An `@Id` field is required when MongoDB auditing
is enabled in the ApplicationContext.
This change does not make the document Auditable,
it just prevents an exception being thrown when
auditing is enabled.
Also add another control-bus test.
Conflicts:
spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusTests.java
Resolved.
JIRA: https://jira.spring.io/browse/INT-3316
The `SimpleTypeConverter` delegate uses property editors
which are not thread safe. We protect against concurrent
access when the source is not a String, but when a String,
we delegate to the `STC`.
Synchronize access to the `STC.convertIfNecessary()` method.
JIRA: https://jira.springsource.org/browse/INT-3313
Previously, when `requires-reply="false"` on a `<jms:outbound-gateway/>`
a `null` reply caused a `MessageTimeoutException`, instead of quiet ending of flow.
Conflicts:
spring-integration-jms/src/test/java/org/springframework/integration/jms/JmsOutboundInsideChainTests.java
Resolved.
JIRA: https://jira.springsource.org/browse/INT-3305
Previously, if the channel can't be connected (e.g. if the server
does not support SFTP), the connection to the server remained open.
Close the session in the event of a failure.
Add test with the Apache SSHD server.
JIRA: https://jira.springsource.org/browse/INT-3298
Emit a WARN log whenever the `ReleaseStrategyFactoryBean`
falls back to using the `SequenceSizeReleaseStrategy`.
This will happen if no method name is provided and no
annotated method is found, or a null reference is provided.
https://jira.springsource.org/browse/INT-3310
Previously, the syslog adapter tried to convert the ErrorMessage
that results from a socket error to a syslog packet, resulting
in a stack trace on stderr.
Test for the ErrorMessage and log at DEBUG.
JIRA: https://jira.springsource.org/browse/INT-3300
The change introduced by https://jira.springsource.org/browse/INT-3147
(Registration of `MessageSource<?>` as a bean with suffix `.source`) broke
the case where `MessageSource<?>` is a reference to an existing bean.
Add check to the `AbstractPollingInboundChannelAdapterParser` for the type
of `source` and apply the appropriate logic.
Conflicts:
spring-integration-core/src/test/java/org/springframework/integration/config/ChannelAdapterParserTests.java
Resolved.
ByteArraySingleTerminatorSerializer does not support multiple
subsequent terminators (zero length messages).
JIRA: https://jira.springsource.org/browse/INT-3290
* Add unit test to verify bug.
* Fix bug.
Polishing:
* Remove test for `n >= 0`; n cannot be < 0 here
* Move test case to `DeserializationTests`
JIRA: https://jira.springsource.org/browse/INT-3285
Spring Integration 3.0 introduced the `JsonHeaders` and populates them
from a request AMQP Message to the SI Message. In the case of the `AmqpInboundGateway` and
`JsonMessageConverter`, if the SI flow doesn't do anything with `JsonHeaders`
they are returned to the `AmqpInboundGateway` for reply Message
and may override correct values provided by `JsonMessageConverter` in the `DefaultAmqpHeaderMapper`.
This fix provides the check for headers from the reply Message's `MessageProperties`
and populates `JsonHeaders` if the `MessageProperties` doesn't contains the `__TypeId__` header already.
Note, it is just a fix for regression to restore previous behavior.
There is maybe a reason to revise (Another JIRA) all standard AMQP headers and populate them from SI `MessageHeaders`
in the `DefaultAmqpHeaderMapper`, only if they haven't been populated by `MessageConverter` before.
**Cherry-pick to 3.0.x**
Conflicts:
spring-integration-amqp/src/test/java/org/springframework/integration/amqp/inbound/InboundEndpointTests.java
Resolved.
JIRA: https://jira.springsource.org/browse/INT-3243
* Change `IntegrationRequestMappingHandlerMapping` to postpone
Handlers detection as late as possible using `ApplicationListener<ContextRefreshedEvent>`.
This is needed, because `RequestMappingInfoHandlerMapping#afterPropertiesSet()`
iterates over beans from the `BeanFactory` to detect MVC Handlers. But at the same time
Integration Endpoints require a `requestChannel` as a dependency and those may be postponed
for `auto-creation` by `ChannelInitializer` - late-binding issue.
JIRA: https://jira.springsource.org/browse/INT-3274
* Add condition on `springVersion` to check `BUILD-SNAPSHOT` release category on version
and enable `libs-snapshot` repository
To allow CI plan to build with SF snapshots it's just enough to configure the Gradle option
`-PspringVersion=3.2.7.BUILD-SNAPSHOT`
- ((CachingSessionFactory<?>.CachedSession) session).dirty();
+ ((CachingSessionFactory.CachedSession) session).dirty();
Failed to compile with Java6 (compiles ok with Java7 with
sourceCompatibility=1.6).
If an exception occurs on a session it should be physically closed
and not reused because its state is indeterminate and the next
operation might fail.
Note: The booleans within CachedSession do not need to be volatile
because it is a short-lived object only used by the current thread.
Also fixes the assertion message in RFT.get().
JIRA: https://jira.springsource.org/browse/INT-3266
INT-3266 Polishing - PR Comments
Remove need for SuppressWarnings.
Fix 2 test cases where the exception has an additional cause.
Fix invalid `GenericMessage` import
Fix `e.getCause()` in `FtpServerOutboundTests` & `SftpServerOutboundTests` tests
Set up stored procedure name in `SimpleJdbcCall` before setting
up row mappers; previously the debug logg showed `[null]` for
the procedure name.
JIRA: https://jira.springsource.org/browse/INT-3265
JIRA: https://jira.springsource.org/browse/INT-3252
Remove the use of `SecureRandom.generateSeed()` which is not
supported on some platforms.
Note: While this change does not reflect the custom IBM
code noted in the JIRA issue, it does revert the initial
SecureRandom generation to use the same code as
UUID.randomUUID(), so the expectation is that this will
work fine on zOS.
JIRA: https://jira.springsource.org/browse/INT-3240
Spring Integration 3.0 introduced registration of `MessageSource`s as beans
with an `id` based on the adapter `id` or, as a fallback, generated from
the `MessageSource` class name and the suffix `.source`.
But since that bean wasn't registered as a bean with the generated name (because the suffix was added),
subsequent elements get the same source bean name. This meant that
several anonymous `inbound-channel-adapter` with the same type (`file:`, `ftp:`, `twitter:` etc.)
caused an issue, when the same `MessageSource` bean was used by several `SourcePollingChannelAdapter` beans.
Fix the issue for fallback name generation by using the `SourcePollingChannelAdapterFactoryBean` class name.
Since that is registered, the source will always get a unique name, regardless of whether an id is provided.
Remove warning from BFCR if there is no HeaderChannelRegistry in
the bean factory. Change the log to DEBUG and remove the stack
trace.
Instead, update the Exception message when a channel name can't be
resolved to a channel to indicate that there is no registry.
JIRA: https://jira.springsource.org/browse/INT-3248
JIRA: https://jira.springsource.org/browse/INT-3149
* Add a note about `GatewayMethodMetadata`
* Squash several sections to one by type
* Reorder by importance/interestingness
* Remove a note about `MessagingException` for `RetryAdvice`,
as the last one doesn't wrap exceptions to `MessagingException` on each retry