Allows reply channel resolution after a message has been serialized
somewhere in a flow. Previously, the reply channel was lost.
With this change, the reply channel can be registered and the header
becomes a string (channel name) that can be serialized.
JIRA: https://jira.springsource.org/browse/INT-2269
INT-2269 Rename Registry to HeaderChannelRegistry
- Extract interface
- DefaultHeaderChannelRgistry
INT-2269 Polishing; PR Comments
- Add errorChannel registration as well.
INT-2269 HeaderChannelRegistry - Fix
The internal BridgeHandler in MessagingGatewaySupport did not have
a channel resolver. When a reply was explicitly routed to the gateway's
reply channel, the String representation of the reply channel could
not be resolved to a channel.
Set the BeanFactory on the bridge handler.
Add tests.
INT-2269 HeaderChannelRegistry - Fix JMS/Enricher
The JMS inbound gateway and ContentEnricher instantiate a
MessagingGatewaySupport internally it does not get a
reference to the BeanFactory. This means that the internal
BridgeHandler cannot resolve the String representation of
the reply channel to a channel.
Make ChannelPublishingJmsMessageListener BeanFactory aware, and
propagate the bean factory to the MGS.
Set the MGS bean factory in the ContentEnricher (which is already
BFA).
INT-2269: Polishing
Begin by refactoring `FileTransferringMessageHandler` to use
a `send` operation on RemoteFileTemplate.
Effectively transfer all properties from the adapter to the
template.
This will allow reuse of the send logic from the adapter in
the outbound gateway for `put` and `mput`.
JIRA: https://jira.springsource.org/browse/INT-3203
Enable the use of multiple JSch channels over a
single connection.
JIRA: https://jira.springsource.org/browse/INT-3047
INT-3047: Polishing locks logic
INT-3047 SFTP Reset Cache; Quiesce Shared Sessions
Support resetCache() on the CachingSessionFactory
- reset a shared JSch session so it is reestablished on next use
- immediately close idle sessions
- close in-use sessions as they are returned
- close the channel when an SftpSession is closed and a shared JSch is being used
- physically close a shared JSch session only when the last channel is closed
Polishing
Forgot to save the ftp.xml.
Change CachedSession.epoch to created.
INT-3047 Polishing - PR Comments
- Also add missing docs for `preserve-timestamp`
INT-3047 Polish - PR Comments
Also change epoch to nanoseconds and use a simple != comparison with the
epoch in which a session was created.
Convenience for configuring a custom listener container - avoids
having to transfer many attributes from the adapter to the
bean when switching to a custom implementation.
JIRA: https://jira.springsource.org/browse/INT-2421
INT-2421 Polishing - PR Comments
Also auto-create adapter channel if necessary.
JIRA: https://jira.springsource.org/browse/INT-3198
* Expose `RedisQueueMessageDrivenEndpoint.recoveryInterval` to Namespace support
* Add parser's tests
* Rename parser test class
* Polishing for concurrency of`RedisQueueMessageDrivenEndpointTests#testInt3196Recovery` test
* Add documentation for 'recovery-interval' and Redis Events implementation
Doc Polishing
Add more delay because of unsolvable race condition in the Redis Subscription - see DATAREDIS-242
Catch `RedisSystemException` in the `ListenerTask` and sleep current Thread
with `recoveryInterval` if the Endpoint is `active` before the next `restart()`
JIRA: https://jira.springsource.org/browse/INT-3196
RedisConnFailure & RedisSys Exceptions recovery
Introduce `RedisIntegrationEvent`s
* Catch all `Exception`s on `this.boundListOperations.rightPop`
* Log them and send within `RedisExceptionEvent`
* Mark some fields with `volatile`
JIRA: https://jira.springsource.org/browse/INT-3177
* Change `RedisPublishingMessageHandler.StringRedisTemplate` to `RedisTemplate<?, ?>`
* Don't provide `serializer` to the `template`
* Use `serializer` directly for values which are not `byte[]`
* Add `RedisAvailableTests#awaitContainerSubscribed` for tests to avoid race conditions
* Refactor some tests
* Add test for `byte[]` payload
INT-3177: Generic RedisInboundChannelAdapter
Port from Spring XD: allow for `RedisInboundChannelAdapter`
to receive from Redis any object, not only String
* Make `serializer` property 'resettable' to `null`
* Change `RedisInboundChannelAdapterParser` to allow to apply
empty value from `serializer` attribute
* Add parser test and test for `byte[]` messages
INT-3177: Polishing and documentation
JIRA: https://jira.springsource.org/browse/INT-3033
* Add `topic-expression` to `<int-redis:outbound-channel-adapter>`
* Add tests and docs
INT-3177: Deprecate `RedisPublishMH.defaultTopic`
* Make `topic` and `topic-expression` attributes as mutually exclusive
* Polishing Redis Topic Parsers
* Polishing tests and docs
* Default `serializer` for Redis Topic Adapters is `StringRedisSerializer` for backward compatibility
Polishing according PR's discussion
INT-3177 Doc Polishing
JIRA: https://jira.springsource.org/browse/INT-3017
* Add parsers tests and integration tests
* Polishing Redis XSD
* Fix `JmsMessageDrivenEndpointParser` `LifeCycle` attributes
* Catch `RedisSystemException` after `this.boundListOperations.rightPop`.
It maybe an exception about 'connection closed'.
If the `RedisQueueMessageDrivenEndpoint` is 'active' this exception is rethrown,
otherwise just logged under error category.
* Add Redis queue components docs
JIRA: https://jira.springsource.org/browse/INT-3019
INT-3017 Doc Polishing
Previously, `MetadataStore` couldn't be configured for Twitter Adapters
- only a global one could be used.
The `metadataKey` was generated automatically with a 'difficult' value.
* Register all `MessageSource` for `SourcePollingChannelAdapter`
as beans with id based on adapter id and prefix '.source' (INT-3147)
* Polishing parser to get rid of explicit `MessageSource` beans. (INT-3147)
* Make Feed and Twitter adapters `id` attribute as required -
now it presents a `metadataKey` for `MetadataStore` (INT-3147)
* Add to Twitter adapters a reference attribute for `MetadataStore` (INT-3173)
* Add Twitter adapters `poll-skip-period` attribute (INT-3167)
* Add and implement `MetadataStore#remove` (INT-1941)
* Make `MetadataStore` as `@ManagedResource` (INT-1941)
* Polishing tests
JIRAs:
https://jira.springsource.org/browse/INT-3147https://jira.springsource.org/browse/INT-3167https://jira.springsource.org/browse/INT-3173https://jira.springsource.org/browse/INT-1941
INT-3147: Polishing and fixes
* add domain suffix to `metadataKey`
* change contract of `MetadataStore.remove`
* remove timeout window from `AbstractTwitterMessageSource`
* polishing and fix `SearchReceivingMessageSourceWithRedisTests`
INT-3147: Rebasing and polishing
INT-3147: fix 'metadata' package tangle
INT-3147 Doc Polishing
* Add `AmqpHeaders` headers
* Add `JavaType` headers mapping to `DefaultAmqpHeaderMapper`
* Add ability to Json Transformers to add/extract `JavaType` headers
* Make `JsonToObjectTransformer#targetClass` as non-required and do fallback
to extract type from `JavaType` headers
* Add `JavaType` extraction in the `JsonObjectMapper` implementors
JIRA: https://jira.springsource.org/browse/INT-2809
INT-2809: Polishing and refactoring
* Introduce `JsonHeaders`, `AbstractJacksonJsonObjectMapper`
* Move `TestPerson` and `TestAddress` to package level
* Now `JsonToObjectTransformer` supports not only `String` payload
* Remove json headers after transformation in the `JsonToObjectTransformer`
INT-2809 Minor Polishing
INT-2809 Docs and What's New
Allow customization of the generated ObjectName for the
Integration components.
JIRA: https://jira.springsource.org/browse/INT-2628
INT-2628 Polishing
- Address PR comments
- Rename `naming-strategy` to `object-naming-strategy` for consistency with `object-name-static-properties`
Wrap `FileInputStream` and `FileOutputStreams` with
`BufferedInputStream`, `BufferedOutputStream` respectively.
Also use `BufferedReader`, `BufferedWriter` to wrap `FileReader`, `FileWriter`.
JIRA: https://jira.springsource.org/browse/INT-2953
When declaring an IntegrationMBeanExporter, use an 'id' attribute
if you wish to obtain programmatic access to it (using injection
or referencing the BeanFactory.
JIRA: https://jira.springsource.org/browse/INT-3183
Also turn off debug logging for JMX test cases.
Previously, these tests examined specific stack frames to
verify the handler was directly invoked by the Dispatcher.
JIRA: https://jira.springsource.org/browse/INT-3188
Add a utility method to scan the stack trace instead to
verify that the Dispatcher frame exists before any
MessagingMethodInvokerHelper frame.
Previously, methods with primitive parameters were not matched
with primitive wrapper objects.
Check, if the argument is a primitive wrapper, that the paramer type
can be the equivalent primitive.
Add test case.
INT-3182 Polishing - PR Comments
Extract PrimitiveWrapper->Primitive map to ClassUtils.
JIRA: https://jira.springsource.org/browse/INT-3182
When a simple MessageHandler is referenced from a
`<service-activator/>`, it is wrapped in an anonymous
AbstractReplyProducingMessageHandler to facilitate proper handling of
the `<request-handler-advice-chain/>` and so that normal
'produced no reply` messages are logged.
Previously, this caused 2 MBeans to be exposed, one for tha actual
handler; one for the wrapper.
This added more stack frames between the dispatcher and the
handler (because 2 sets of statistics were captured).
The root cause was that the MBean exporter was not aware of the
relationship between these objects.
https://jira.springsource.org/browse/INT-3186
Add code to the IntegrationMBeanExporter to suppress adding
metrics to the wrapper.
This involves detecting that it is a wrapper and not exposing
it as an MBean and, when matching handlers with endpoints,
checking that the wrapped handler is the actual handler for the endpoint.
Update test to reflect the reduced number of stack frames between
the dispatcher and handler.
Also add tests to verify the detection of multiple references to
the same ARPMH.
INT-3186: `IntegrationMBeanExporter` optimization
- Close child context before parent to publish child close event to parent
- SpelRouter FB injection
- Don't pass null Method to TransactionAttributeSource.getTransactionAttribute()
When determining candidates for direct invocation, we need
to use the target of any existing proxy (such as JMX Metrics).
Copy ServiceActivatorDefaultFrameworkMethodTests to the JMX project
and adjust to work with JMX Proxies.
INT-3185: fix for AbstractSMHFBean#checkReuse
JIRA: https://jira.springsource.org/browse/INT-3185
JIRA: https://jira.springsource.org/browse/INT-3181
INT-3181: Fix JdbcChannelMS#pollMessageFromGroup
* Add `doRemoveMessageFromGroup` and check its result.
If it is `false` then just return `null`, not polled `Message`
* Add `AbstractTxTimeoutMessageStoreTests#testInt3181ConcurrentPolling` test
and implement it for some DBs
* Make a note regarding MVCC as important in the Doc
Minor Polishing
Previously, the TcpConnectionOpenEvent was published as soon
as the socket was connected, but the TcpConnection was not yet
ready for use.
Defer publishing the event until the connection is fully
initialized and registered with the factory and thus available
for use.
Update the test cases to reflect this behavior.
Since the event is now published by the appropriate concrete
factory implementations, enhance the ConnectionToConnectionTests
to verify proper eventing with both Net and NIO implementations.
INT-3178: Add `theConnection` `ReadWriteLock`
INT-3178 Polishing
- Refactor obtainConnection() into obtainSharedConnection() and obtainNewConnection() for Net and NIO Client factories.
- obtainConnection is now common for these two factories, and overridden by the caching and failover factories.
- ReadWriteLock - double check for shared connection after lock obtained.
INT-3178: Polishing
JIRA: https://jira.springsource.org/browse/INT-3180
* Change non-existing interface in the config to existing one
* Change `@Test(expected=BeanCreationException.class)` to `try...catch` block
and check the StackTrace for appropriate, expected `Exception`
https://jira.springsource.org/browse/INT-2961
onInit() relied on subclasses calling super.onInit() to apply the
advice chain and add the BeanFactory to the MessagingTemplate.
At least one extension (smpp) failed to do this, disabling these features.
Make onInit() final and call doInit() for subclass initialization (no-op in ARPMH).
INT-2961 Polishing
- do not increase visibility of doInit in subclasses.
- remove final modifiers from doInit so user subclasses can participate in initialization if needed.
https://jira.springsource.org/browse/INT-2629
Strategy for mapping gateway methods to map method arguments
to a message.
Default strategy works as today, but pluggable using attribute
'mapper' on <gateway/>.
A custom mapper should implement InboundMessageMapper<MethodArgsHolder>
where the MethodArgsHolder contains the Method object and the argument
values.
When using a custom mapper, the mapper is entirely responsible for
creating the Message - therefore 'payload-expression' attributes
and <header/> elements are not allowed.
INT-2629 Polishing - Javadocs
INT-2629 Polishing
- Introduce MethodArgsMessageMapper - higher level API for custom mapper.
INT-2629: Polishing docs
Previously, there was a `synchronized` block in the `GroovyScriptExecutingMessageProcessor`
to achieve thread-safety around script variables.
In addition, the parsing and executing logic was delegated to `GroovyScriptFactory`, who, in turn,
has its own `synchronized` around script parsing.
This causes a bottleneck in a messaging architecture.
* Introduce `GroovyScriptExecutor implements ScriptExecutor`
to encapsulate Groovy parsing and executing logic
* synchronize via `ReentrantLock` only when script resource `isModified()`
JIRA: https://jira.springsource.org/browse/INT-3166
INT-3166: Fixes and Polishing
INT-3166: add synchronized double check
INT-3166: Remove `GroovyScriptExecutor`
Polishing tests and logic around exceptions
Fix up some white space issues in Groovy*Tests
* Ensure close connections after tests
* Remove `Thread.sleep` where it is possible
JIRA: https://jira.springsource.org/browse/INT-3113
INT-3113: Improve `RedisAvailableRule`
* Upgrade to Spring-Data-Redis-1.1.0
* Change Redis port to default one - 6379
Polish - add smart delay to SubscribableRedisChannelTests.pubSubChannelTest
https://jira.springsource.org/browse/INT-3069
Provide a mechanism to specify headers and payload-expression that can
be applied to all methods in the gateway.
- Headers defined as 'default' are globally applied to all gateway methods.
- Also supports 'default-payload-expression'.
- Headers defined on a specific method override the global settings.
- An `@Header` in the interface is overridden by a specific <header/> for that method (current behavior)
- An `@Header` in the interface is NOT overridden by a <default-header/>
- Add 3 new SpEL variables:
-- #methodName (synonym for #method - deprecated)
-- #methodString (a string representation of the method showing return type and arg types)
-- #methodObject (the Method object)
<int:gateway id="sampleGateway"
service-interface="org.springframework.integration.gateway.GatewayInterfaceTests.Bar"
default-request-channel="requestChannelBaz">
<int:default-header name="name" expression="#methodName"/>
<int:default-header name="string" expression="#methodString"/>
<int:default-header name="object" expression="#methodObject"/>
<int:method name="baz">
<int:header name="name" value="overrideGlobal"/>
</int:method>
</int:gateway>
INT-3069 Polishing - PR Comments
- Remove extra 'method' variables, just provide `gatewayMethod`.
- Parser improvements
- Schema now enforces default-header elements to precede method elements
- Doc polishing
When recursing, the returned filenames are relative to
the top level directory.
INT-3172 (S)FTP - Add Recursion to MGET Command
https://jira.springsource.org/browse/INT-3172
INT-3172 Polishing
- PR Comments
- Add Tests for SFTP (tested with Mock and real SSH)
- Enhance test to ensure subdir is in 3rd file retrieved
- Exclude "special" directories ('.' and '..') from recursion
INT-3172 Make FtpServerRule Safe For Concurrency
Previously the port was static.
- Make the port an instance variable
- Channel the `@ ClassRule` to a `@ Rule`
- Register an appropriate DefaultFtpSessionFactory bean declaration
INT-3172 Polishing; Docs
- Rename FtpServerRule to TestFtpServer
- Remove restriction on filters for MGET
- Add test for filtered MGET
- Reference docs, what's new
INT-3172 More Polish
- Fix type in reference
- Fix error message now that filter is allowed with MGET
- Remove test for filter with MGET (now valid)
INT-3172: Fix tests and typos
INT-3172: this.remoteFileSeparator for recursion
* Add `local-directory-expression` to (S)FTP Outbound Gateways
* Add `FtpServerRule` to Apache Mina embedded FtpServer
* Add tests for (M)GET and `local-directory-expression`:
FTP tests uses `FtpServerRule`, SFTP tests need testing on real SFTP server
JIRA: https://jira.springsource.org/browse/INT-2866
INT-2866: Documentation
INT-2866 Polishing
- Remove leading /
- Change \ to / in invalid test
- Clean up after sftp
Tested with real SSH.
INT-2866 Polishing - Add Mock SFTP Test
Run with -Dspring-profiles-active=realSSH to run with a real SSH server.
Assumes ftptest/ftptest account on localhost with the following directory tree in the user's root...
$ tree sftpSource/
sftpSource/
├── sftpSource1.txt
├── sftpSource2.txt
└── subSftpSource
└── subSftpSource1.txt
INT-2866: Polishing
INT-2866: change `remotePath` to `remoteDirectory`
Doc Polishing.
byte[] and String payloads were written to a temporary file.
If the same message is transferred to two different destinations
concurrently, one of the adapters could remove the temporary
file while the other was using it.
Don't use a temporary file for these payloads, simply use the
payload byte[] [or a String.getBytes()] as the InputStream
passed to the Session.write() method.
Polishing
Polishing - Add WARN For Missing File
+ Test
JIRA: https://jira.springsource.org/browse/INT-3091