The "transaction" synchronization tests use a `QueueChannel`.
The payload is a live reference to the Redis object.
It is possible that the test for the returned size occurs after
the "transaction" commits.
Change the tests to extract the size() on the poller thread so
that the size is always captured before the "transaction" commits.
JIRA: https://jira.spring.io/browse/INT-3614
The `extractPayload` is present in the namespace support for `<int-jms:inbound-channel-adapter>`,
but nor `JmsInboundChannelAdapterParser`, neither `JmsDestinationPollingSource` take care of that value.
To be consistent with `<int-jms:message-driven-channel-adapter>` and documentation, introduce that option for
`JmsDestinationPollingSource` and populate it from the `JmsInboundChannelAdapterParser`.
JIRA: https://jira.spring.io/browse/INT-3620
Add `setShouldAppendNewLine(boolean shouldAppendNewLine)` method to the
`FileWritingMessageHandler` class. Added similar test methods to the
`FileWritingMessageHandlerTests` class.
INT-3620: `appendNewLine` just only for `FileExistsMode.APPEND`
Also add `appendNewLine` for `File` payload
INT-3620: `appendNewLine` for any `fileExistsMode`
JIRA: https://jira.spring.io/browse/INT-3604
There is no test-case to cover the issue, because it isn't so easy to emulate the network glitch between `setIfAbsent` and `expire`
JIRA: https://jira.spring.io/browse/INT-3598
- Force the first two constructor args to be of type `String`.
- When no client factory, add one in the parser rather than selecing an alternate ctor.
Conflicts:
spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/config/xml/MqttParserUtils.java
spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParserTests-context.xml
spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParserTests.java
Remove test for unsupported `empty topics` functionality
JIRA: https://jira.spring.io/browse/INT-3587
There is no ability to use own local LockRegistry to avoid overlapping of produced ReentrantLock objects, it can happens if used unique keys have same masked value for DefaultLockRegistry.
Add a constructor to allow the configuration of a lock registry with a differnt number of locks than the default.
JIRA: https://jira.spring.io/browse/INT-3560
Previously, messages arriving at the delayer before the
the context was initialized would be emitted twice after
the context `refresh()` or a JMX invocation of `reschedulePersistedMessages()`.
When using a `SimpleMessageStore`, the "re" scheduled
message from the context refreshed event (or a JMX invocation)
would be re-handled unconditionally.
This was due to incorrect logic to handle the way the `SMS` stores messages.
Change the logic to correctly handle (ignore) duplicate scheduled
releases when using `SMS`.
JIRA: https://jira.spring.io/browse/INT-3572
Previously, a blocking queue was used to hold seen files; this was used to enable
FIFO when a max capacity is set.
When used with no capacity, a queue is not needed; also the `contains` operation
on a queue requires a linear search which does not scale well for a large number
of files.
Use a `HashSet` instead to significantly improve the `contains` performance.
Only maintain a queue if a max capacity is set.
Fix `AcceptOnceFileListFilterTests` to be compatible with Java < 8
JIRA: https://jira.spring.io/browse/INT-3565
Cast to `IntegrationObjectSupport` fails if the handler is
already proxied in `AbstractSimpleMessageHandlerFactoryBean`.
Conflicts:
spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java
Resolved.
INT-3565 Polishing
- Fix test.
- enhance test to show that directly bound message handler beans are not advised if already proxied.
JIRA: https://jira.spring.io/browse/INT-3545
Previously, the `DefaultHeaderChannelRegistry` was auto-started.
This caused the reaper to run and eventually start all the
`taskScheduler` threads, even if the registry was not being used.
- Defer the `start()` until the first channel is stored.
- Do not start the reaper if the bean has been explicitly stopped.
- Deprecate the implementation of `SmartLifecycle`.
Conflicts:
spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java
Resolved.
__cherry-pick to 3.0.x__
JIRA: https://jira.spring.io/browse/INT-3543
Quoting Sam Brannen:
> However, one should *never* programmatically close the injected application context in a test,
since the Spring TestContext Framework caches all contexts across the entire JVM process.
If you need to close a context after a test method or test class for some reason,
the only supported and reliable mechanism is `@DirtiesContext`.
**Cherry-pick to 4.0.x**
JIRA: https://jira.spring.io/browse/INT-3539
Previously the `ChannelSecurityInterceptorBeanPostProcessor` eagerly loaded all beans from its `afterPropertiesSet`
to retrieve the `ChannelSecurityInterceptor`s. According to the `BeanPostProcessor` nature the `afterPropertiesSet` hook isn't legitimate.
It may cause some bad side-effects for other beans, which might not been initialized yet.
Rework `ChannelSecurityInterceptorBeanPostProcessor` to accept `Collection<ChannelSecurityInterceptor>` in the ctor.
Rework `SecurityIntegrationConfigurationInitializer` to iterate over `BeanDefinition`s to determine those of them, which
are `ChannelSecurityInterceptor` or `ChannelSecurityInterceptorFactoryBean`.
**Cherry-pick to 4.0.x**
JIRA: https://jira.spring.io/browse/INT-3536
The fix for opening multiple IMAP connections in the idle
adapter inadvertently removed the check for the store being
open.
Add `connectStoreIfNecessary()` and test case.
JIRA: https://jira.spring.io/browse/INT-3528
Use `min` and `max` methods instead of sorting an entire collection to get the minimum or maximum element.
Change other inline `Comparator<?>`s to the `final` fields
Conflicts:
spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java
JIRA: https://jira.spring.io/browse/INT-3526
Previously, the URI in the exception message is the raw
URI with placeholders, if present.
Use the expanded URI in the message instead.
(cherry picked from commit 113716e)
JIRA: https://jira.spring.io/browse/INT-3524
Backport to 4.0 schemas.
A number of references (expected-type) still referred to
the Spring Integration 3.0 MessageChanel.
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-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
Polishing for `PoorMansMailServer` to get rid of `smtp` and `pop3` servers to avoid unnecessary Base64 dependency
JIRA: https://jira.spring.io/browse/INT-3499
- Suppress (log) 'null' payload error when no correlation data
- Change tests to use a dedicated template for confirms/returns
Conflicts:
spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundChannelAdapterParserTests.java
src/reference/docbook/amqp.xml
Resolved.