Commit Graph

1244 Commits

Author SHA1 Message Date
Oleg Zhurakousky
c377b82d8a INT-2518 addressed Resequencer with custom comparator
removed setComparator(..) method from ResequencingMessageGroupProcessor, fixed tests. More details as to why are available in JIRA https://jira.springsource.org/browse/INT-2518
2012-06-06 10:08:05 -04:00
Gary Russell
e053932c5c INT-2592 Fix Memory Leak in SimpleMessageStore
Locks used to control access to a group of messages were
never removed from the collection.

Converted to use LockRegistry, which (by default) uses
a pool of reentrant locks, using the hashcode of the group id
as an index into the pool.

Given that the pool is fixed, there is nothing to remove, thus
avoiding the memory leak.

When used within AbstractCorrelatingMessageHandler, any
custom LockRegistry supplied will also be used by the message
store, thus allowing the user to increase or decrease the
size of the lock pool. The registry can not be changed
once the SimpleMessageGroup has been used.

Also, the ACMH had some protection to avoid setting the
LockRegistry more than once, but this did not protect
against the default lock registry being replaced after
it had been used. Added additional protection to avoid
this condition by setting lockRegistrySet to true in
onInit().

INT-2592 Polishing

PR Comments. Now, if a custom lock registry is required, it
must be supplied to both the ACMH and SMS.

INT-2592 polishing, fixed Javadoc in SMS
2012-06-01 13:09:43 -04:00
Gary Russell
59d7432eef INT-2417 Alias Endpoints with Generated Names
Handlers for consumer endpoints get a generated name
derived from the endpoint class name.

It is useful (for example for autowiring in tests)
to give the handlers a well-known name.

If the endpoint has an ID attribute, the handler
now gets a bean name of "<ID>.handler".
2012-05-17 16:10:02 -04:00
Oleg Zhurakousky
9656ee70f4 INT-2453 content-type and ObjectToJsonTransformer
Added 'content-type' functionality to ObjectToJsonTransformer

Added 'content-type' attribute to object-to-json-transformer element

Added parser and usage tests to ensure propper overrides
(see Mark's last comment here https://github.com/SpringSource/spring-integration/pull/409)

Applied required changes to Amqp module to work with standard 'content-type' header

INT-2453 polish based on PR comments

INT-2453 polished test

INT-2453 polished parser
2012-05-15 16:56:11 -04:00
Artem Bilan
45c429ee2b INT-2275: any outbound-channel-adapter in <chain>
Add re-init logic for nested chains
Add logic about nested element for AbstractChannelAdapterParser
Refactor of DefaultOutboundChannelAdapterParser
Test for non-last nested chain with some outbound-channel-adapter
Improve XSD for chain-type
Manual outbound-channel-adapter ability for chain
Integration tests for all outbound-channel-adapter within <chain>
Remove redundant 'return-value-required' attribute from <stored-proc-outbound-channel-adapter>
Add support 'expectReply' for FileWritingMessageHandler

INT-2275 polishing & refactor FileOutbound*Parser

HttpRequestExecutingMessageHandlerTests polishing

INT-2275: polishing JavaDoc
2012-05-14 12:41:39 -04:00
Gary Russell
0a12a496cc INT-2485 Orderly Shutdown
Initial commit - @ManagedOperation on IMBE

- can be invoked via JMX, <control-bus/>, or getting a reference to
the IMBE from the application context.

INT-2485 Updates After Review Comments (JIRA)

* Shutdown Schedulers first, and wait for them
* Add a force parameter, which overrides thread pool shutdown options
* Shutdown Sources/Channels after all thread pools have stopped
* Mark other components as OrderlyShutdownCapable (e.g. JMS/AMQP Listener containers) and shut them down first
* Wait for remaining time to allow for quiescence

Also
* remove TimeUnit parameter (not JMX-friendly); time limit is now always milliseconds
* If thread pools don't stop in time limit, force them down.

INT-2485 Handle Self-Destruction

Add shutdown-executor to IMBE.

When the shutdown was called on a Spring-Managed thread, the shutdown
was not clean because we timed out waiting for the current thread to
terminate. After that, we force terminated other components.

Now, by providing a dedicated Executor for the shutdown process, it
is used for the shutdown instead of the current thread. This Executor
is *not* shutdown.

It is not necessary to provide an Executor if the stopActiveComponents()
method is called on some other thread that is not involved in the
shutdown.

Also adds executor name to logs, when available.

INT-2485 Polishing

Fix MBean object name collision when running all tests.

INT-2485 Enable TCP Shutdown

Make TCP connection factories 'OrderlyShutdownCapable' so
they are stopped before schedulers/executors in order for
them to release any executor threads they are holding.

INT-2485 Polishing

Didn't need DirectFieldAccessor - scheduler and executor have
an accessor for the native ExecutorService.

Copyrights

INT-2485 Polishing

schemaLocation version.

INT-2485 PR Review Polishing
2012-05-10 08:10:00 -04:00
Oleg Zhurakousky
7d0dcf0805 INT-2508 Priority Channel FIFO
Fix a concurrency issue with the PriorityChannel by
introducing a private MessageWrapper; an implementation
of Message, to maintain the contract with the Comparator.

The MessageWrapper contains the original Message plus
an incremented sequence number, used as a tie-breaker,
to maintain FIFO semantics within priority.

Previously, the sequence number was added to, and removed
from, the headers of the original Message using a
DirectFieldAccessor.

This could cause concurrent modification
exceptions when it was removed.

INT-2508 polishing based on PR comments

INT-2508 Polish Whitespace
2012-05-09 13:50:08 -04:00
Artem Bilan
1a5275a1ad INT-2542: order attr. for logging-channel-adapter
Additional tests for LoggingChannelAdapterParser
2012-05-09 13:25:31 -04:00
Oleg Zhurakousky
e1274f3bb4 INT-2497
changed warning message to error in AbstractCorrelatingMessageHandlerParser when both beanRef and expression are present, re-enabled commented out test to verify the error
2012-05-08 16:54:41 -04:00
Gary Russell
411aa296a4 INT-1871 TCP CachingClientConnectionFactory
Pool based on algorithm used for spring-integration-file
CachingSessionFactory introduced by INT-2146. Refactored
that code to use the common SimplePool.

One difference to the previous implementation is the
ability to change the pool size dynamically.

If the size is reduced and more than the new size are
in use, items are closed as they are returned until
the pool size is as requested.

Initial commit.

Allow Pool Size Changes

Factor out Pool

Polishing

Pool Tests

Default forever

Javadocs, File

Polishing

INT-1871 PR Polishing

* Consistent/cleaner method names
* Track checkouts; reject release of 'foreign' objects.
* Add 'getAllocatedCount()'
2012-05-07 08:25:11 -04:00
Gary Russell
95cd202be6 INT-2536 Create 2.2 Schemas
Add 2.2 versions of module schemas.

JMX is already covered by an existing pull request.

INT-2536 Schema Check

Bump version for schema check in
AbstractIntegrationNamespaceHandler.

INT-2536 Remove Schema Versions

Some test config files had 2.1 versioned schemas.
2012-05-04 10:04:01 -04:00
Oleg Zhurakousky
aec1467b6b INT-2434 lower-cased ChannelInitializer bean name 2012-04-04 14:27:58 -04:00
Oleg Zhurakousky
458eac43da INT-2434 Fix How input-channels are auto-created
Channel creation logic for channels that are not explicitly defined but identified via an 'input-channel' attribute on the corresponding endpoint is now done by ChannelInitializer - an InitializingBean implementation.

This bean plays a role of pre-instantiator since it is instantiated and initialized as the very first bean of all SI beans using AbstractIntegrationNamespaceHandler

INT-2434-v3 polishing

INT-2434-v3 polishing, changed ChannelCreatingFactoryBean from BeanFactoryPostProcessor to BeanFactoryAware

INT-2434 polishing

fix the test

changed the default name of the CHANNEL_CREATOR_BEAN_NAME to a simple name

added additional test

changed ChannelCreatingFactoryBean from FactoryBean to InitializingBean and renamed it to ChannelInitializer

INT-2434 added test validating how automatic channel creation can be disabled

INT-2434 polished based on the latest PR comments

INT-2434-v3 polishing based on comments and discussions with @markfisher and @garyrussell. Added support for disabling aut-creatioin of channels

INT-2434-v3 polished based on @garyrussell last comments

INT-2434-v3 final polishing
2012-03-30 14:40:22 -04:00
Mark Fisher
a77e5dac5a Combined commit from Gary and Mark for INT-2451
Added bean resolver to ContentEnricher
INT-2451 Polishing - PR Review Comments

Disallow bean resolution in the name expression for content enricher
properties - the name expressions can only resolve to payload
properties. Value expressions can resolve to beans and bean properties.
2012-03-29 18:32:30 -04:00
Oleg Zhurakousky
5952934171 INT-2502-patch Tighten Mask Validation
Polishing and add tests.
2012-03-29 11:19:17 -04:00
Oleg Zhurakousky
4375cd9c8c INT-2502, INT-1117 Improve Group Locking
Add initial support for Global lock registry. Fix race condition described in INT-2502.

INT-2502 addressed PR comments by @garyrussell

INT-2502 polishing
2012-03-28 18:44:24 -04:00
Oleg Zhurakousky
fc31317aa4 INT-2396 Fix 'expression' Attribute Parsing
Ensure that 'expression*' attributes are parsed
by the AggregatorParser when 'ref' is used to
define the actual aggregator

INT-2396 polishing based on PR comments

INT-2396 changed parser error to warning
message as suggested by Mark.
Raised follow up JIRA for 2.2 to fix it back to error
2012-03-27 15:23:17 -04:00
Oleg Zhurakousky
5fd15d11e0 INT-2478a polished the test that broke the build 2012-03-27 14:13:58 -04:00
Oleg Zhurakousky
aeb7df2ad5 INT-2478 SimpleMessageStore and Sequence* Headers
Fix AbstractCorrelatingMessageHandler to ignore
Message Sequence information IF a custom release strategy is provided.

INT-2478 polishing based on PR comments.

Rename Test case.
2012-03-27 11:41:36 -04:00
Gary Russell
b6b4e25efc INT-2449 Fix PubSub Subscriber Accounting
PubSub channel subscriber accounting was incorrect; the counter
was not decremented when unsubscribing.

The handler count, reflecting the current number of subscriptions,
was maintained in the AbstractSubscribableChannel. The count really
belongs in the dispatcher and calls should be delegated to it, particularly
for a custom ASC, which might have a custom AbstractDispatcher.

However, it is possible (although perhaps rare) that someone
could implement a custom channel with a custom dispatcher that
is *not* a subclass of AbstractDispatcher.

Therefore, we now delegate to the dispatcher if we can, and
revert to a counter in the channel if we can't.

Also, the asymmetric accounting in this case is resolved; the
counter is decremented when a subscriber unsubscribes.

Polishing - factor out common code.
2012-03-24 17:32:32 -04:00
Gary Russell
f75dc53ab0 INT-2431 Improve 'Dispatcher Has No Subscribers'
Add channel name to MessageDeliveryException

'Dispatcher has no subscribers'.

In a large integration flow, it can be difficult to track
down which subscribable channel has no subscribers.

This commit adds to the message text in the form

    for channel someChannelName

to the exception message. For example:

    "Dispatcher has no subscribers for channel myChannel."

Also

    for amqp-channel someAmqpChannelName
    for jms-channel someJMSChannelName
    for redis-channel someJMSChannelName

INT-2431 Polishing

Make component type and name immutable once set to avoid
channels further down the stack frame claiming ownership.

INT-2431 Polishing

* PR Comments - use a new Exception type
* Add support for Redis
* Add WARN logs for AMQP/JMS pub-sub channels

INT-2431 Polishing

PR Comments: tighten up isPubSub field in AMQP-backed channel.

INT-2431 Polishing

Ensure channel name is not 'null' or empty string.
2012-03-23 09:50:01 -04:00
Artem Bilan
6c7f7c3eb0 INT-2439 PollerParser adviceChain.add(customBean)
Fix PollerParser#configureAdviceChain for adding 'customBeanDefinition' into 'adviceChain' List.
PollerParserTests: adding <tx:advice> as customElement into poller's <advice-chain>.

Commit is mostly parser tidy-up. The crux of the fix is to add the
missing call to adviceChain.add().
2012-03-13 11:22:54 -04:00
Oleg Zhurakousky
76f6c0877e INT-2412
removed priority enumeration from the 2.0 and 2.1 schema

fixed documentation, added tests
2012-02-13 12:02:02 -05:00
Artem Bilan
920e2f2f50 INT-2405 fix MessageProcessor for <header-value>
1. MethodInvokingHeaderValueMessageProcessor => MessageProcessingHeaderValueMessageProcessor because now he uses MessageProcessor
2. polishing HeaderEnricherParserSupport
3. GroovyHeaderEnricherTests: add check to HeaderValueMessageProcessor for Groovy scripts.
4. build.gradle: add dependency to 'spring-integration-test' for 'spring-integration-groovy'.
2012-02-06 10:17:53 -05:00
Artem Bilan
51da77d14d INT-2399 fix processMessage for service-activator
ServiceActivatorFactoryBean#createMessageProcessingHandler: force 'processMessage' method-name parameter into constructor ServiceActivatingHandler for MessageProcessor
Test for check 'handlerMethods' in ServiceActivatingHandler's MethodInvokingMessageProcessor
Integration test for <service-activator> with invalid Groovy inline script
2012-02-06 09:59:46 -05:00
Gunnar Hillert
a6f400152e INT-2423 Remove 'KEEP_RELEASED_MESSAGES' Constant
Removed 'KEEP_RELEASED_MESSAGES' constant from AbstractCorrelatingMessageHandlerParser
2012-01-31 10:11:26 -05:00
Gunnar Hillert
4b564535d2 INT-2423 remove 'keep-released-messages' attribute
For reference see: https://jira.springsource.org/browse/INT-2423
2012-01-30 23:54:07 -05:00
Gary Russell
3518f3cb4e INT-2409 Fix STS 'Missing Bean' Warnings
Some generated bean names (e.g. LoggingHandler) cause
warnings in STS:

(Warning "Referenced bean
'org.springframework.integration.handler.LoggingHandler#0' not found")

Fix is to register these beans as components so an event is fired.
2012-01-30 10:15:10 -05:00
Artem Bilan
7efff7ef7a INT-2180: fix Delayer's scheduler docs
spring-integration-2.1.xsd: Delayer's scheduler 'documentation' & tool's expected-type.
Reference Manual: Delayer's introduction: fix scheduler's <interfacename>.
2012-01-23 10:42:47 -05:00
Gary Russell
b899595e01 INT-2413 <int-jmx:mbean-export/> And <control-bus>
When an AbstractMappingMessageRouter is included in an
ApplicationContext that also has an <int-jmx:mbean-exporter/>,
the @ManagedOperations (set and remove mapping) are no longer
visible to the <control-bus/>.

Adds these methods to a new interface MappingMessageRouterManagement,
thus making them available on the proxy that the MBean exporter
creates.
2012-01-23 10:34:58 -05:00
Gary Russell
46c9c807a2 INT-2411 default-output-channel Ignored on RLR
https://jira.springsource.org/browse/INT-2411

Namespace problem only; the default-output-channel was
not bound to the RecipientListRouter.

Workaround is to declare the router using <bean/> syntax.
2012-01-23 10:30:48 -05:00
Gary Russell
4872876e4f INT-2400 More expected-type Fixes
CollectionFilter in core; package changes in security.
2012-01-13 13:40:40 -05:00
Gary Russell
f76f63f23a NT-2400 Fix tool:expected-type Classes
* MessageChannel was moved from core to the base package.
* ChannelResolver moved from core to support.
* TcpConnectionInterceptorFactoryChain was incorrect.
2012-01-13 13:21:41 -05:00
Chris Beams
f30da932e8 INT-2388 Update Gradle build
This is a significant update to the build system, including the changes
listed below. README.md has been updated with instructions on the most
important day-to-day commands.

 - Eliminate buildSrc submodule

   In favor of using the new bundlor and docbook-reference plugins. The
   net effect is a large reduction in number of lines of build code.
   Common docbook resources, stylesheets, etc are stored directly in the
   docbook plugin.

   This means that --recursive is no longer required when cloning and
   there will never be a need to use `git submodule` commands. README
   files have been updated to reflect.

   Use of the new bundlor plugin also means the removal of template.mf
   files from the source tree in favor of an inline approach. See
   build.gradle for details. Bundlor 'import templates' are built up
   programmatically and kept physically close to gradle dependency
   declarations, leading to more convenience when changing these values
   and hopefully fewer errors / version inconsistencies over time.

   Certain tests depended on the presence of template.mf files, all of
   which have recently been removed from the source tree in favor of the
   new bundlor plugin which allows for inlining bundlor configuration
   within the Gradle build script. These tests now create temp files
   using the java.io.File API instead.

 - Upgrade to Gradle 1.0-milestone-6

   The m6 release is significantly faster when resolving dependencies
   and has a number of valuable new features over the earlier m3
   version. Review the release notes for Gradle 1.0-milestone-6 online
   for full details.

 - Switch to repo.springsource.org repository

   Previously the project build declared as many repositories as
   necessary to resolve all project dependencies.

   Now depending on a single 'virtual repository' defined within the
   SpringSource Artifactory instance at http://repo.springsource.org.
   Currently, the virtual repository in use is 'libs-milestone', which
   allows for the resolution of all "milestone-or-better" versions of
   all S2 and third-party dependencies.

   Should snapshot dependencies become required, this value may be
   changed from 'libs-milestone' to 'libs-snapshot'. To build only
   against GA releases, change the value to 'libs-release'.

 - New build plan(s)

   Spring Integration build plans have been updated to use the
   Artifactory Bamboo plugin and publish to repo.springsource.org.
   Build plans have names like 2.1.x to reflect the version under
   development, not necessarily the name of the branch, as this may
   change over time and across major releases.

 - Improve release process

   As mentioned above, Spring Integration will now use the Artifactory
   Bamboo plugin to publish releases and also use Artifactory's support
   for pushing builds directly into Maven Central via oss.sonatype.org.

   Generate poms that contain all necessary fields for onboarding at
   Maven central (scm, developers, organization, licenses, etc).

   Generate -source and -javadoc poms to comply with Maven Central
   onboarding rules (and for general good practice anyway).

   Generation of PGP signatures, sha1 and md5 checksums are all handled
   automatically by Artifactory. These are also requirements for
   automated entry into Maven Central.

 - Remove source-level pom generation

   Automatic generation of Maven poms suitable for use in building
   Spring Integration is no longer supported. Generation and
   publication of poms for the purpose of dependency management remains
   supported.

   Sonar support has to date depended on these poms, but will be
   switched over to use the Gradle Sonar plugin shortly.

 - Eliminate docs subproject

   Move docs/src to the root of the project and eliminate docs as a
   formal subproject. This simplifies the build in a number of ways,
   including removing the need for distinguishing between 'subprojects'
   and 'javaprojects' as well as allowing users to build both 'api' and
   'reference' docs without qualifying with a ':docs' prefix.

   Also rename the src/info directory to src/dist to better reflect that
   these files are packaged with the distribution. For example, the
   readme.txt there is really the distribution readme, distinct from the
   README.md at the root of the project which is for building from source,
   etc.
2012-01-05 17:49:04 -05:00
Gary Russell
b59ee8e352 INT-2369 package-info IP
INT-2360 package-info Core

INT-2361 package-info AMQP

INT-2362 package-info Event

INT-2363 package-info Feed

INT-2364 package-info File

INT-2365 INT-2380 package-info (S)FTP

INT-2366 package-info GemFire

INT-2367 package-info Groovy

INT-2368 package-info Http

INT-2378 package-info Scripting

INT-2372 package-info JMS
2012-01-05 14:42:24 -05:00
Gary Russell
65fa5358e7 INT-2355 Update Mockito to 1.9.0 2012-01-04 12:05:48 -05:00
Gary Russell
5750ca5ff5 INT-2347 Update Channel Mappings Atomically
Ensure consistent state if channel map is replaced
dynamically.
2012-01-03 11:44:13 -05:00
Mark Fisher
f3155f86fa corrected reversed test method names 2012-01-03 11:30:45 -05:00
Gary Russell
85ea4f6411 INT-2342 Add Test Cases 2012-01-03 11:19:52 -05:00
Mark Fisher
ffe132986b INT-2342 2012-01-03 11:17:47 -05:00
Mark Fisher
abe6220e02 Update version to 2.1.0.BUILD-SNAPSHOT 2011-12-23 12:15:13 -05:00
Mark Fisher
e67c115004 Release version 2.1.0.RC2 2011-12-23 12:00:52 -05:00
Mark Fisher
21c727b6fe INT-2329 upgrading to Spring 3.0.7 2011-12-22 15:27:53 -05:00
Oleg Zhurakousky
06bc10e960 INT-2331 fixed aggregator documentation
INT-2331 polishing
2011-12-22 09:09:57 -05:00
Mark Fisher
5fae7d2a1f fixed RouterFactoryBean 2011-12-20 17:41:21 -05:00
Oleg Zhurakousky
dd66c98f61 INT-2319
changed logic behind default group id for QueueChannel to be messageStoreId:channelId

added support for resolving value if it is a placeholder
2011-12-20 14:10:40 -05:00
Oleg Zhurakousky
50e1fddaf5 INT-2321
Handlers within a chain are no longer registered as beans in the context.
2011-12-20 13:58:07 -05:00
Mark Fisher
77abc55a1e INT-2322 2011-12-20 13:18:57 -05:00
Oleg Zhurakousky
a44d150009 INT-2323
made changes based on Sonar suggestions

added optional rome dependency to HTTP module
2011-12-20 12:12:20 -05:00
Artem Bilan
d7851fef5a INT-2316: xsd improve for reply- & error-channels
Now <header-enricher> <reply-channel> & <error-channel> are 'referenceOrValueHeaderType'.
Added tests for 'value' & 'expression' attributes on <reply-channel> element.
2011-12-20 11:13:19 -05:00