JIRA: https://jira.springsource.org/browse/INT-3284
* Introduce `IntegrationConfigurationBeanFactoryPostProcessor`, `IntegrationConfigurationInitializer`
* Apply `IntegrationConfigurationInitializer` and 'spring.factories' for HTTP and Security modules
INT-3284: Address PR's comments
JIRA: https://jira.springsource.org/browse/INT-3287
* Fix package tangle (INT-3287)
* Apply `IntegrationConfigurationInitializer` for `MBeanExporterHelper`
* Previously, there was a separate `ChannelSecurityInterceptorBeanPostProcessor`
for each `ChannelSecurityInterceptor` whereas now, there is one `ChannelSecurityInterceptorBeanPostProcessor`
that processes all interceptors
INT-3284 Refactoring around config package tangle
JIRA: https://jira.springsource.org/browse/INT-3254
Attribute was missing from the namespace causing issues
with long-running consumers with async handoff.
Also fix typo in http, ampq and core schemas.
JIRA: https://jira.springsource.org/browse/INT-3052
Add support of `ParameterizedTypeReference` as a result of
`expectedResponseTypeExpression` evaluation for
`RestTemplate.exchange` with `ParameterizedTypeReference` parameter
Now `expectedResponseTypeExpression` can be evaluated to `Class<?>`,
`String` and `ParameterizedTypeReference<?>`
JIRA: https://jira.springsource.org/browse/INT-3184
* Change `IntegrationRequestMappingHandlerMapping` to postpone
Handlers detection as late as possible using `ApplicationListener<ContextRefreshedEvent>`.
This is needed, because `RequestMappingInfoHandlerMapping#afterPropertiesSet()`
iterates over beans from `BeanFactory` to detect MVC Handlers. But at the same time
Integration Endpoints require `requestChannel` as dependency and those may be postponed
for `auto-creation` by `ChannelInitializer` - late-binding issue.
JIRA: https://jira.springsource.org/browse/INT-3184
* Change `IntegrationRequestMappingHandlerMapping` to postpone
Handlers detection as late as possible using `ApplicationListener<ContextRefreshedEvent>`
JIRA: https://jira.springsource.org/browse/INT-3160
Prior to SPR 4.0 `RequestMappingHandlerMapping#createRequestMappingInfo` was `private`.
So, there was reason to to use reflection in the `IntegrationRequestMappingHandlerMapping`
JIRA: https://jira.springsource.org/browse/INT-3055
* Add to HTTP Outbound Endpoint `uri-variables-expression`
* Add mutually exclusive check for `uri-variables-expression` with `<uri-variable>`
* Tests and Docs
INT-3055: Fixes
* `ExpressionEvalMap` now can apply `Map<String, Object>`,
but the value must have a `String` or `Expression` type.
Polishing
INT-3055 Doc Polishing
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.
Wrap `FileInputStream` and `FileOutputStreams` with
`BufferedInputStream`, `BufferedOutputStream` respectively.
Also use `BufferedReader`, `BufferedWriter` to wrap `FileReader`, `FileWriter`.
JIRA: https://jira.springsource.org/browse/INT-2953
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.
This commit updates Spring Integration to depend upon Spring 4, making
use of the message types that have moved from Spring Integration into
Spring's new spring-messaging module.
The default message converter no longer supports conversion of a
message that is null, throwing an IllegalArgumentException if an
attempt is made to convert null. Furthermore, GenericMessagingTemplate
does not support sending null, again throwing an
IllegalArgumentException. Previously, MessagingTemplate had no-oped an
attempt to send null.
ConcurrentAggregatorTests and AggregatorTests both had a single test
that was specifically testing the behaviour of an aggregator that
returns null for its message. These tests have been removed.
CorrelatingMessageHandlerTests have been updated to specify some
additional behaviour for its mocks so that null messages are not
returned.
These are the only functional changes that have been made. All other
changes are simply for moving to the repackaged and/or renamed types.
In the move to being part of core Spring, a number of constants and
header accessor methods have moved from MessageHeaders to
MessageHeaderAccessor. This commit continues this pattern for
the enterprise integration headers that are specific to Spring
Integration. A new class, EiMessageHeaderAccessor, has been created.
This class provides constants and methods for working with SI-specific
headers. The main code and tests have been updated to use this new
class.
From SPR 3.2.x the 'the path mapping' is **required** for `Controller`,
But with SI it is OK, because we can configure HTTP Inbound Endpoint via `HttpRequestHandlerServlet`.
So, add check if `requestMapping.getPathPatterns()` has values and don't register HTTP Inbound Endpoint
as `HandlerMethod` and just rely on user choice.
JIRA: https://jira.springsource.org/browse/INT-2312
INT-2312b: Polishing
The general idea is to use Spring-MVC as much as possible.
* Introduce `RequestMapping`, `IntegrationRequestMappingHandlerMapping`
* Introduce XSD nested element `<request-mapping>` for HTTP Inbound Endpoints
* Introduce `inboundCommonAttributes` XSD attributeGroup for HTTP Inbound Endpoints
* Introduce `IntegrationNamespaceUtils#createExpressionDefIfAttributeDefined` & `IntegrationNamespaceUtils#createDirectChannel`
* Remove deprecated `name` attribute
* Remove `UriPathHandlerMapping` as superseded by `IntegrationRequestMappingHandlerMapping`
* Add documentation for `<request-mapping>`
- Add description to Reference Manual about `<request-mapping>`
* Add documentation to section 'What's new'
* Add additional test for `<request-mapping>`
JIRA: https://jira.springsource.org/browse/INT-2312, https://jira.springsource.org/browse/INT-2619
Additional changes:
* INT-2528 Remove deprecations in HTTP module
- JIRA: https://jira.springsource.org/browse/INT-2528
* Add Jackson 2 support for HTTP-inbound
* Using Jackson 2 HttpMessageConverter if Jackson 2 is available in classpath
* Make `RequestMapping` public
* Introduce `HttpContextUtils` and move `HANDLER_MAPPING_BEAN_NAME` to it
* Revert and deprecate public API
* Improve JavaDocs
* Improve Reference Manual
Thanks also to Biju Kunjummen for his incorporated commit.
INT-3142: A flag to retain default converters when the user has customized messageconverters for HttpRequestHandlingController, HttpInboundGateway
* Introduced a new flag in the base class of HttpRequHttpRequestHandlingController, HttpInboundGateway - registerDefaultConverters
* Introduced a new attribute "register-default-converters" for inbound-channel-adapter and inbound-gateway to indicate if the default HttpMessageConverter's need to be registered
* Http namespace parser related changes to set the new flag
* Added additional tests to test the flag and the namespace parser related changes
Changes per feedback from Artem - additional javadoc comments, cleaned up tests
Updated: Setting the register-default-converters by default to false now, for backward compatibility reasons
Changed adapter name per feedback from Artem
Changed adapter name per feedback from Artem
Changed attribute name from register-default-converters to merge-with-default-converters
INT-3142: Atomic operation for messageConverters
'What's New' polishing
Polishing
Fix a few comments, error messages, docs, whitespace.
* Add XSD attributeGroup `smartLifeCycleAttributeGroup`
* Use it for all adapters tags
* Refactoring `AbstractChannelAdapterParser` hierarchy
* Refactoring some `MessageHandler`'s that should not have `autoStartup` & `phase`.
It is the responsibility of `AbstrctEndpoint`
* Polishing some tests according new logic
JIRA: https://jira.springsource.org/browse/INT-2998
INT-2998: Polishing
Polishing
- Reformat schemas where indentation changed
- Add SLC to the UDP inbound adapter
`StringHttpMessageConverter` adds `Accept-Charset` header by default.
By RFC 2616 `Accept-Charset` is a Request header,
so it won't be presented in the response.
Turn off `writeAcceptCharset` in the `HttpRequestHandlingEndpointSupport`.
JIRA: https://jira.springsource.org/browse/INT-3120
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
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)
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
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
The `<http:outbound-channel-adapter>` and `<http:outbound-gateway>` now provide
an `encode-uri` option that controls whether the request uri is encoded
(default `true`).
It can be useful in some scenarios with a non standard URL, e.g. RabbitMQ REST API:
'http://foo.RabbitMQ.com/api/queues/%2f/bar.queue' where we must not
encode the '%'.
https://jira.springsource.org/browse/INT-2455
INT-2455: Polishing based on PR comments
INT-2455: 'encode-uri' in the Reference Manual
INT-2964 - JavaDoc: <emphasis> should be <em>
INT-2964 - JavaDoc: <p/> should be <p>
INT-2964 - JavaDoc polishing
* <li></li> should be wrapped in <ul></ul>
* wrap code snippets in {@code myCode()}
* change <code>false</false> to <code>false</code>
INT-2964 - Polish - Fix more JavaDoc errors
* Mockito-all dependency causes JavaDoc error. Change dependency to Mockito-Core.
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.
In Spring 3.1, DefaultResponseErrorHandler.getResponseBody() is
tolerant of a null InputStream on the response. With Spring 3.0
a null response causes an assertion exception.
The mock in the tests was not set up to return an InputStream
and so the test failed when building with Spring 3.0.
Configure the mock to return an empty InputStream.
Also added a text response to response.getStatusText().
Tested with Spring 3.0 and 3.1.
When the expected-response-type was Serializable,
no Accept: header was added.
The SerializingHttpMessageConverter overrides
canRead() from the superclass.
The superclass method allows null in the mediaType
parameter to return true. RestTemplate.AcceptHeaderRequestCallback
calls canRead() with null in the mediaType, preventing
the Accept header from being completed.
Remove the overridden method.
INT-2837 Disable Java Serialization over Http
Previously, Java serialization was enabled by default by
adding the SerializingHttpMessageConverter to the converter
lists (inbound and outbound endpoints). However, there was
a problem in that the Accept header was not set properly on
outbound requests.
Correcting the header could cause other side effects, such as
existing JSON applications using Java serialization instead.
It was felt that it would be safest to disable Java serialization
by default, while retaining the ability to use Java serialization
by explicitly configuring the message converter.
Update tests to deal with the fact the converter is not
configured by default.
INT-2837 Fix Schema Version in Test
Inadvertently added a spring 3.1 schema version.