Send is deemed to be successful if sent to at least this
number of subscribers (default 0).
Note: when using a task executor, if there is at least one
subscriber, a send is always good, regardless of success
or failure of invoking the handler.
Polishing - Docs - PR Comments
* add `<spel-function>` XSD element
* add `SpelFunctionParser`
* add `SpelFunctionRegistrar` to avoid introducing some confused 'Method'-bean
* add `SpelFunctionRegistrar` collaboration with `IntegrationEvaluationContextFactoryBean`
* some refactoring for `IntegrationEvaluationContextFactoryBean`
* polishing some failed tests after this change
JIRA: https://jira.springsource.org/browse/INT-1639
INT-1639: SpelFunctionParser use BeanClassLoader
INT-1639: Inherit 'functions' from parent AC
INT-1639: Document the <spel-function>
INT-1639: 'NoSuchBeanDefinitionException' fix
Polishing
Invoke ARPMH Directly (SA, Splitter etc)
If a bean referenced by a service activator etc, is already an ARPMH,
then wire it directly into the endpoint rather than wrapping it in a
MethodInvoking Handler.
Disallow the same bean being used in this way in multiple endpoints.
It would cause rewiring of outputChannel etc.
Detect such use and suggest using prototype scope.
Previously, an ARPMH used in a MethodInvokingHandler didn't work
in some cases, because the "inner" ARPMH had no output-channel
and the outer ARPMH (e.g. transformer) wouldn't get a reply and
would complain if requiresReply is set.
The general solution is to detect the ARPMH targetObject in
AbstractStandardMessageHandlerFactoryBean, invoke canBeUsedDirect()
to allow the subclass to vote - specifically it will be allowed
if the type is not also a special type understood by the subclass
and no endpoint-specific attributes are set.
To this end, remove a few default attributes from the schema to
enable detection of explicit setting of these attributes.
If these conditions pass and the method is handleRequest (either
explicitly or by omission) then wire it in and invoke the
subclass to post process the handler (set attributes).
Restructure this post processing in each subclass so that it can be invoked in
this way, or directly by the subclass when it makes a custom
handler.
Polishing - PR Comments
Mainly a little refactoring in the RouterFactoryBean to allow
the parameter in canBeUsedDirect() to be an ARPMH instead of
Object.
Plus a couple more minor changes.
The `DelayHandler.DelayedMessageWrapper` works correctly, as designed by INT-3049.
However `DelayHandler.DelayedMessageWrapper` contains `Message` as a property
and `GenericMessage` can't be reconstructed automatically.
So, added new `DBObjectToGenericMessageConverter` to read `GenericMessage` for
`DelayHandler.DelayedMessageWrapper#original` property.
JIRA: https://jira.springsource.org/browse/INT-3070
Cherry-picked 2.2.x
INT-3070: PR comments
INT-3070: Remove `assert` for common state
Add an MBeanTreePollingMessageSource that produces a graph of simple objects representing the JMX tree (INT-3124).
The DefaultMBeanObjectConverter converts MBean objects into a graph of Lists, Maps and arrays or primitives.
Formatting tidy, per feedback.
Feedback incorporated: split setter/attributes, more tests, inner bean constructor, logging changes.
Overloaded setter methods with different parameter types are now named separately, the endpoint attributes reflect this and tests are added to reflect this.
An inner bean can be supplied to provide an alternative MBeanObjectConverter.
Log a warning instead of a more destructive UnsupportedOperationException where there's incomplete parsing in the DefaultMBeanObjectConverter and add a trace level for exception debugging.
Minor test change and doc/reference update
Added attribute filter interface as suggested. Three implementations are provided 'all', 'named only' and 'not named'
actually add notnamedfield filter (doh).
Polishing
Polishing tests to follow with new changes in the SPR 4.0
Polishing build.gradle to be compatible with SPR 4.0
Build passes with SPR 3.2.4 too
JIRA: https://jira.springsource.org/browse/INT-3131
Requires Jackson2
Bump Jackson2 version
Remove write support
Add String support
Polishing
Initialize objectMapper field; assert ObjectMapper is not null.
Newlines at ends of files.
Some handlers get a componentName, but not a beanName. For example
the TransformerFactoryBean may create a Transformer that's not
a bean, to wrap a POJO, or expression. The AbstractSimpleMessageHandlerFactoryBean
transfers the component name to the transformer but it has a null
beanName. It would not be appropriate for the FB to change the beanName.
The IntegrationMBeanExporter's fallback, when it can't find the handler
as part of a stand-alone endpoint, is to use the handler's toString().
IntegrationObjectSupport (IOS) toString delegates to Object.toString()
if there is no beanName.
IOS's getComponentName() falls back to the beanName if there is no
component name.
Change the IMBE to use the componentName as the first fallback and,
if null, fallback to the current fallback.
One side effect is that handlers that do have a bean name
will no longer have '.handler' at the end of their name; but this
is not really an issue because the MBean is designated as a
handler anyway (via the bean component of the ObjectName).
However, identifying chain components is new in 3.0 so this is
not really a breaking change.
Previously, 'If-Modified-Since' and 'If-Unmodified-Since' HTTP headers were incorrectly processed
within from/to HTTP headers mapping, because Spring-Web `HttpHeaders` has a confusing method name, see:
https://jira.springsource.org/browse/SPR-10600
* fix 'If-Modified-Since' and 'If-Unmodified-Since' processing independently from `HttpHeaders`
* add fallback to formatted string for date ware HTTP headers
* add Spring Integration HTTP proxy scenario test
JIRA: https://jira.springsource.org/browse/INT-2995
The second chance NIO logic that detects a close being received
in a race condition with a reply needs to be enabled always because
a Failover or Caching connection factory might be using NIO
underneath.
Also, add an epoch to the FailoverTcpConnection's connectionId which
is incremented on each use to prevent a close after a previous
use being received by the current user.
Finally, add code in the FailoverTcpConnection to not propagate
messages from an old (defunct) delegate connection - if the
delegate has changed, the connection must be being used by
another client.
Move definition of the IntegrationEvaluationContextFactoryBean
from DefaultConfiguringBeanFactoryPostProcessor to
AbstractIntegrationNamespaceHandler.
We need a separate eval contexts for each app context so that child
contexts get the correct BeanResolver.
Add Test For IECFB and Parent Context
There were several "helper" classes where the context was initialized
in the constructor, before the BeanFactory was passed in.
Generally fixed by adding the BeanFactory to the constructor args.
Other cases where the container-managed bean instantiated a helper
and never passed in the BeanFactory.
Finally, a fix to ExpressionUtils where the caller had a BeanFactory
but the BF did not contain an EvaluationContext factory bean, the
BeanResolver was not set up. This is unlikely in a Spring Integration
application, but added for completeness.
INT-3115 Add a BeanFactory to Test Cases
Change the WARN log in ExpressionUtils to a fatal exception to detect
cases where an EvaluationContext was created without a BeanFactory.
While this was generally in test cases, it also exposed some cases
in code where the context was initialized without a BF.
polishing on merge
Permit missing URI vars in HTTP outbound gateway
Do not attempt to evaluate uri variables that are not in the URL
The http gateway might not know what uri variables it might obtain in the URI.
This patch makes sure that only the uri variables defined in the uri are parsed (the rest are ignored)
Previously, when a calling thread was waiting for a reply, and an exception
occurred on the socket, the exception was not propagated to the thread and
it would eventually get a timeout, but with no indication of the problem.
Propagate the exception to the calling thread by invoking onMessage()
with an ErrorMessage.
Ignore the ErrorMessage in other TcpListeners (inbound adapter, gateway).
Ensure NIO closes are not missed by sending an ErrorMessage when the selector
thread detects a closed channel.
Add tests for Net, NIO, cached and failover connection factories.
Polishing
Remove left-over debug logs; add comment to setReply().
Add comments for ErrorMessages in onMessage().
Allow modification of context property accessors and
functions.
Polishing
- Fix tests to ensure the EvaluationContextFactoryBean is
available when necessary.
Polishing - Use Utility for ALL EvaluationContexts
Add Test Showing Custom Function
See SpelTransformerIntegrationTests-context.xml
Polishing
Polishing -fix Remote Sync
Polishing - Emit WARN if No BeanFactory
Polishing - Do Not Override ConversionService
Kludge to Prevent Warning When No BeanFactory
Expressions for method invoking in the MessagingMethodInvokerHelper
don't need a BeanFactory - suppress the warning.
Polishing - PR Comments - Invert Boolean
Support nesting the fail over and caching client connection
factories.
The TcpListener chain was not set up properly; this prevented
caching Failover connections, or Failover cached connections.
Each nested interceptor needs the next outer interceptor set
up as its listener, so the underlying connection calls
onMessage() all the way up to the ultimate listener (adapter
or gateway).
Fix the Listener hierarchy; add tests for caching failover
connections and failing over cached connections.
Don't overrwrite the actual connection id if it has already
been set up by a lower level wrapper.
The SimplePool maintains an 'allocated' set, for the sole reason
of preventing a "foreign" (non-managed) object being returned.
When a pool item is detected as stale, it is removed from the pool
but remains in the 'allocated' set.
Add a test to verify the allocated size is reduced when a stale
item is popped from the pool.
Add a FileTransferringMessageHandler test (where the problem was
discovered).
Fix a test in TCP to expect a close().
Polishing
Do not allow returning null items to just release a permit - it
cannot remove the item from allocated. Clients must return the
stale item to the pool so it can be refreshed on the next get.
Only used by the TCP caching CF when returning a connection when
the factory is not running; but should not be allowed.
Also, protect against double release - not currently an issue with
existing users of SimplePool, but should be protected against. Could
cause the permit count to exceed the pool size.
Add inUse Set to the pool so we can detect attempts to release an
item that has already been released.
Previously, the `<delayer>` provided a `delay-header-name` attribute.
In complex cases there was need to precede it with `<header-enricher>`.
* Add support for an 'expression' attribute and sub-element
* Deprecate `delay-header-name`
* Make `DelayHandler.DelayedMessageWrapper` *public* to allow access for Messages in the Store
* Add tests
* Add 'What's new' section
* Polishing Delayer's doc regarding new abilities
JIRA: https://jira.springsource.org/browse/INT-2243, https://jira.springsource.org/browse/INT-3049
INT-2243: ban delay-header-name with expression
INT-2243 Polishing
INT-2243: fall-back to default on Eval Exception
INT-2243: DelayedMessageWrapper refactoring
* Make `DelayedMessageWrapper` Spring Data Mongo mapping compatible.
In terms of Spring Data - add Persistence Constructor
INT-2243 add 'ignore-expression-failures' support
* Add `ignore-expression-failures` to the `<delayer>`
* Add tests for `ignore-expression-failures`
* Add a note to the RM
* Describe SpEL side-effects for `DelayHandler`
Doc Polishing
Make 'lang' attribute optional on a script element and
attempt to derive the language from the file extension.
Change return value on ScriptParser.deriveLanguageFromExtension to the language name
Polishing (PR Comments)
Allow configuration of request handler advice chain using
- ServiceActivator
- Filter
- Splitter
- Transformer
annotations.
Also, with splitter, allow setting discardWithinAdvice (See
INT-2938).
INT-2994 Polishing: PR Comments
- Change adviceChain attribute to an array
- Use a boolean for the discardWithinAdvice attribute
INT-2994 Handler Advice Doc Polishing
Add a paragraph about Advice Order.
According to RFC 2616 HTTP clients should ignore invalid values
for date-aware header, but Spring MVC `HttpHeaders` raises
`IllegalArgumentException` in this case.
Proposal fix to Spring Integration just to `try...catch` call of
`HttpHeaders.getExpires()` and `return null`.
JIRA: https://jira.springsource.org/browse/INT-3063
* Add `requires-reply` attribute for all adapters outbound gateways as `true` by default
* WS-outbound-gateway is still without it, because it has its own specific attribute `ignore-empty-responses`
* Make `requires-reply` as `false` by default for `jdbc:stored-proc-outbound-gateway` inasmuch as `jdbc:stored-proc-outbound-adapter`
doesn't have ability to configure `returning-resultset`
* add parser tests for `requires-reply`
JIRA: https://jira.springsource.org/browse/INT-2822
INT-2822 'requires-reply' for ws:outbound-gateway
Default false.
INT-2822: Polishing after rebase
INT-2822: deprecate 'ignore-empty-responses'
* Add 'requires-reply' section into What's New
INT-2822: remove 'ignore-empty-responses' from RM
INT-2822: Polishing after rebase
INT-2822: Rebased and polished
INT-2822: Rebased and polished
Add WARN within deprecated `AbstractWebServiceOutboundGateway#setIgnoreEmptyResponses`
Revert 'ignore-empty-responses'; Doc Polishing
A TCP Connection is closed when an outbound gateway times out.
However, with the CachingClientConnectionFactory, the connection
was returned to the pool instead of being physically closed.
Override forceClose() and physically close the connection so the
next time it is retrieved from the pool it is detected as stale
and re-established.
Refactor test case and invoke it twice; once with a regular connection
factory and once with a cached factory.
Remove an unused logger.
Add new query so the same message found in pollMessageFromGroup is the
one which gets deleted.
See jira for more details: https://jira.springsource.org/browse/INT-3087
INT-3087 Polishing
Use an atomic method in pollMessageFromGroup to pop the first message.
Add test cases for pollMessageFromGroup and removeMessageFromGroup
where the same message exists in multiple groups.
Previously there was a need to add `result-type="StringResult"`
to <int-xml:xslt-transformer> for xslt output `method='text'`
in case payload was non-standard type (e.g. `File`), if we wanted to get
result as text.
* Add coercion to `StringResult` code, if `Transformer`'s property `method` is 'text' and there is no explicit `resultFactory` provided.
* Add documentation to reference manual
JIRA: https://jira.springsource.org/browse/INT-3067
TCP streams have no standard message structure. Therefore, the
TCP implementation previously only transferred the message
payload.
If someone wanted to convey header information, they would have
to write their own wrapper and/or use Java serialization for
the entire message.
This change provides a strategy to allow users to determine
which headers are transferred, and how.
A MessageConvertingMessageMapper is now provided that invokes
any MessageConverter. A MapMessageConverter is provided that
converts the payload, and selected heades to a Map with two
entries ("payload") and ("headers").
A MapJsonSerializer is provided that converts a Map to/from
JSON. Jackson can't delimit multiple objects in a stream
so another serializer is required to encode/decode structure.
A ByteArrayLfSerializer is used by default, inserting a
linefeed between JSON objects.
The combination of these elements now allows header
information to be transferred over TCP. Of course, users
can implment their own (de)serializer to format the
bits on the wire exactly as needed by their application.
INT-1807 Polishing
Add a test that uses a Map MessageConverter with a
Java (de)serializer.
INT-1807: Polishing
INT-1807: Rebased and polished
Change `MapJsonSerializer` to use `JsonObjectMapper` abstraction
Doc Polishing
Spring 3.2.3 registers MBean operations with parameter names
instead of the JVM default p1, p2 etc based on parameter position
in the method signature.
Since the OperationInvokingMessageHandler matched the supplied
arguments using the p1, p2 etc names, this prevented the control
bus from finding the target method.
Fall back to the old naming scheme based on parameter position
if a matching parameter is not found.
Add a test using a Map payload to supply the named arguments (p1, p2).
Add an ignored test that tests using named arguments (key, channelName).
Test with 3.1.4; remove Ignore and test with 3.2.3.
TODO: remove the Ignore annotation when SF 3.2.3 is the minimum.
The 'cache-sessions' attribute was deprecated in 2.1 in favor
of using a configured CachingConnectionFactory to provide more
flexibility, such as setting the cache size.
Remove the attribute from the schemas.
Update tests.
Add docs.
Update Migration Guide on the project Wiki.