`charset` for `<object-to-string-transformer>` was placed in the common `inputOutputChannelGroup` attributeGroup.
`charset` wasn't available within `<chain>`.
* Move 'charset' from `inputOutputChannelGroup` to the new `specialized-transformer-charset-aware-type` complexType
* Add test for 'charset' within `<chain>`
JIRA: https://jira.springsource.org/browse/INT-2958
Groups changed within the same millisecond that they
were selected for reaping can cause aggregators to
emit duplicate messages.
Use the re-fetched group (used to see if the timetamp
changed) instead of the group passed in to forceClose
(the group might have changed since it was selected as
eligible for reaping).
We still retain the last modified check because it
might have been expired using timeoutOnIdle.
AbstractMessageRouter.getRequiredConversionService() and
IntegrationObjectSupport.getConversionService() try to initialize the
conversion service and may be called from multiple threads. There is
a race condition where this could end up in an uninitialized conversion service
causing NPEs in subsequent method calls.
To solve this issue, the conversion service is initialized with
double-checked locking.
For further details see https://jira.springsource.org/browse/INT-2931
INT-2931 Polishing - Add Test Case
Add a test case that reliably reproduces the issue and verifies
the fix.
* Convert byte[] and char[] to String rather than simply using toString().
* Allow the charset to be configured for byte[] payloads.
* Add tests.
* Add reference documentation updates.
When referencing a <gateway/> from a <service-activator/>, a debug
log is written with a full stack trace.
This is because all methods on the proxy are considered candidates,
but one method (addAdvice) has multiple parameters and can't be
used to process a message.
Add code to detect a proxy that has no target object; if the Proxy
only has one interface, then use that as the targetClass.
During initialization, it is possible for type conversion to fail because a second thread accesses a partially built list of PropertyEditors. This is because getDefaultEditor(Class) is not thread-safe.
* Add a test with mocks and spies to verify concurrent access to the method occurs before the fix, and not after the fix.
* Synchronize the call to getDefaultEditor(), when called from canConvert() and convertValue().
* Only synchronize the call until we have invoked the method at least once.
Operations on QueueChannel (clear, getQueueSize etc) are not available
when the IntegrationMBeanExporter is configured because they
are not declared on the PollableChannel interface.
Add an additional interface QueueChannelOperations.
The proxy proxies all interfaces so users can cast the
proxy to QueueChannelOperations to use its methods.
Previously, `AggregatingMessageHandler#setExpireGroupsUponCompletion` had additional logic
for removing complete MessageGroups. It could produce some overhead on application start-up with big persistent `MessageStore`.
This logic played a role to remove empty groups from a `MessageStore`.
Since `AbstractCorrelatingMessageHandler#forceComplete` has an ability to to remove empty groups too,
this logic became redundant.
So, to clean `MessageStore` from empty complete groups, it's sufficient to use a `MessageGroupStoreReaper`.
* Remove logic iterating over the `MessageStore` from `AggregatingMessageHandler#setExpireGroupsUponCompletion`
* Polishing `AggregatorSupportedUseCasesTests.java` to use `store.expireMessageGroups(0)`
* Introduce `empty-group-min-timeout` xml-attribute, populating `AbstractCorrelatingMessageHandler#minimumTimeoutForEmptyGroups`
* Add parser tests for `empty-group-min-timeout` attribute
JIRA: https://jira.springsource.org/browse/INT-2899
INT-2899: Documentation about changes of ACMH
* rename new XSD-attribute to `empty-group-min-timeout`
* add to Reference Manual description about `empty-group-min-timeout`
* add 'What's new' for `empty-group-min-timeout`
* add 2.2-3.0 Migration Guide note
INT-2899 Doc Polishing
In the parent-child environment configuration that relies on class names may produce
a `ClassNotFoundException`.
* remove usage of `ClassLoader` in the `MapToObjectTransformerParser` and allow to use the `ConversionService` from application context
* remove deprecation from `MapToObjectTransformer`
* refactor `MapToObjectTransformer` to use `IntegrationObjectSupport#getConversionService()`
* remove fallback to the `beanFactory#getConversionService()` in the `ExpressionUtils`
JIRA: https://jira.springsource.org/browse/INT-2888
INT-2928: Do Not Fallback to BF's ConversionService
* Polishing according PR's comments
* Important note about `conversionService` & `integrationConversionService` beans
* Link a JIRA about elimination of `BeanFactory`'s `ConversionService` usage
* Add a note to the 2.2-3.0 Migration Guide
JIRA: https://jira.springsource.org/browse/INT-2928
INT-2888 Doc Polishing
* MessageGroupStore <-> MessageGroupCallback
- Change callback to be an inner interface of the MGS.
* INT-2829 Fix Class Tangle in IP Module
- 3 way tangle between TcpSender, TcpConnection, TcpMessageMapper
- Clean up interfaces (remove setters); add top-level support classes for TcpConnection, TcpConnectionInterceptor.
* INT-2829 Remove TCP Package Tangle
- tcp.connection <-> tcp.connection.support
- Remove ...connection.support package - move classes to ...connection.
* add XSD element for nested router type
* add tests on the matter
* polishing for RouterParserTests
JIRA: https://jira.springsource.org/browse/INT-2893
INT-2893: Polishing
INT-2893: after rebasing to 3.0
XSD changes reverted from 2.2 and moved to 3.0
INT-2893 Polishing
Factor out common elements; fixing missing documentation for
`expression` within a `router` within a `chain`.
AbstractTransactionSynchronizingPollingEndpoint was introduced late in the 2.2 release process to avoid a breaking change to AbstractPollingEndpoint. For 3.0, its methods are now pulled-up into APE.
Further change:
* remove Deprecated Setter (PollerMetadata)
* fix failing test
Copy schemas, cleanup whitespace, update spring.schemas files,
update version in AbstractIntegrationNamespaceHandler.
For each schema compared the 2.2 version with the 3.0 version
(diff -w), ensuring the only difference is the import of
3.0 schemas (where appropriate) instead of 2.2.
The AbstractRequestHandlerAdvice uses an internal wrapper for
Throwable, in a similar fashion to the TransactionInterceptor.
Exceptions are unwrapped properly when exiting the invoke method so
callers are unaware of the wrapping.
The technique is used to avoid user errors (for example catching OOM
Errors and not propagating). User code (subclasses) only catch
Exceptions.
However, in the case of the ExpressionEvaluatingRequestHandlerAdvice,
the exception is included in any ErrorMessage sent to a failureChannel.
User code should not have to navigate these internal exceptions within
the cause tree.
Add a method to the abstract class unwrapExceptionIfNecessary, which
will unwrap the root cause exception if possible.
Add a method to the abstract class unwrapThrowableIfNecessary, which
will unwrap the root cause Throwable if possible.
Update tests to reduce the cause() traversals to reflect the
ThrowableHolderExceptions are no longer in the tree.
Add a test to verify a Throwable (such as an OOM) is properly
propagated.
Add a test to verify that when the root cause is a Throwable (and not
an Exception), the ErrorMessage sent to the failureChannel does not include
the ThrowableHolderException.
qualified inner class @links (when merging)
2.2.0 changed ObjectToJsonTransformr to add content-type to
simplify AMQP applications.
However, in a JMS environment, the DefaultJmsHeaderMapper attempted
to map (and failed) to map the header, emitting a warning log entry.
JMS does not allow '-' in property names.
Add code such that:
1. If the ObjectToJsonTransformer is configured to use a
content-type of an empty String (after trimming), suppress the
addition of the header to the output message. For consistency, if
the inbound message already has a content type header, and the transformer
is configured with an empty String, remove the header.
2. Change the DefaultJmsHeaderMapper to map the MessageHeaders.CONTENT_TYPE
header (content-type) to/from a JMS compliant property name (content_type).
INT-2874 PR Comments
Move constant to JmsHeaderMapper interface and rename.
Fix failing test (explicit set content-type to "").
INT-2874 Documentation Updates
Add docbook and schema documentation clarifying the behavior
of the transformer with respect to setting the `content-type`
header.
INT-2874 Polishing - Remove Header Removal
After further discussion, we decided to not remove an
existing header, if 'content-type' is set to "".
This is because there was no way to handle the case of
NOT adding a header when none present, while retaining a
header if it was already present.
added test for empty content-type attrib and no existing header (while merging)
In the BeanFactoryTypeConverter, when falling
back to a PropertyEditor (when the source is non-
String and the target is String), the setValue() and getAsText()
methods are used.
This is not thread-safe and one thread might get another's
converted value.
Synchronize the use of the PropertyEditor.
Add test, that reliably reproduces the problem, to verify the
fix.
Delegating consumer endpoints (<service-activator/> etc)
may not have both 'expression' and 'ref' attributes.
Previously, 'expression' was ignored when 'ref' was present.
- Enforce mutual exclusivity in AbstractDelegatingEndpointParser.
- Add tests for illegal combinations.
- Improve error message when 'method' used with <expression/>.
- Change parser to use reader.error() instead of Assert.
- Add element description to all parser errors.
Gradle may run tests using multiple threads.
Using shared resources (e.g. `System.out`) may produce concurrency issues.
* Remove usage of `System.out`
* Add mocking around `LoggingHandler#messageLogger`.
JIRA: https://jira.springsource.org/browse/INT-2880
Heretofore there wasn't ability to make some scenario like this, when we want to make failure notification on each retry:
<service-activator>
<request-handler-advice-chain>
<bean class="org.springframework.integration.handler.advice.RequestHandlerRetryAdvice"/>
<bean class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice"
p:onFailureExpression="#exception" p:failureChannel-ref="errorOnEachRetryChannel"/>
</request-handler-advice-chain>
</service-activator>
The second Advice was invoked only once. This was because `ProxyMethodInvocation` keeps the index of current interceptor
on each `invocation.proceed()`, which is recursive by design.
So, change `AbstractRequestHandlerAdvice` to use `((ProxyMethodInvocation) invocation).invocableClone().proceed();`
This way, we get a fresh `MethodInvocation` for the current `Advice` with nested desired advices.
JIRA: https://jira.springsource.org/browse/INT-2858
INT-2858: Polishing; PR Comments
Introduce `AbstractRequestHandlerAdvice.ExecutionCallback#cloneAndExecute()` especially for repeatable Advices, e.g. `RequestHandlerRetryAdvice`
to avoid overhead from `clone()` on simple Advices
INT-2858: Doc ExecutionCallback#cloneAndExecute()
INT-2858 Polishing
Rework docs; add Javadoc; add to test case.
- allow the configuration of release strategies on resequencers
-- adjust the xsd to allow the definition of a release strategy
-- move release strategy parsing to AbstractCorrelatingMessageHandlerParser
-- add unit tests
For reference see: https://jira.springsource.org/browse/INT-2863
INT-2863 Polishing
Fix white space; add @author; update copyright.
INT-2863 Resequencer/Aggregator Docs
Add docs for correlation and release strategis to Resequencer.
Add *.expression docs to Aggregator.
In many cases IDEs import into test configs Namespace-resources
with hardcoded versions of Spring & Spring Integration XSDs.
This may produce build issues with different Spring versions.
It also causes an issue during the transition to a new Spring Integration version (e.g. 3.0).
* Add Gradle task 'checkTestConfigs' to check test configs for hardcoded resources' versions.
* Add to 'test' task dependency on new task 'checkTestConfigs'
* Fix hadrcoded versions in the test configs.
JIRA: https://jira.springsource.org/browse/INT-2845
Expire empty groups.
Due to indentation changes, the code changes look more extensive
than they are. In effect the if (group.size() > 0) test is moved
to a narrower scope and the remove(group) is now performed if the
group is empty.
Document expire-groups-upon-completion.
INT-2832 Doc Polishing
PR Review + punctuation.
INT-2833 Add Delay For Expiring Empty Groups
minimumTimeoutForEmptyGroups
* Remove Class Tangle in JPA
* tcp.connection
* tcp.connection.support
* Add Comment to MessageGroupCallback
- Comment that it is moving into MGS in 3.0.
- Convert DOS newlines to Unix.
For reference see: https://jira.springsource.org/browse/INT-2828
Recent changes to APE were sub-optimal because the subclasses
had to call back into the parent abstract class.
Deprecate doPoll() on APE.
Introduce a temporary intermediate abstract class that supports
transaction synchronization.
This class will be deprecated in 3.0.0 when its methods will
be pulled up into APE.
INT-2815 Polishing
Make ATSPE package visibility.
Add helpers to enable early migration to 3.0 structure.
INT-2815 Polishing
Fix javadoc to emphasize that doPoll() will no longer
be overridable in 3.0.
Rename doReceive() to receiveMessage() to match more closely
with handleMessage().
INT-2815 Polishing
Fix message in UnsupportedOperationException.
Pull transaction synchronization code up from SPCA
to AbstractPollingEndpoint, providing support for
transaction synchronization in PollingConsumer.
Also, ensure headers are copied to any message generated by the
ExpressionEvaluatingTransactionSynchronizationProcessor.
* make `AmqpOutboundEndpoint` 'exchangeName' & 'routingKey' **null** by default
* some polishing for `AmqpOutboundEndpoint`
* verification tests for parameters of `com.rabbitmq.client.Channel#basicPublish`
JIRA: https://jira.springsource.org/browse/INT-2773
INT-2773 Polishing - Allow Override to ""
Previously, there was no way to revert to the previous
behavior by specifying an empty string for the attribute(s).
Add test to verify setting attributes to "" overrides template.
Ensured that bindings of the resource only happen if TransactionSynchronizationFactory is not null
Add documentation describing the expectation for the unbinding of the resource.
INT-2777 Polishing
Don't set up holder if it's not used.
Doc fixes.
Retry Advice (ErrorMessageSendingRecoverer) tried to send a message
with a null payload when the RetryPolicy allowed zero attempts.
Create a MessageHandlingException with the failedMessage, when
no attempts were made to call the handler.
The ExpressionEvaluatingMessageHandlerAdvice now sends an
AdviceMessage which has a payload of the original message, and
a property 'inputMessage' referencing the message that was
sent to the advised handler.
INT-2763 Expression Advice Reference Doc Update
Update to reflect the new behavior.
INT-2683 Tests
Expanded JMS Gateway Tests
INT-2683 First commit
Listener Container Option for Replies
INT-2683 Remove no correlation-key Option
INT-2863 Support DestName and Temp Dest
INT-2683 Add back Support No CorrelationKey
INT-2683 Fix Tests
INT-2683 Polishing
Fallback if no correlationKey and fixed reply queue.
INT-2683 Polishing
Change from SMLC to DMLC
INT-2683 Polishing
Since we changed to DMLC, we can now remove the check for
SingleConnectionFactory.
INT-2683 <reply-listener/> Namespace Support
Add <reply-listener/> subelement to JMS Outbound Gateway.
Jdbc Message Store always converts the correlation id
to a UUID string, even if it's already a String.
This causes reaper issues with the correlating message
handler because the reap occurs under
a different lock to normal group processing.
This change ensures the lock is properly mutually
exclusive.
Added pseudo-tx support for Mail inbound adapters
For polling adapters no changes have been made other then returning a javax.mail.Message instead of its copy so
post-tx dispositions could be performed on it.
For Imap IDLE adapter changes are simiar to the once present in SPCA where TX synchronization logic was added to ImapIdleChannelAdapter
Couple of things to note:
First IDLE receives an array of messages while Polling task receives one message which means i need to sendMessage in the Polling task in the separate thread, so for maintaining single thread semantics we have now it uses single thread executor to send Messages
Renamed MSRH to TransactionalResourceHolder since we no longer use 'source' anywhere and in the case of IDLE there is no MessageSource. Its is truly a holder of attributes we want to make available for use (e.g., SpEL)
INT-1819 Polishing
- Change TransactionalResourceHolder to IntegrationResourceHolder
- Make messageSource available as an attribute
- Allow configuration of Executor for ImapIdle adapter
- Add parser test for TX ImapIdle adapter
- Fix bundlor config for mail
- Remove top level <transactional/> element that was added to core
- Restore 'legacy' mail attributes in TX, and add schema doc
INT-1819 Mail TX Reference Docs
Add reference documentation for mail transaction support.
INT-1819 Remove 'public abstract' from interface
Modifiers are not needed on an interface.
When the reaper runs, and finds a group that is in the
process of being completed, the reaper blocks on the
lock, but when the lock is released, goes ahead and
reaps the group.
Now, after obtaining the lock, the reaper checks to
see if the modified date changed and, if so, aborts
the reap of the group this time around.
Required adding lastModified accounting for SimpleMessageGroup
(accounting already exists for other message groups).
Test case reproduced the problem, demonstrating duplicate
output messages.
After the fix, it shows the reap was aborted in the debug
log.
INT-2751 Polishing
PR Comments
Previously, when the breaker was open, it threw a
MessagingException. This was not wrapped so normal
error-channel processing 'payload.cause.message'
failed because the cause was null.
Change the exception to a new private
CircuitBreakerOpenException.
* ban to use 'channel' and 'request-channel' attributes for 'outbound-channel-adapters' and 'outbound-gateways' when they are declared inside the `<chain>`
* fix usage of `<request-handler-advice-chain>` for components when they are declared inside the `<chain>`
* ban to use `<request-handler-advice-chain>` for 'outbound-channel-adapters' when they are declared inside the `<chain>` don't implement `AbstractReplyProducingMessageHandler`
* refactor `IntegrationNamespaceUtils` to use `BeanDefinition` instead of `BeanDefinitionBuilder` for 'advice-chain' parsing
* tests for new logic for 'channel' and 'request-channel' attributes within `<chain>`
* tests for new logic for `<request-handler-advice-chain>` within `<chain>`
* fix failed test on slow machine
* fix `SysLogTransformer` tests
For reference:
https://jira.springsource.org/browse/INT-2718https://jira.springsource.org/browse/INT-2721https://jira.springsource.org/browse/INT-2719
INT-2718 Polishing