* Add beginShutdown() and endShutdown() to OrderlyShutdownCapable
* JMS/AMQP stop listener containers
* TCP (server side)
** after beginShutdown() disallow new connections, drop (log) new messages
** after endShutdown() close server socket
* HTTP (server side)
** after beginShutdown() disallow any new requests (503 Service Unavailable)
* Docbook updates
** What's new section
** Orderly Shutdown section.
INT-1141 polished code
INT-1141 added tests
INT-1141 improved how iterator is obtaind from OrderAwareLikedHashSet
INT-1141 polishing
INT-1141 stashed commit with List-based collection and performance tests
INT-1141 improved OrderedAwareLinkedHashSet
INT-1141 polishing
INT-1141, INT-2627 improved LoadBalancingStrategy and
RoundRobinLoadBalancingStrategy to obtain handler's iterator faster
INT-1141 improved getHandlerIterator method to ensure that it only executes reordering logic if there are more then one handler
INT-1141 simplified OrderedAwareLinkedHashSet to not to extend from LinkedHashSet
INT-1141
changed OrderedAwareLinkedHashSet to OrderedAwareCopyOnWriteArraySetTests, imporoved array creation in RoundRobinLoadBalancingStrategy
INT-1141 polished failing tests and RoundRobinLoadBalancingStrategy. Removed 'transient' from OrderedAwareCopyOnWriteArraySet
Move SocketTestUtils.findAvailableServerSocket to Test Module
For reference see: https://jira.springsource.org/browse/INT-2564
* Move SocketTestUtils.findAvailableServerSocket to Spring Integration Test Module
* Fix tests
* polishing TCP test to use SmartLifecycle from 'chain'
* polishing XSD to exclude using 'poller' element inside 'nested-chain'
INT-2605: eliminate breaking change in the XSD
Added testing utility from samples to provide a tool for
users to wait for servers to start during tests.
Also refactored all tests that had similar code to use
this class.
Also corrected two failing tests that needed this wait.
XSD refactoring: remove use="required" from 'request-channel' attribute of all 'outbound-gateways'
Tests for all 'outbound-gateways' inside the <chain>
The IPHeaders.CONNECTION_SEQ was replaced by the
standard sequenceNumber header (when applySequence is true)
in 2.1, in order to facilitate resequencing using the
standard resequencer.
This header was deprecated at that time. It is now
removed.
Users that were relying on this header should set
applySequence to true on the connection factory.
Implemented a ConnectionFactory that wraps a list
of connection factories, used to fail over if
a connection fails.
INT-2459 Polishing
Rebase; fix test; move boolean resets to finally block
in server factories.
INT-2459 Polishing
PR Review
Fix a test that could block indefinitely when error
in code under test.
reply-timeout had the wrong function, when compared to
other gateways.
Add remote-timeout to reflect the time we will wait
for a reply from the remote system
Make reply-timeout set the sendTimeout on the messaging template
Set remore-timeout to reply-timeout (if set) unless remote-timeout
is explicitly set.
Update reference doc, and migration guide on Wiki.
Previously, it was possible to run out of threads in
a fixed thread pool, and this could cause an indefinite
deadlock.
With this change, the deadlock is detected causing the
current message to fail, but freeing up the stuck
threads.
This was only seen with very small thread pools but
the potential was there for the condition to occur
under extreme conditions.
INT-2419 Deprecate poolSize Property
INT-2419 Polishing
Add note about OOM possibility now that an
unbounded task executor is used by default.
@ExpectedException is deprecated.
Also fixes a sporadic timing issue in the client mode test;
the default retry interval is 60 seconds and we only wait
10 seconds for the connection. If the initial connection
fails, we don't retry before the timeout.
INT-2527 Remove Event Deprecation
@Test @ExpectedException... -> @Test(expected...
When sending a message to the server, we checked that the
user hook for the socket creation was called. However,
it was possible (likely) that we tested the counter before
the socket actually opened.
Add strategy interfaces
- obtaining ServerSocketFactory and SocketFactory
- post processing ServerSockets and Sockets
- obtaining initialized SSLContext
Provide SSL and non-SSL implementations of the strategies, to
serve up the appropriate socket factories, and do nothing in the
post processing methods.
The postprocessors allow the user to modify sockets after
configured attributes have been applied but before the sockets
are used.
This is particularly useful with SSL in case additional SSL
options need to be applied.
Docs
Polishing JavaDocs
Polishing
Javadocs, polishing
Polishing
Polishing
INT-2153 Polishing
PR Review
White Space
INT-2513 Polishing
Fixed method 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".
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
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
Depending on timing, it was possible the event the test
case was waiting for would never happen. With no timeout
the selector will block until the next IO event occurs,
and there is none in this test.
Adding a call to factory.close() forces a wakeup of
the selector, which will force the harvest to occur.
This is a test-only problem.
When using NIO, a Map of connections is maintained (keyed
by the SocketChannel) and used to manage registrations
for NIO events, timeouts etc.
When a connection is closed, the corresponding entry
should be removed from the map. The code to do this
is in AbstractConnectionFactory.processNioSelections().
However, if no socket timeout (soTimeout) has been set,
or it was explicitly set to 0, connections are not
removed from the map. This was because the timeout
logic and map cleanup is done in the same iteration
loop.
Now, if soTimeout is not set, the clean up loop
operates every nioHarvestInterval milliseconds
(default 2000), we don't want to run it on
every selector event.
In addition, it runs if the selectionCount is
zero - this might occur when a socket
is closed, when the selector.wakeup() is called.
INT-2519 Polishing
Rename connections field in NIO connection factories. Name
collision caused TestUtils problem on some platforms.
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()'
Previously, when a client connection factory was used by
both an inbound and outbound adapter, the socket timeout
defaulted to 10 seconds.
This was inappropriate because, often, collaborating
channel adapters are used for aysnchronous messaaging and,
even when used for request/response, it is generatlly not
appropriate to timeout the socket due to a lack of recent
send activity.
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.
The AbstractChannelAdapterParser creates an implicit DirectChannel
if the adapter has no 'channel' attribute.
The Event, TCP, and UDP channel adapter parsers did not bind
this channel to the adapter and AC initialization failed with
'outputChannel is required'.
Further, the event schema marked the channel as being 'required',
precluding this feature.
INT-2407 Remove Channel use="required"
Parsers automatically generate the channel when none is provided.
- JMX
- JDBC
- SFTP
- Redis
- Feed
- XMPP
- Mail
- FTP
- HTTP
* MessageChannel was moved from core to the base package.
* ChannelResolver moved from core to support.
* TcpConnectionInterceptorFactoryChain was incorrect.
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.
Mac OSX problem was encountered only on the client; similar
code exists on the server side, so the workaround should
be implemented there too; just in case.
Selector.select() throws CancelledKeyException when selecting
on a closed socket.
http://java.net/jira/browse/MACOSX_PORT-526
Work around is to catch the exception and continue.
The IP module produced a significant number of benign exceptions
during a maven build. Due to auto-startup adapters with a
small retry-interval for client-mode adapters.
If a tcp client connection factory was configured for single-use
connections (one socket per message), and it was used by an outbound
channel adapter (send and forget), the socket is closed immediately
after sending the message.
This could cause issues with the connection handling because certain
failures could occur. For example, the close could occur before we
ever registered the channel for read selection, resulting in a
ClosedChannelException. Secondly, there was a small timing hole
where a selection key could be invalidated between the isValid()
call and isReadable().
These problems have been corrected.
Occasional test failures caused because test HelloWorldInterceptor
could prematurely close the connection, depending on timing.
Also added some minor cleanup to the tests themselves.
Autostartup defaulted to false and isRunning() returned
the status of the associated connection factory instead
of its own status. Precluded it being started because
LifeCycle processor thought it was already started.
Previously, for single-use server sockets, and for client sockets
that have a collaborating inbound adapter, the socket timeout
was set to 10 seconds, with no way to set to infinity. The work
around was to set it to Integer.MAX_VALUE.
The intent was to avoid DoS attacks and mis-behaved clients, but
some users have expressed a desire to be able to set an infinite
timeout in both scenarios.
A future release may remove the 10 second default from the client
socket that has a collaborating inbound adapter, and default to
infinity. For this reason, that case now emits a warning.
The default 10 second timeout on single-use server sockets will
likely remain.
INT-1872 Remove WARN Log
We decided to eliminate the log message regarding a possible
future change to the default timeout for client sockets used
for request/reply.
Add client mode for inbound endpoints, and for the
outbound adapter.
INT-1770 Allow Inbound Adapter to Open Connection
Normally, inbound adapters use server sockets and wait for incoming
connection. There are use cases where the adapter should establish
the connection and wait for inbound messages.
INT-1770 Open Connection on Start
Allow configuration of outbound adapter to permit
connection establishment when the adapter is started
rather than when the first message arrives.
INT-1770 Allow Inbound Gateway to Open Connection
Normally, inbound gateways listen for connections. There are
use cases where an inbound gateway might open the connection
and then wait for incoming requests.
INT-1770 Parsers
Update parsers and tests to support attributes for setting
endpoints in client-mode.
INT-1770 Docs
Update reference with client-mode information.
INT-1770 Add Control Bus for Client Mode
Enable control bus commands to check status and to attempt
connection establishment.
ip_connection_id header is used to determine to which socket
a message should be written. If this header is missing, we
can't send the message and we log an error. Previously, an
NPE was thrown.
This applies to inbound gateway replies and asynchronous
outbound server messages.