Commit Graph

150 Commits

Author SHA1 Message Date
Artem Bilan
b2e83a8792 Fix Generics usage in IdempotentReceiverIntTests 2015-04-20 14:04:37 +03:00
Artem Bilan
f410c4a21d INT-3704 Add Map ctor for SimpleMetadataStore
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**
2015-04-20 11:25:17 +01:00
Artem Bilan
f686c21b00 INT-3672: Fix IdempotentReceiver for MH @Beans
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**
2015-03-20 17:47:46 -04:00
Artem Bilan
0f05512e9a INT-3664: Rework BPP in the IntMBExporter
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`
2015-03-09 18:01:37 -04:00
Artem Bilan
7780c94433 Fix race condition in the MonitorTests
See: https://build.spring.io/browse/INT-B41-236
2015-03-03 09:52:40 +02:00
Gary Russell
134c7c870b INT-3651: JMX Improvements Documentation
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`
2015-03-02 14:44:31 +02:00
Gary Russell
3a114ec83a INT-3641: JMX: Lazy Stats
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
2015-02-25 14:28:12 +02:00
Gary Russell
a4a6b7094b INT-3653: JMX: Add Pluggable Metrics Factory
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
2015-02-20 20:21:11 +02:00
Gary Russell
09c203dc6d INT-3637: JMX Improvements Msg Sources/Handlers
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
2015-02-19 21:51:45 +02:00
Gary Russell
b07686cdc0 INT-3636: JMX Eliminate Channel Metric Proxies
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
2015-02-17 13:55:33 +02:00
Gary Russell
e974f55eae Remove IgnoredTestSuite in JMX
https://build.spring.io/browse/INT-B41-204/test/#ignored-tests

Inflates the 'ignored tests' count in Bamboo.
2015-02-12 11:56:23 -05:00
Artem Bilan
bc509da062 INT-3631: Fix package tangle for ScatterGatherH
JIRA: https://jira.spring.io/browse/INT-3631

In addition add logging and SOUT hooks for `EnableIntegrationTests` to have more info for investigation of failures on CI like
https://build.spring.io/browse/INT-MJATS41-JOB1-233
2015-02-11 09:51:20 -05:00
Gary Russell
224eef3149 INT-3565 ClassCastException with Proxy and DEBUG
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.
2014-11-20 20:27:02 +02:00
Artem Bilan
0cc9273a2e INT-3551: Idempotent Receiver: Add value-strategy
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.
2014-11-10 14:01:10 -05:00
Artem Bilan
ff2b15ea9e INT-2426: Add Idempotent Receiver EIP
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.
2014-10-24 15:53:05 -04:00
Artem Bilan
869a8de05f INT-275: Implement Scatter-Gather Pattern
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
2014-10-21 15:14:34 -04:00
Artem Bilan
59c7c0edc1 INT-3496: JMX Metrics: Int->Long for All count
JIRA: https://jira.spring.io/browse/INT-3496

**Cherry-pick to 4.0.x & 3.0.x**

INT-3496: revert `int` methods and introduce `long` methods for `count` metrics
2014-08-18 13:30:13 -04:00
Gary Russell
6b8bdc7e5e INT-3455 Orderly Shutdown Improvements
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
2014-08-05 22:18:24 +03:00
Artem Bilan
c92d7a5da9 INT-3458: Compatibility with Spring Framework 4.1
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()`
2014-07-01 09:37:29 -04:00
Gary Russell
66fe1c74be INT-2352 Support Control-Bus Atomic Router Updates
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
2014-04-15 18:56:23 +03:00
Gary Russell
9dee131e3c INT-3349 BeanFactory Propagation
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.
2014-04-02 14:15:48 -04:00
Artem Bilan
97c270c0e2 INT-3330 EnableIntegrationMBeanExport Annotation
JIRA: https://jira.spring.io/browse/INT-3330

INT-3330: Enable SpEL evaluation

INT-3330: Polishing for `MBeanExporterHelper`

INT-3330: Fix `errorChannel` early access

INT-3330: Polishing according PR comments

Polishing - copyrights, author, docs
2014-03-27 12:53:20 -04:00
Gary Russell
776705e6c4 INT-3308 SubscribableChannel Optimization
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
2014-03-06 13:28:08 +02:00
Artem Bilan
2fd27e3a6c INT-3286: Add @EnableMessageHistory
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`
2014-02-10 08:51:13 -05:00
Artem Bilan
2b888b7a76 INT-1897: Refactoring for ChannelInterceptors
JIRA: https://jira.springsource.org/browse/INT-1897

INT-1897: Introduce `ChannelInterceptorAware`

Upgrade to SF 4.0.1

JIRA: https://jira.springsource.org/browse/INT-3255
2014-01-29 10:47:26 -05:00
Artem Bilan
acf2ad2229 INT-3246: MessageHandlingException Refactoring
JIRA: https://jira.springsource.org/browse/INT-3246

INT-3246: Add description to usage of MHException

Deprecate `MessageRejectedException` constructor

INT-3246: Remove `MessageHandlingException` class
2014-01-03 16:19:01 -05:00
Gary Russell
80baca84c3 INT-3187 Uncomment JMX Test Case
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
2013-12-16 21:31:42 +02:00
Gary Russell
48a005ec2a Use SI BeanFactoryChannelResolver
Resolve channel names in the HeaderChannelRegistry.

Add back MessagingTemplate (subclass of GenericMessagingTemplate).
2013-11-25 18:43:16 -05:00
Gary Russell
9146a374c1 Merge remote-tracking branch 'upstream/master' into 4.0.0-WIP
Conflicts:
	spring-integration-core/src/main/java/org/springframework/integration/MessageHeaders.java
	spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java
	spring-integration-core/src/main/java/org/springframework/integration/json/JsonToObjectTransformer.java
	spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java
	spring-integration-core/src/main/java/org/springframework/integration/metadata/package-info.java
	spring-integration-feed/src/test/java/org/springframework/integration/feed/inbound/FeedEntryMessageSourceTests.java
	spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapter.java
	spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java
	spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisOutboundChannelAdapterParserTests.java
	spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java
	spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapterTests.java
	spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java
	spring-integration-test/src/main/java/org/springframework/integration/test/matcher/MockitoMessageMatchers.java
	spring-integration-test/src/main/java/org/springframework/integration/test/matcher/PayloadMatcher.java
	spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceTests.java
	spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceWithRedisTests.java

Resolved.
2013-11-05 14:30:50 -05:00
Artem Bilan
5be8ef3fd8 INT-3147: (3167,3173,1941) Improve MetadataStore
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-3147
https://jira.springsource.org/browse/INT-3167
https://jira.springsource.org/browse/INT-3173
https://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
2013-11-04 12:44:12 -05:00
Gary Russell
2bc0c442ce Merge remote-tracking branch 'upstream/master' into 4.0.0-WIP
Conflicts:
	spring-integration-core/src/main/java/org/springframework/integration/channel/registry/ChannelRegistry.java
	spring-integration-core/src/main/java/org/springframework/integration/channel/registry/LocalChannelRegistry.java
	spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java
	spring-integration-core/src/main/java/org/springframework/integration/support/json/AbstractJacksonJsonMessageParser.java
	spring-integration-core/src/test/java/org/springframework/integration/channel/registry/LocalChannelRegistryTests.java
	spring-integration-core/src/test/java/org/springframework/integration/handler/ServiceActivatorDefaultFrameworkMethodTests.java
	spring-integration-jmx/src/test/java/org/springframework/integration/jmx/ServiceActivatorDefaultFrameworkMethodTests.java
	spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/OperationInvokingOutboundGatewayTests.java

Resolved.
2013-11-01 18:19:02 -04:00
Gary Russell
9849e2087d INT-2628 Add ObjectNamingStrategy to IMBE
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`
2013-11-01 16:47:03 +02:00
Gary Russell
008bc8522b INT-3183 Document the IMBE 'id' Attribute
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.
2013-10-31 16:03:04 -04:00
Gary Russell
945eea7a36 INT-3188 Make Direct Handler Call Tests Robust
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.
2013-10-31 11:14:20 -04:00
Gary Russell
435064453f INT-3182 Fix JMX Operation Invoking With Primitive
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
2013-10-31 15:44:11 +02:00
Gary Russell
eaa28a9dbf INT-3186 Fix Metrics For Direct MessageHandler
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
2013-10-31 15:38:19 +02:00
Gary Russell
7cebffb086 Fix Imports After Merge 2013-10-30 23:31:17 -04:00
Gary Russell
3080b892d5 Merge remote-tracking branch 'upstream/master' into 4.0.0-WIP
Conflicts:
	spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java
	spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java
	spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java
	spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayWithPathMappingTests.java
	spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/AbstractTxTimeoutMessageStoreTests.java
	spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java

Resolved.
2013-10-30 23:13:27 -04:00
Gary Russell
848f3a5103 INT-3185 Fix Direct Handlers When Exposed as MBean
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
2013-10-30 18:58:34 +02:00
Gary Russell
7dcd2b5fe9 Remove SI GenericMessage
- Deprecate for now to ease XD migration.
2013-10-24 09:46:30 -04:00
Gary Russell
b31018945d Initial Changes for SPR 4.0.0.RC1
- MessageConverter
2013-10-24 09:38:34 -04:00
Andy Wilkinson
28ab8394de Build on top of Spring 4's new messaging types
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.
2013-10-08 16:42:22 -04:00
Gary Russell
be87cfc365 INT-3152 Speed Up Build Times
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.
2013-09-26 17:38:38 -04:00
Gary Russell
197f9d75ba INT-3144 Fix JMX Tests Timing Issue
Really only an issue with the queue channel test, but change
all tests to use CountDownLatches instead of relying on Thread.sleep().
2013-09-20 11:39:04 +03:00
Gary Russell
99fa064dda INT-3124 Make Test Domains Unique
Gradle build failed with InstanceAlreadyExistsException.

Make domains unique in new tests and the one that failed.
2013-09-03 13:58:02 -04:00
Pid
5212ea13ef INT-3124 Add JMX MBean Tree Inbound Adapter
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
2013-09-03 13:06:01 -04:00
Gary Russell
db8da81d16 INT-3125 Fix Handler MBean Names Within Chains
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.
2013-09-01 10:08:42 -04:00
Artem Bilan
70886b2543 INT-2822: 'requires-reply' for Outbound Gateways
* 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
2013-08-19 13:48:31 -04:00
Gary Russell
1847eaa194 INT-3110 Fix JMX Control Bus With SF 3.2.3
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.
2013-08-16 16:14:29 -04:00
Gary Russell
50e728f9e0 INT-3035 Fix ExponentialMovingAverageRate 'window'
'window' constructor arg was not used.

Add test.
2013-06-06 11:37:30 -04:00