JIRA: https://jira.spring.io/browse/INT-3857
Setter injection avoids early instantiation of FB properties.
Enhance aggregator parser tests to include several new properties to
check coverage in FB.
Clean up other tests.
Polishing - PR Comments
JIRA: https://jira.spring.io/browse/INT-3853
Previously the placeholder definitions for the Messaging Annotation weren't be resolved
if we use `<context:property-placeholder>` instead of `@PropertySource`.
Fix `MessagingAnnotationPostProcessor` and its "kindergarten" to use
`beanFactory.resolveEmbeddedValue()` instead of `environment.resolvePlaceholders()`.
JIRA: https://jira.spring.io/browse/INT-3852
Custom object names in `@IntegrationManagedResource` were ignored.
Some EIP objects were wrapped with their `Lifecycle` in order to expose
a single MBean with all attributes and operations.
This process "hid" the annotation so the object namer failed to detect the
presence of a custom object name or the other attributes.
Also, update the `@IntegrationManagedResource` to use the Spring 4.2 `@AliasFor` annotation.
INT-3852: Polishing
Polishing - Test with Proxy
JIRA: https://jira.spring.io/browse/INT-2541
The `IntegrationMBeanExporter` doesn't register any `@ManagedResource` automatically.
Its `autoDetection` is disabled by default.
Hence such a components like `AbstractMessageGroupStore`
or `WireTap` aren't exposed to the JMX by the `IntegrationMBeanExporter`.
From other side `MBeanExporterHelper` aims to help to avoid duplicate exposing if
an `MBeanExporter` is presented in the CTX.
But `MBeanExporterHelper` did that unconditionally just for the whole `org.springframework.integration` package.
Therefore components which aren't EIP ones aren't exposed to the JMX at all.
* Fix `MBeanExporterHelper` to deal for exclusion based on the `@IntegrationManagedResource` annotation.
* Remove `@IntegrationManagedResource` from those components which aren't EIP.
* Make some polishing in the JMX tests.
JIRA: https://jira.spring.io/browse/INT-3848
When the `ConsumerEndpointFactoryBean` is created programmatically
the `beanName` property may be missed and the `catch` for the `NPE`
just hides an issue with the `DEBUG` log message.
Add check for the `null` on the `bean` and log the issue on ERROR level.
**Cherry-pick to the 4.1.x, 4.0.x and 3.0.x**
JIRA: https://jira.spring.io/browse/INT-3829
Alongside with the `@Bean` definition we can use, for example, `@Profile` `@Conditional` annotation.
And the final bean won't be populated to the context.
When messaging annotations are present on `@Bean`s, a second bean for the endpoint consumer
is created.
Previously, the `MessagingAnnotationPostProcessor` did not check if the `@Bean` was present;
hence we ended up with a `NoSuchBeanDefinitionException`
* Add appropriate `try...catch(NoSuchBeanDefinitionException)` to the `AbstractMethodAnnotationPostProcessor` and
`InboundChannelAdapterAnnotationPostProcessor` to skip further endpoint processing if the bean does not exist.
Add DEBUG message for the skipped beans
Polishing
JIRA: https://jira.spring.io/browse/INT-3826
Application Context would not initialize with annotation without attributes.
Defaults were wrong; metrics factory bean name.
Make `IntegrationManagementConfigurer` more robust for the external options
JIRA: https://jira.spring.io/browse/INT-3820
Some Proxy may be based on the specif non-user classes and advised with
the provided end-user interfaces.
The best sample is `@Repository` from Spring Data projects.
In this case the `MessagingMethodInvokerHelper` just missed the user interfaces
to consider for the candidate methods or thrown an `Exception` like `NoSuchMethodError`.
* Add `((Advised) targetObject).getProxiedInterfaces()` for the scanning algorithm
* Move the `UniqueMethodFilter` to the internal `Set<Method>` to allow iteration
and filtering for methods from the `targetClass` as well as from all those user interfaces
* Add Spring JPA repository test-case
* Polishing form some time-weak tests
Revert MessagingMethodInvokerHelper
INT-3820: Simple Proxy Interface Method Matching
No-risk solution for INT-3820.
Instead of considering all interfaces on the proxy, only look at proxy interfaces
for a single matching method name if we find no candidate or fallback methods.
Consider the complete solution for 4.3.
Add `Message<?>` method distinguishing
JIRA: https://jira.spring.io/browse/INT-3821
The `MessagingException` provides an empty String for its `NestedRuntimeException`
for those ctors which are without `description` argument.
The `NestedRuntimeException` uses `NestedExceptionUtils.buildMessage` for `getMessage()` implementation
and the algorithm there is based on the `message != null` condition to build the first part of the nested
cascade. In the case of empty String we end up with useless ";" part in the StackTrace logs.
Fix Framework classes to use the `MessagingException` ctor with particular description.
JIRA: https://jira.spring.io/browse/INT-3803
Revert changes made by the last commit for the `INT-3802`
and mark Deprecated `Suppliers` usage with the `@SuppressWarnings("deprecation")`
JIRA: https://jira.spring.io/browse/INT-3802
For publisher confirms and returns, the `RabbitTemplate` now checks for a
`CachingConnectionFactory` which can't be mocked/stubbed.
Convert the mock tests for these features to real broker tests.
Also see AMQP-524.
Also, the lifecycle attributes were missing from the AMQP outbound endpoints.
Fix a couple typos in the AMQP xsd.
Fix deprecation since Reactor-2.0.5
Part 1 - eliminate references from support to other packages
Part 2 - handler to aggregator/router
- move BarrierMH to aggregator
- Fix ScatterGather references
Part 3 - move TrackableComponent
- to support.management
Part 4 - class tangles
- TcpConnectionServerExceptionEvent
- RecipientListRouterManagement
INT-3799: Polishing
JIRA: https://jira.spring.io/browse/INT-3736
INT-3736: Polishing
INT-3736: Use o-c-a For Release
Avoids unusual parser logic, allows release channel to be of any type.
INT-3736: Schema Polishing
INT-3736: Polishing
- Add TriggerMessageHandler interface
- Use SyncQueue - suspend the trigger thread if the main thread hasn't arrived yet
- allows clean up of state regardless of whether just a trigger or suspend is processed
- reply-required
INT-3736: Polishing and Docs
Polishing code style and fixing typos in docs
JIRA: https://jira.spring.io/browse/INT-2166
* Introduce `ThreadStatePropagationChannelInterceptor` based on the `ExecutorChannelInterceptor`
* Add `SecurityContextPropagationChannelInterceptor`,`SecurityContextCleanupChannelInterceptor`
* Introduce `AbstractExecutorChannel` to utilize `ExecutorChannelInterceptor` logic
* Introduce `MessageHandlingTaskDecorator` to avoid package tangle from `dispatcher` and `channel`
* Introduce `SecurityContextCleanupAdvice` for those cases when we don't get deal with `MessageChannel`s already, but want to have proper way to cleanup `SecurityContext`
* Make `GlobalChannelInterceptorProcessor` as `SmartInitializingSingleton` to avoid `phase` conflicts.
* Fix `MessagingAnnotationPostProcessor` to use `beanFactory.initializeBean(endpoint, endpointBeanName);` instead of manual `start()` invocation bypassing the `phase` logic, hence having a bug, when endpoints have been started very early
* Optimise `AbstractPollableChannel` to use `size` field from `ChannelInterceptorList` instead of `size()` from `Collection<?>`
* Fix `AnnotatedEndpointActivationTests` extracting separate component for annotation configuration instead of using test class directly. This caused very late Messaging Annotations process on that class
* Fix typo in the `spring-integration-jdbc-4.2.xsd`
* Remove some `SOUT`s throughout the project
TODO Docs
PR Comments:
* Remove redundant `AbstractExecutorChannel#executorInterceptors` and make logic based on the `super.interceptors`
* Fix wrong imports order
* JavaDocs for `ThreadStatePropagationChannelInterceptor`
* Docs for `SecurityContext` propagation
INT-3593: Fix FTP PartialSuccess Tests
JIRA: https://jira.spring.io/browse/INT-3593
Sort the files for the MPUT tests.
INT-2166: Add SecurityContext Propagation
JIRA: https://jira.spring.io/browse/INT-2166
* Introduce `ThreadStatePropagationChannelInterceptor` based on the `ExecutorChannelInterceptor`
* Add `SecurityContextPropagationChannelInterceptor`,`SecurityContextCleanupChannelInterceptor`
* Introduce `AbstractExecutorChannel` to utilize `ExecutorChannelInterceptor` logic
* Introduce `MessageHandlingTaskDecorator` to avoid package tangle from `dispatcher` and `channel`
* Introduce `SecurityContextCleanupAdvice` for those cases when we don't get deal with `MessageChannel`s already, but want to have proper way to cleanup `SecurityContext`
* Make `GlobalChannelInterceptorProcessor` as `SmartInitializingSingleton` to avoid `phase` conflicts.
* Fix `MessagingAnnotationPostProcessor` to use `beanFactory.initializeBean(endpoint, endpointBeanName);` instead of manual `start()` invocation bypassing the `phase` logic, hence having a bug, when endpoints have been started very early
* Optimise `AbstractPollableChannel` to use `size` field from `ChannelInterceptorList` instead of `size()` from `Collection<?>`
* Fix `AnnotatedEndpointActivationTests` extracting separate component for annotation configuration instead of using test class directly. This caused very late Messaging Annotations process on that class
* Fix typo in the `spring-integration-jdbc-4.2.xsd`
* Remove some `SOUT`s throughout the project
TODO Docs
PR Comments:
* Remove redundant `AbstractExecutorChannel#executorInterceptors` and make logic based on the `super.interceptors`
* Fix wrong imports order
* JavaDocs for `ThreadStatePropagationChannelInterceptor`
* Docs for `SecurityContext` propagation
Doc Polishing
Address PR comments
Address PR comments
* Extract `ExecutorChannelInterceptor` logic in the `PollingConsumer`
to have an ability to invoke `afterMessageHandled()` on the TaskScheduler's Thread
for example for the `SecurityContext` clean up
* Get rid of all that redundant "clean up" stuff
* Docs polishing
Fix `NPE` in the `PollingConsumer`
Introduce `ExecutorChannelInterceptorAware` to avoid iterators on each message
Polishing; Docs, Sonar
JIRA: https://jira.spring.io/browse/INT-3776
revert LoggingHandlerTests
Added byte[] serialize(Object obj)
Clean up java doc and some minor name changes
added null checks
Cleanup and rename methods to encode/decode
remove SerializationFaileException
clean up
Polishing
JIRA: https://jira.spring.io/browse/INT-3786
* Increase `receiveTimeout` for several `QueueChannel` and `CountDownLatch` based tests
* Fix `FileSplitterTests` for Windows compatibility - `UTF-8` for bytes conversion
* Make some STOMP tests as `LongRunning`
The next fixing phase
JIRA: https://jira.spring.io/browse/INT-3781
- Add mechanisms to set status code on an inbound gateway timeout.
- Send a message to the error channel if configured.
Polishing - Add failedMessage to MTE
Fix Schema Docs; Timeout Detection on Error Flow
Add Zookeeper Leadership Logs
Fix typo in the `SmartLifecycleRoleController`
JIRA: https://jira.spring.io/browse/INT-3683
* In addition fix `inputs` for the Gradle `generateSql` task and regenerate all SQLs
to apply the typo fix.
The previous way to generate sql scripts doesn't work properly. It is always as `UP-TO-DATE`.
Adding `inputs` to the `generateSql` show the correct behaviour.
From other side that makes `cleanSql` task as redundant.
* Applying the Travis config fix to this commit as well.
Fix HTTP test timeout
https://build.spring.io/browse/INT-B41-346
Fix `ProducerAndConsumerAutoStartupTests`
https://build.spring.io/browse/INT-B41-346
Fix `DelayerUsageTests` `time` bean scope bug
https://build.spring.io/browse/INT-B41-347
Fix `HttpInboundGatewayParserTests.java` generics Java < 8 compiler warnings
Increase Tomcat response timeout for WebSocket tests
https://build.spring.io/browse/INT-B41-349
Increase timeout in the `AsyncMessagingTemplateTests#executionException()`
Fix `ClassCastException` for the `StandardWebSocketClient#userProperties`
Increase Delay to 2 Seconds in DelayHandlerTests
JIRA: https://jira.spring.io/browse/INT-3766
Previously the `GatewayProxyFactoryBean` detected the presence of `Environment` before
looking for `Promise` return types. This caused initialization failures if
`reactor-core` was on the classpath, but not `reactor-stream`.
Change `reactorPresent` to look for the `Promise` class intead of `Environment`.
JIRA: https://jira.spring.io/browse/INT-3755
JIRA: https://jira.spring.io/browse/INT-3756
Previously JMX was required to enable capturing message counts and statistics.
This is now a separate operation from JMX and can be enabled independently.
For backwards compatibility, enabling JMX will automatically enable statistics
(unless separately configured).
INT-3755: Polishing; PR Comments
Doc Polishing
JavaDocs polishing
JIRA: https://jira.spring.io/browse/INT-3617
Start/stop `SmartLifecyle` beans with leader election/revocation.
ZK Namespace Support
Add Annotation Support
INT-3617: Polishing
Add `SmartLifecycle` to listener parser.
INT-3617: Polishing; PR Comments
Revert SmartLifecycleRoleController
Remove reflection.
Remove Dependence on spring-cloud-cluster
Temporarily move the relevant classes here.
Polishing; PR Comments and Fix Test
Test was incorrectly stopping the LeaderInitiator before it was elected.
Set auto-startup="false" in the i-c-a so we wait for its start before
stopping the LeaderInitiator.
Fix JavaDocs
JIRA: https://jira.spring.io/browse/INT-3759
Add `IntegrationManagementConfigurer` to globally set the default.
This will be documented/expanded when JIRAs 3755/3756 are implemented.
Polishing; PR Comments
Test Polishing
JIRA: https://jira.spring.io/browse/INT-3752
JIRA: https://jira.spring.io/browse/INT-3754
The statistics are based on this count so, for example the
`meanSendDuration` reflects the mean of total duration from the first send to
the last in each batch.
Also change the linked lists to `Deque`s.
Also remove `isTraceEnabled()` calls - too expensive in high volume environments.
Polishing
Assign the count to a local variable so the mod (%) operation is short
circuited rather than short circuiting the call to isFullStatsEnabled().
INT-3752: Fix Aggregating Metrics
Previously, the duration was for the first message in each sample.
We need to capture the total elapsed time for the sample and use it
for the duration calculation.
Add 'newCount' to the context so the after... method can calculate
the duration at the end of the sample.
The start field does not need to be volatile because its updates
are synchronized.
INT-3752: Fix Javadocs
JIRA: https://jira.spring.io/browse/INT-3583
Previously, the `ref` or inner bean for an aggregator was wrapped
in a `MethodInvokingMessageGroupProcessor` for POJO aggregation logic.
Now, if the ref'd bean is a `MessageGroupProcessor`, it is used as the
output processor directly.
Also, the `SimpleMessageGroupProcessor` is added which simply returns the
collection of messages.
INT-3583: Polishing; PR Comments
Fix AsciiDoc
Revert `CorrelationMessageBarrier` deprecation
Fix Docs for wrong chapter link
JIRA: https://jira.spring.io/browse/INT-3749
Since some target application could inject there is `EvaluationContext` before, removal of
`setIntegrationEvaluationContext()` is breaking change.
This fix reverts all those setters.
JIRA: https://jira.spring.io/browse/INT-3749
Since `IntegrationEvaluationContextAware` isn't so "context-free" resource like `BeanFactory`
and `ApplicationContext`, but just a specific bean in the context, we can't follow with `BeanPostProcessor` logic - bad architecture by level of responsibility.
Therefore we should follow with standard Dependency Injection mechanism to retrieve `evaluationContext` for the particular component.
Since we can't rely on the `@Autowired` because SI can be used from the raw XML configuration,
we use utility method instead. The pattern to get the proper `integrationEvaluationContext` is:
```
@Override
protected void onInit() throws Exception {
super.onInit();
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
}
```
JIRA: https://jira.spring.io/browse/INT-3616
Zookeeper implementation of `LockRegistry`, for example to support
clustered aggregators (when using external message group stores).
INT-3616: Polishing; PR Comments
JIRA: https://jira.spring.io/browse/INT-3642
Currently, `removeMessageFromGroup` rebuilds the group on every removal.
In every case where this method is used in the framework, the result is not used.
Add `removeMessagesFromGroup` that removes a collection of messages and returns no result.
INT-3642: Polishing - PR Comments
INT-3642: Polishing and Fix Group Metadata Size
JIRA: https://jira.spring.io/browse/INT-3748
- override `shouldCopyRequestHeaders` to return false;
- modify existing tests (not specific to `BridgeHandler`) that rely on the fact that `BridgeHandler` copies headers and creates a new message instance to use a custom test handler with the expected behaviour;
INT-3748 Polishing
- moved test RequestHeaderCopyingMessageHandler
- updated author tags and copyrights
JIRA: https://jira.spring.io/browse/INT-3724
Add support for `CompletableFuture<?>` return types on gateway methods, if JDK8 is being used.
- If the return type is exactly `CompletableFuture` and an async executor is provided, use `CompletableFuture.supplyAsync()`
- If there is no return async executor, return types can be `CompletableFuture` or a subclass and the flow can return such a future.
- Also fixes a problem for return type `Future<Message<?>>` with no async executor; previously this caused a `ClassCastException`
because the gateway returned the message - it assumed such return types would always run on an excutor.
We can consider back-porting this last part, but nobody has complained.
CompletableFuture Docs
Fix typos, polishing for JavaDocs and some code style polishing
JIRA: https://jira.spring.io/browse/INT-3740
For `File` and `String` payloads add `FileHeaders.ORIGINAL_FILE` and `FileHeaders.FILENAME` headers.
Reworked to create headers once only.
Fix typos and Java > 6 API usage
JIRA: https://jira.spring.io/browse/INT-3691
- create new core interfaces `ListenableMetadataStore` and `MessageStoreListener`;
- create new module `spring-integration-zookeeper`;
- add `ZookeeperMetadataStore` implementation
Polishing
Polishing
- moved classes into core/test where necessary, including conversion methods
- properly renamed `MetadataStoreListenerAdapter`
JIRA: https://jira.spring.io/browse/INT-3727
Add a configuration option such that the `FileSplitter` can emit
Start/End messages when splitting.
Polishing according PR comments
Add toString to FileMarker
JIRA: https://jira.spring.io/browse/INT-3685
* Add `StompInboundChannelAdapter` to subscribe to STOMP destination and receive messages from them.
Destinations can be added/removed (hence subscribed/unsubscribed) at runtime.
* Add `stompMessageHandler` to the send messages to STOMP destinations.
* `destination` can be extracted from `MessageHeaders`, the `destination` and `destinationExpression` are also supported.
* `RECEIPT` Frame is also supported and emitted as `StompReceiptEvent`
* `StompExceptionEvent` is emitted when we have a `failure` for `CONNECT` Frame or as a reaction to the `ERROR` Frame.
* Introduce `StompSessionManager` abstraction to manage the single `StompSession` and allow to share it between different adapters.
* Add `WebSocketStompSessionManager` implementation over `WebSocketStompClient`
* Add `Reactor2TcpStompSessionManager` implementation for target Broker connections
* Add `StompHeaderMapper`
Address PR comments and JavaDocs
Polishing according PR comments
Polishing
JIRA: https://jira.spring.io/browse/INT-3719
YourKit profiling for a lightweight XD stream indicates a large
amount of time in `AMC.send()`.
- Only call `logger.isDebugEnabled()` once
- Eliminate the need to create an `UnmodifiableList` and calling `size()` to get the size of the interceptor list.
Polishing
INT-3719: Fix (PR Comment)