JIRA: https://jira.spring.io/browse/INT-3704
Some NoSQLs (e.g. Hazelcast) provide a distributed implementations for the `ConcurrentMap`,
so add `SimpleMetadataStore(ConcurrentMap<String, String> metadata)` to allow ot inject any `ConcurrentMap` implementation.
Demonstrate the support for Hazelcast in the `IdempotentReceiverIntegrationTests`
**Cherry-pick to 4.1.x**
JIRA: https://jira.spring.io/browse/INT-3672
Previously the `IdempotentReceiverInterceptor` has been applied only for the `MessageHandler`s which were registered with `.handler` suffix.
Rework `IdempotentReceiverAutoProxyCreatorInitializer` and `IdempotentReceiverAutoProxyCreator` to get deal with **direct** `MessageHandler`s
which can be resulted from `@Bean` methods.
Use the `MessageHandler` real bean name instead of `endpoint pattern` in that case
**Cherry-pick to 4.1.x**
JIRA: https://jira.spring.io/browse/INT-3664
Since all metrics are already direct for the integration components, we don't do any proxying from `IntegrationMBeanExporter`,
and even any other adjustments during BPP phases. Hence this stuff is already redundant for `IntegrationMBeanExporter`.
In addition this change fix the `early access to the BeanFactory from BPP` issue.
INT-3664: Address PR comments
Doc Polish
INT-3664: Polishing according the SF changes to the `PostProcessorRegistrationDelegate$BeanPostProcessorChecker`
JIRA: https://jira.spring.io/browse/INT-3651
- Add documentation for the new JMX environment
- Add the ability to customize the default metrics implementations
- Fix LifecycleMessageHandlerMetrics to get a custom `MessageHandlerMetrics`
- Add an escape to the bean pattern matcher to handle beans starting with `!`
INT-3651: More Docs/Polishing
* JavaDocs polishing
* Change `jmx.xml` to describe `public void stopActiveComponents(long howLong)` not that removed with `boolean force`
JIRA: https://jira.spring.io/browse/INT-3641
Instead of maintaining a moving average on each event, store the events
for offline analysis.
Retain 5*window samples - this means that the earlies retained sample
contributes just 0.5% to the sum. E.g. with a window of 10, the earliest
sample is 0.9**50 (0.005).
Also, defer the conversion from nanoseconds to milliseconds to the
retrieval side.
Experimentation shows this increases perfomance by approximately 2x.
Sending 1B messages to nullChannel.
With Proxy: 1.2M/sec
Afer proxy removed: 2.4M/sec
With this change: 5.3M/sec
INT-3641: Polishing - PR Comments
JavaDocs polishing
JIRA: https://jira.spring.io/browse/INT-3653
Also switch to using `System.nanoTime()` for deltas.
INT-3653: Polishing; PR Comments
INT-3653: Polishing
* Fix `NullChannel` for the generic type
* Add `Assert.notNull` for metrics setters and for the result of `MetricsFactory`
* Fix compile and JavaDocs warnings
JIRA: https://jira.spring.io/browse/INT-3637
- Message Sources
- Message Handlers
Polishing; Final Review and PR Comments
- avoid second call to System.currentTimeMillis()
- fix elapsed time in handler metrics
- expose TrackableComponent when available
INT-3637: Add @IntergrationManagedResource
Prevents beans (channels, etc), which were previously picked
up via a proxy, from being exported by a standard context
MBeanExporter.
I looked at completely eliminating the MBeanExporterHelper,
which suppresses o.s.integration beans from being exported by
a standard MBeanExporter when there is an IMBE present, but I feel
this is too much of a breaking change. There are a number of
standard beans (such as WireTap) that are @ManagedResources and
these would disappear for users that don't have an IMBE.
That said, such beans previously disappear completely when there
*is* an IMBE so now they are now annotated with both so that
they are exported by at most one of the exporters.
Polishing; Use MBE.addExludedBean instead of DFA
INT-3639: JMX (AMQP/JMS) Channel Stats
JIRA: https://jira.spring.io/browse/INT-3639
Module channels inherit `ChannelSendMetrics`; add
`PollableChannelManagement` for polled channels.
INT-3638: JMX Initial Stats/Counts Settings
JIRA: https://jira.spring.io/browse/INT-3638
Add the ability to specify the initial settings for
'enableStats' and 'enableCounts' for MBeans that
support those statistics.
Polishing; PR Comments; Add Handler Metrics Test
Also found a problem using an inner MessageSource bean in an
inbound-channel-adapter - a BeanComponentDefinition was returned
instead of a BeanDefinition.
Add @DirtiesContext to JMX Tests
The new MonitorTests failed with InstanceAlreadyExistsException for the
errorChannel.
Add @DirtiesContext to all tests using the Spring test runner to avoid caching any
contexts after the test class completes.
INT-3637: JMX Support Negated Name Match Patterns
Note: with negated matches, order matters.
Polishing for `MonitorTests`
Fix `EnableIntegrationMBeanExport` JavaDocs
JIRA: https://jira.spring.io/browse/INT-3636
- Add `enableStats()` managed operation
- Delegate to a channel metrics object instead of using a proxy
INT-3636: Polishing; PR Comments
Change field name in `MBeanExporterHelper`.
INT-3636: Polishing
JIRA: https://jira.spring.io/browse/INT-3565
Cast to `IntegrationObjectSupport` fails if the handler is
already proxied in `AbstractSimpleMessageHandlerFactoryBean`.
INT-3565 Polishing
- Fix test.
- enhance test to show that directly bound message handler beans are not advised if already proxied.
JIRA: https://jira.spring.io/browse/INT-3551
* Rename `MetadataKeyStrategy` -> `MetadataEntryStrategy`
* Add `valueStrategy` to the `MetadataStoreSelector`
* Add `value-strategy` and `value-expression` to the `<idempotent-receiver>`
INT-3551: Add `@IR` support on service methods
Rework `MetadataKeyStrategy` just to the `MessageProcessor`
Fix Docs
Minor Doc Polishing.
JIRA: https://jira.spring.io/browse/INT-2426
INT-2426: pushed `final` modifier fix for Java 6 compatibility
INT-2426: Rework logic to the `MetadataStore`
INT-2426: `IdempotentReceiver` -> `IdempotentReceiverInterceptor`
* Move `Idempotent Filtering` logic to the `IdempotentReceiverInterceptor`, which should be applied as a regular
AOP `Advice` to the `MessageHandler#handleMessage`
* Provide an xml component `<idempotent-receiver>`
* Introduce `IdempotentReceiverAutoProxyCreator` to get deal with `IdempotentReceiverInterceptor` and `MessageHandler`s.
The `Proxying` logic is based on the mapping between interceptor and `consumer endpoint` `ids`
* Introduce `MetadataStoreSelector` along side with `MetadataKeyStrategy` and `ExpressionMetadataKeyStrategy` implementation
INT-2426: Introduce `IdempotentReceiver` annotation
Add `IdempotentReceiverIntegrationTests` in the JMX module to be sure that all proxying works well.
INT-2426: Polishing according PR comments
* Rename `IdempotentReceiverAutoProxyCreatorInitializer`
* Add support for several `IRI` for the one `MH`
* Polishing JavaDocs
INT-2426: Add `What's New` note
Doc Polishing.
More Doc Polishing
Use Timestamp (hex) instead of Id for Value
Facilitate cleanup.
JIRA: https://jira.spring.io/browse/INT-275
In addition fix the `Lifecycle` issue in the `ServiceActivatorAnnotationPostProcessor`
Add Namespace support, Addition tests
and fix some typos in the XSD
INT-275: Fix failed tests
INT-275: Fix for `replyChannel` Header
Add `sync` reply test-case
INT-275: Make `ScatterGatherHandler` sync
Fix some `MessageHandler`s from `SmartLifecycle`
INT-275: Fix `ScatterGatherHandler.handleRequestMessage` logic
INT-275: Fix `ScatterGatherHandler` JMX proxying issues
* Make `AbstractCorrelatingMessageHandler.getMessageStore()` as `public`
* Move `ScatterGatherHandlerIntegrationTests` to the JMX module to be sure that `ScatterGatherHandler`
works well with `@EnableIntegrationMBeanExport`
* Add xml config sample how to use an internal gatherer's `MessageStore` in the `MessageGroupStoreReaper`
* Add `What's New` notice
JIRA: https://jira.spring.io/browse/INT-3455
Do not stop schedulers and executors - allows mid-flow
QueueChannels to be drained.
Stop all inbound MessageProducers (that are not OrderlyShutdownCapable).
INT-3455 Polishing; PR Comments
Change deprecate method usage to the new version
JIRA: https://jira.spring.io/browse/INT-3458
* Change Spring AMQP to `1.3.5.RELEASE`
* `HttpRequestHandlingEndpointSupport`: remove `MappingJacksonHttpMessageConverter` registration
* `IntegrationRequestMappingHandlerMapping`: add 'fake' `name()` attribute to the inline `RequestMapping` annotation
* `StoredProcJmxManagedBeanTests`: remove `context.stop();` code, Since `MBeanExporter` deregister MBeans on `stop()` now
* `StoredProcPollingChannelAdapterParserTests`: change deprecated `ParameterizedSingleColumnRowMapper` to the `SingleColumnRowMapper`
* `Jms`: comment out the reflection code to check the value for the `recoveryInterval`, because it is removed already in favor of `backOff`
* `NotificationListeningMessageProducer`: move the start-up listener registration to the `onApplicationEvent`,
because `MBeanExporter` moved `registerBeans()` to the `start()` now.
The same `phase` might cause the issue, that MBeans aren't registered yet for `NotificationListeningMessageProducer`
* `JpaOutboundGatewayTests`: change `@TransactionConfiguration` to the `@Transactional`. Don't know why the first doesn't work now.
**Cherry-pick to 4.0.x**
INT-3458: Addressing PR comments
`NotificationListeningMessageProducer`: defer listener registration until `onApplicationEvent()`
JIRA: https://jira.spring.io/browse/INT-2352
Add `replaceChannelMappings()` to the `AMMR`.
INT-2352 Polishing - PR Comments
Consolidate tests.
Fix up `@ManagedAttribute` Vs `@ManagedOperation`
Expose `setChannelMappings` over JMX
JIRA: https://jira.spring.io/browse/INT-3349
Several FactoryBeans did not propagate the BeanFactory
to their created object(s). Beans that create messages
must have access to a bean factory to get the
message builder factory.
Fix the FactoryBeans and add a mock FB to all tests that
need one.
Add a runtime environment variable to make any infractions
fatal. This should be set to `true` on CI builds and on
framework developer environments.
JIRA: https://jira.springsource.org/browse/INT-3308
INT-3308 Move Optimization to AbstractDispatcher
- avoids the need for `canShortCutDispatcher()`
- optimizes all framework channels, including AMQP, JMS
- slight additional performance improvement
INT-3308 FinalSingleHandlerChannel
This is still a work in process.
TODO:Parser, parser tests.
See the DirectChannelTests for perforance results.
INT-3308 'Final' Channel Parser Changes, Tests
INT-3308 Polishing; PR Comments
INT-3308 Polishing
* Rename 'final' attribute to 'fixed-subscriber'
* Rename `BasicSingleFixedSubscriberChannel` to `FixedSubscriberChannel`
INT-3308 Polishing
* Rename test cases to match channel
* Fix parser error messages
* Add more exclusive attribute/element tests
INT-3308 More Polishing
* Remove remaining textual references to 'final'
* WARN log if the single subscriber has auto-startup="false"
* Handle the case when a fixed subscriber channel is declared after its handler
* Support the use of a fixed subscriber channel for elements created by an AbstractOutboundChannelAdapterParser
JIRA: https://jira.springsource.org/browse/INT-3286
Introduce `@EnableMessageHistory` and `MessageHistoryRegistrar`.
Refactoring for `MessageHistoryParser` to use `MessageHistoryRegistrar` to follow with DRY
Add test for `@EnableMessageHistory`
INT-3286: Polishing
INT-3286: Enable several MHs with the same value
Previously the Framework allowed only one `<message-history>`
independent of their `tracked-components`.
With introduction of `@EnableMessageHistory` and `MessageHistoryRegistrar`
the `MessageHistoryConfigurer` is improved to allow
several `<message-history>` or `@EnableMessageHistory`
with the same set of `componentNamePatterns`.
INT-3286 Polishing + JMX + Docs
* Allows setComponentNamePatterns and/or setComponentNamePatternsSet to
be used as long as the settings are consistent.
* Handle the case where the `MHC` was configured as a bean (no managed set exists)
* Add support for changing the component name patterns over JMX + test case
* Docs
INT-3286 More Polishing
* Change bean name to `messageHistoryConfigurer`
* Move constant to `ICU`
* Export the MBean by the `IMBE`
Since 3.2.3, the operation invoking message handler can take a
map containing arguments named for their equivalent parameters.
This test was commented out because the 3.x stream supports
older versions of Spring.
JIRA: https://jira.springsource.org/browse/INT-3187
Previously, `MetadataStore` couldn't be configured for Twitter Adapters
- only a global one could be used.
The `metadataKey` was generated automatically with a 'difficult' value.
* Register all `MessageSource` for `SourcePollingChannelAdapter`
as beans with id based on adapter id and prefix '.source' (INT-3147)
* Polishing parser to get rid of explicit `MessageSource` beans. (INT-3147)
* Make Feed and Twitter adapters `id` attribute as required -
now it presents a `metadataKey` for `MetadataStore` (INT-3147)
* Add to Twitter adapters a reference attribute for `MetadataStore` (INT-3173)
* Add Twitter adapters `poll-skip-period` attribute (INT-3167)
* Add and implement `MetadataStore#remove` (INT-1941)
* Make `MetadataStore` as `@ManagedResource` (INT-1941)
* Polishing tests
JIRAs:
https://jira.springsource.org/browse/INT-3147https://jira.springsource.org/browse/INT-3167https://jira.springsource.org/browse/INT-3173https://jira.springsource.org/browse/INT-1941
INT-3147: Polishing and fixes
* add domain suffix to `metadataKey`
* change contract of `MetadataStore.remove`
* remove timeout window from `AbstractTwitterMessageSource`
* polishing and fix `SearchReceivingMessageSourceWithRedisTests`
INT-3147: Rebasing and polishing
INT-3147: fix 'metadata' package tangle
INT-3147 Doc Polishing
Allow customization of the generated ObjectName for the
Integration components.
JIRA: https://jira.springsource.org/browse/INT-2628
INT-2628 Polishing
- Address PR comments
- Rename `naming-strategy` to `object-naming-strategy` for consistency with `object-name-static-properties`
When declaring an IntegrationMBeanExporter, use an 'id' attribute
if you wish to obtain programmatic access to it (using injection
or referencing the BeanFactory.
JIRA: https://jira.springsource.org/browse/INT-3183
Also turn off debug logging for JMX test cases.
Previously, these tests examined specific stack frames to
verify the handler was directly invoked by the Dispatcher.
JIRA: https://jira.springsource.org/browse/INT-3188
Add a utility method to scan the stack trace instead to
verify that the Dispatcher frame exists before any
MessagingMethodInvokerHelper frame.
Previously, methods with primitive parameters were not matched
with primitive wrapper objects.
Check, if the argument is a primitive wrapper, that the paramer type
can be the equivalent primitive.
Add test case.
INT-3182 Polishing - PR Comments
Extract PrimitiveWrapper->Primitive map to ClassUtils.
JIRA: https://jira.springsource.org/browse/INT-3182
When a simple MessageHandler is referenced from a
`<service-activator/>`, it is wrapped in an anonymous
AbstractReplyProducingMessageHandler to facilitate proper handling of
the `<request-handler-advice-chain/>` and so that normal
'produced no reply` messages are logged.
Previously, this caused 2 MBeans to be exposed, one for tha actual
handler; one for the wrapper.
This added more stack frames between the dispatcher and the
handler (because 2 sets of statistics were captured).
The root cause was that the MBean exporter was not aware of the
relationship between these objects.
https://jira.springsource.org/browse/INT-3186
Add code to the IntegrationMBeanExporter to suppress adding
metrics to the wrapper.
This involves detecting that it is a wrapper and not exposing
it as an MBean and, when matching handlers with endpoints,
checking that the wrapped handler is the actual handler for the endpoint.
Update test to reflect the reduced number of stack frames between
the dispatcher and handler.
Also add tests to verify the detection of multiple references to
the same ARPMH.
INT-3186: `IntegrationMBeanExporter` optimization
When determining candidates for direct invocation, we need
to use the target of any existing proxy (such as JMX Metrics).
Copy ServiceActivatorDefaultFrameworkMethodTests to the JMX project
and adjust to work with JMX Proxies.
INT-3185: fix for AbstractSMHFBean#checkReuse
JIRA: https://jira.springsource.org/browse/INT-3185
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.
Add a `@Rule` to skip long-runing tests during normal builds.
Add the rule to long-running tests in gemfire, ip, jms, jmx.
Add an environment variable `RUN_LONG_INTEGRATION_TESTS`; when set
to true, all tests are run.
Set the environment variable to true on all nightly builds.
Build now runs in 13 minutes on my 3 year old laptop.
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
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.
* 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
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.