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
Remove the need for pseudo-transactional element
INT-2727 PseudoTX
Add PseudoTransactionalTransactionManager
INT-2727
addressed PR comments
cherry picked previous code for mail module to eliminate breaking change
INT-2727
initial refactoring pseudo-tx support to use common configuration
INT-2727
finalizing pseudo-tx synchronization support
INT-2727 polishing
INT-2727 polishing based on PR comments
INT-2727 addressed PR comments
INT-2727 polishing
INT-2727 Remove PseudoTransactionalMessageSource
Instead of getResource, bind the resource holder before
receive() and then add attributes to the holder.
INT-2727 polishing
INT-2727 Polishing
Remove bind of #resource; add beforeCommit() test;
add TransactionTemplate tests.
* describe delayer's `<transactional>` & `<advice-chain>` abilities
* polishing delayer's doc: it looks bad in the PDF
* fix typo for 'proxying'
JIRA: https://jira.springsource.org/browse/INT-2722
INT-2722: Polishing - PR comments
Adjusted DefaultAmqpHeaderMapper to recognize and convert Content-Type
to String if the incoming Content-Type headers is of type
org.springframework.http.MediaType.
INT-2713 polishing
Fix RecipientListRouterParser to extend
from AbstractRouterParser, thus eliminating
the problem described in INT-2626.
Previously, the router was a top level bean and, since
it is an @ManagedResource, the mbean exporter eagerly
instantiated it (and its Recipients) before the
ChannelInitializer ran.
Now, it is an anonymous inner bean inside a FB,
so the exporter no longer "finds" it,
thus deferring the Recipient instantiation
until the router itself is instantiated via its FB,
which will be after the C.I. runs.
This is all fine, with one caveat - previously the RLR
is made available as an MBean - now it is not,
unless you ALSO add the int-jmx:mbean-exporter.
However, the MBean is very basic, with no attributes and
a single operation 'setShouldTrack()', so the risk is
extremely low and the workaround is to add the
IntegrationMBeanExporter.
INT-2626 polished based on PR comments
Initial Implementation; UDP test.
syslog - Add TCP Test
Add single byte terminating deserializer and a
subclass that terminates on LF (syslog uses
LF terminator).
Move to Core
Allow for transport of undecoded packet over, say, AMQP.
INT-2711 Syslog Transformer
PR Comments; Polishing.
Remove List option; support to-map version only.
When using an outbound adapter with a server connection factory
(an inbound adapter 'owns' the connections), the outbound adapter
simply logged exceptions.
There are use cases where flows need to know the exception occurs.
Change the adapter to throw a MessagingException.
Update the 2.1 to 2.2. Migration guide explaining that the
ExpressionEvaluatingRequestHandlerAdvice can be used to restore
2.1 behavior, and trap the exception.
Stateful retry requires some state to determine the
retry count for a resubmitted message.
State is provided by a retry state object generated by a
state generator. No standard state generators were
provided by Spring Integration.
Provide a SpEL-Based state generator to create a
RetryState object from a Message (for example, using
the jms message id header).
Add ErrorMessageSendingRecoverer - a RetryCallback
invoked when recovery attempts are exhausted.
Add string-based constructor to Spel Advice for
easier <bean/> configuration.