Commit Graph

9623 Commits

Author SHA1 Message Date
Gary Russell
62352d1dd7 INT-3288 Increase Test Timeouts
JIRA: https://jira.spring.io/browse/INT-3288

Sometimes, even locally with no load, ActiveMQ takes over
5 seconds to deliver the message with a polled adapter.

Increase timeout to 20 seconds instead of 2.
2014-03-08 11:50:19 -05:00
Gary Russell
df5877af17 INT-3305 SFTP Connect Error Polishing
* Add code to test to wait for server to start
* Avoid NPE when trying to close a Sesion that was never open
2014-03-07 15:48:55 -05:00
Artem Bilan
26d252bf00 INT-3288 JMS 'session-transacted' Attribute
JIRA: https://jira.springsource.org/browse/INT-3288

Previously, if you wanted to have a JMS outbound-channel-adapter
participate in an upstream JMS transaction (or use transactions
at all), you had to inject a `JmsTemplate` with `sessionTransacted`
set to `true`.

The `session-transacted` attribute has been added to the adapter,
allowing transactions to be used with the default `JmsTemplate`,
avoiding the need to inject a separate template.

Also, the inbound (polled) channel adapter incorrectly allowed
the `acknowledge` attribute to be set to `transacted` which is invalid and,
again, you had to inject an appropriately configured JmsTemplate
for transactions.

The inbound-channel-adapter now supports `session-transacted` as
well, and `acknowledge` can no longer be set to `transacted`.

There are no changes to the `message-driven-channel-adapter`, you
enable transactions with it by setting `acknowledge="transacted"`
as before.

INT-3288 Doc Polishing; Integration Tests
2014-03-07 21:06:34 +02:00
Gary Russell
7b94f1e21e Update spring-amqp to 1.3.0.RC1 2014-03-07 13:38:43 -05:00
Gary Russell
ff845b5069 INT-3309 Pluggable MessageBuilder
This is still a work in process.

There are a bunch of TODOs in classes
that are not managed by Spring and so
need to have the MessageBuilderFactory
injected.

But I am looking for feedback on the
approach.

INT-3309 Resolve TODOs

Provide access to the MessageBuilderFactory in all classes.

INT-3309 Polishing + Tests

* Fallback to 'fromMessage()' if mutating and inbound message is not MutableMessage
* Add 'alwaysMutate' boolean to MutableMessageBuilderFactory - coerces 'fromMessage' calls to 'mutateMessage'
* Add tests

INT-3309 Polishing; PR Comments

Also add tests to parent/child contexts where the parent has the
default message builder and the child has a mutable message builder.

INT-3309 More Polish; PR Comments

Also fix removeHeader in MMB.
2014-03-06 19:51:12 +02:00
Artem Bilan
4c775bce9d Fix JavaDocs issues 2014-03-06 14:33:18 +02: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
c7fb83259f INT-3313: Fix JMS-outbound requires-reply Logic
JIRA: https://jira.springsource.org/browse/INT-3313

Previously, when `requires-reply="false"` on a `<jms:outbound-gateway/>`
a `null` reply caused a `MessageTimeoutException`, instead of quiet ending of flow.
2014-03-05 17:02:34 -05:00
Artem Bilan
f0a1f81931 INT-3312: Add Support for outputChannelName
JIRA: https://jira.springsource.org/browse/INT-3312

* Add `setOutputChannelName` to `AbstractReplyProducingMessageHandler` and `SourcePollingChannelAdapterFactoryBean`
to allow to have 'late binding' and resolve the real channel from `AC` on component initialization, instead of creation phase
* Add `setRequestChannelName` and `setReplyChannelName` to `ContentEnricher` for the same purpose
* Make `HeaderValueMessageProcessor` implementation `public`. It is useful for JavaConfig and DSL
* Polishing parsers to use classes, not their names as strings

INT-3312: PR comments

INT-3312: Polishing
2014-03-05 12:18:48 -05:00
Gary Russell
5c68029a72 INT-3298 WARN if RSFB Falls Back to SeqSizeRS
JIRA: https://jira.springsource.org/browse/INT-3298

Emit a WARN log whenever the `ReleaseStrategyFactoryBean`
falls back to using the `SequenceSizeReleaseStrategy`.

This will happen if no method name is provided and no
annotated method is found, or a null reference is provided.
2014-03-05 17:25:53 +02:00
Gary Russell
8b2637dfbd INT-3305 Fix SFTP Test Case
JIRA: https://jira.springsource.org/browse/INT-3305
2014-03-05 10:21:25 -05:00
Gary Russell
345d831ec9 INT-3305 SFTP Close Session on Error
JIRA: https://jira.springsource.org/browse/INT-3305

Previously, if the channel can't be connected (e.g. if the server
does not support SFTP), the connection to the server remained open.

Close the session in the event of a failure.

Add test with the Apache SSHD server.
2014-03-05 16:16:02 +02:00
Gary Russell
3e0f17258b INT-3404 Clarify Router Attributes
JIRA: https://jira.springsource.org/browse/INT-3304

Add notes to explain the relationship between `resolution-required`
and `default-output-channel`.
2014-03-05 10:30:41 +02:00
Gary Russell
669db1fb02 INT-3299 Remove Unneeded Dependency From IP
JIRA: https://jira.springsource.org/browse/INT-3299

The IP module incorrectly has s-i-stream as a transitive dependency.

It is only used in a test case.
2014-03-05 10:27:32 +02:00
Gary Russell
727a554ccf INT-3294 Support Implicit Input Channel with Ann.
JIRA: https://jira.springsource.org/browse/INT-3294

Previously, implicit input channel creation was not
supported for annotated endpoints.

Register a `DirectChannel` if the input channel does
not exist in the context.
2014-03-04 18:28:57 -05:00
Artem Bilan
5d2820dfbe INT-1834: Register Beans for Annotated Handlers
JIRA: https://jira.springsource.org/browse/INT-1834

The general issue has been raised about `MessageHistory` for annotated endpoints (`@ServiceActivator`, `@Transformer` etc.)

* Register generated `MessageHandler`s as beans with concrete names based on component, method and annotation.
* Add tests and docs

In addition revert the version for JRuby to 1.7.8 as other latests versions have a NPE issue around `System.console()`

Doc Polishing
2014-03-03 16:55:54 -05:00
Artem Bilan
12287056d3 INT-3297: Add @MessagingGateway Support
JIRA: https://jira.springsource.org/browse/INT-3297

* Add `<gateway>` annotation analogue and its `MessagingGatewayRegistrar` to register `GatewayProxyFactoryBean` based on annotation attributes
* Add `@IntegrationComponentScan` and its `IntegrationComponentsRegistrar` to scan packages for integration components
* Add implementation to scan `@MessagingGateway`
* Add simple `@MessagingGateway` test

INT-3297: Further improvement

* Make `GatewayParser` to delegate the hard work to the `MessagingGatewayRegistrar`
* Add Docs
* Checked all existing tests

INT-3297: Polishing

INT-3297: Get rid of annotation dep from GWParser

Polishing - Docs and Assertion

Assert that the `@MessagingGateway` is on an interface.
2014-03-03 16:06:06 -05:00
Gary Russell
3761f2cf80 INT-3310 Fix Syslog Error on Socket Close
https://jira.springsource.org/browse/INT-3310

Previously, the syslog adapter tried to convert the ErrorMessage
that results from a socket error to a syslog packet, resulting
in a stack trace on stderr.

Test for the ErrorMessage and log at DEBUG.
2014-02-25 10:52:22 +02:00
Gary Russell
233aaffb3b INT-3306 Document Release Strategy POJO Limitation
JIRA: https://jira.springsource.org/browse/INT-3306

Add a caution about using POJO ReleaseStrategy with large groups.
2014-02-25 10:50:49 +02:00
Gunnar Hillert
00a4bc8cc7 INT-3307 Twitter: Upgrade Spring Social Twitter to 1.1.0
Jira: https://jira.springsource.org/browse/INT-3307
2014-02-25 10:44:36 +02:00
Artem Bilan
6a840783e7 INT-3300: Fix MS ref Regression for i-c-adapter
JIRA: https://jira.springsource.org/browse/INT-3300

The change introduced by https://jira.springsource.org/browse/INT-3147
(Registration of `MessageSource<?>` as a bean with suffix `.source`) broke
the case where `MessageSource<?>` is a reference to an existing bean.

Add check to the `AbstractPollingInboundChannelAdapterParser` for the type
of `source` and apply the appropriate logic.

INT-3300: Get rid of Spring Boot dependency

Remove test case that introduced a cyclic dependency.
2014-02-21 18:22:22 -05:00
Gary Russell
71f194a9b9 INT-3301 Polishing
* Close Context After JDBC Tests
* Fix SFTP Mock Tests

JIRA: https://jira.springsource.org/browse/INT-3301
2014-02-21 17:08:24 -05:00
Andy Wilkinson
28a23307cd INT-3301 Update Versions of Numerous Dependencies
JIRA: https://jira.springsource.org/browse/INT-3301

INT-3301 Polishing; Bump Hibernate to 4.3.1

* Fix JDBC Test after version update
* Bump Hibernate version to fix failing test

Latest versions of HSQLDB and Spring
2014-02-21 15:50:26 -05:00
Gary Russell
ccb0b8aa8e INT-3295 Add Doc For Global MessageConverter
JIRA: https://jira.springsource.org/browse/INT-3295

Plus test.
2014-02-12 14:12:27 -05:00
Gary Russell
25489adaa3 INT-3295 Datatype Channel : Use MessageConverter
JIRA: https://jira.springsource.org/browse/INT-3295

Instead of invoking the conversion service directly, do it
via a MessageConverter (DefaultDatatypeChannelMessageConverter).

That way, users can override the MessageConverter; for example,
XD wants to look at the content-type header during the conversion
process (and update the content-type).

INT-3295 Polishing

PR Comments.
2014-02-12 20:21:09 +02:00
Artem Bilan
814caea5d5 INT-3293: Add Lambda Strategies
JIRA: https://jira.springsource.org/browse/INT-3293
2014-02-11 10:50:50 -05:00
Artem Bilan
8cbaef7c6b INT-3292: Add support for Boot AutoConfiguration
JIRA: https://jira.springsource.org/browse/INT-3292

As far as Spring Boot reads `spring.factories` for key
`org.springframework.boot.autoconfigure.EnableAutoConfiguration`,
there is no difficulties to provide a hook to enable Spring Integration
via just Boot `@EnableAutoConfiguration`
2014-02-10 12:00:46 -05: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
Gavin Gray
d8e4818c5e INT-3290 Fix TCP Deserializer for 0 Length Message
ByteArraySingleTerminatorSerializer does not support multiple
subsequent terminators (zero length messages).

JIRA: https://jira.springsource.org/browse/INT-3290

* Add unit test to verify bug.
* Fix bug.

Polishing:

* Remove test for `n >= 0`; n cannot be < 0 here
* Move test case to `DeserializationTests`
2014-02-07 13:30:00 -05:00
Artem Bilan
d54772f171 INT-3285: Fix AMQP JsonHeaders Regression
JIRA: https://jira.springsource.org/browse/INT-3285

Spring Integration 3.0 introduced the `JsonHeaders` and populates them
from a request AMQP Message to the SI Message. In the case of the `AmqpInboundGateway` and
`JsonMessageConverter`, if the SI flow doesn't do anything with `JsonHeaders`
they are returned to the `AmqpInboundGateway` for reply Message
and may override correct values provided by `JsonMessageConverter` in the `DefaultAmqpHeaderMapper`.

This fix provides the check for headers from the reply Message's `MessageProperties`
and populates `JsonHeaders` if the `MessageProperties` doesn't contains the `__TypeId__` header already.

Note, it is just a fix for regression to restore previous behavior.
There is maybe a reason to revise (Another JIRA) all standard AMQP headers and populate them from SI `MessageHeaders`
in the `DefaultAmqpHeaderMapper`, only if they haven't been populated by `MessageConverter` before.

**Cherry-pick to 3.0.x**
2014-02-07 10:34:01 -05:00
Gary Russell
15d9f9566d INT-3289 FileWMH - Improve Exception Message
JIRA: https://jira.springsource.org/browse/INT-3289

Emit '...could not be created.' instead of 'does not exist.'
if the `mkDirs` fails on auto-create.
2014-02-06 13:10:33 -05:00
Artem Bilan
ea080e8a9b INT-3284: Add 'spring.factories' Infrastructure
JIRA: https://jira.springsource.org/browse/INT-3284

* Introduce `IntegrationConfigurationBeanFactoryPostProcessor`, `IntegrationConfigurationInitializer`
* Apply `IntegrationConfigurationInitializer` and 'spring.factories' for HTTP and Security modules

INT-3284: Address PR's comments

JIRA: https://jira.springsource.org/browse/INT-3287

* Fix package tangle (INT-3287)
* Apply `IntegrationConfigurationInitializer` for `MBeanExporterHelper`
* Previously, there was a separate `ChannelSecurityInterceptorBeanPostProcessor`
for each `ChannelSecurityInterceptor` whereas now, there is one `ChannelSecurityInterceptorBeanPostProcessor`
that processes all interceptors

INT-3284 Refactoring around config package tangle
2014-02-06 11:58:23 -05:00
Gary Russell
b59fe444cf Polish MixedDispatcherConfigurationScenarioTests
Assert the latches countdown instead of using an overall
Junit timeout.

Failures: https://build.springsource.org/browse/INT-B40X-JOB1-78
2014-02-04 17:12:45 -05:00
Artem Bilan
4ae5152eff INT-3250: Add @EnableIntegration Infrastructure
JIRA: https://jira.springsource.org/browse/INT-3250

* The main purpose of this change to move all infrastructure bean definitions
from `AbstractIntegrationNamespaceHandler` to a new `IntegrationRegistrar`.
* `IntegrationRegistrar` is invoked by the standard `@Configuration` process and also directly from `AbstractIntegrationNamespaceHandler`.
* Provide some refactoring for consistency.
* Add AnnotationContext tests

INT-3250: Polishing

* Remove `@EnableIntegration#defaultPublisherChannel`
* Revert `#jsonPath` & `#xpath` registration logic
* Fix for DEBUG message on each parse

JIRA: https://jira.springsource.org/browse/INT-3258

INT-3250 Fix JavaDocs & IDEA+Gradle srcDirs issue

INT-3250: Revert `build.gradle` changes

INT-3250 Polishing

* Remove commented out code
* Add javadoc to IntegrationRegistrar.registerBeanDefinitions()
* Fix javadoc links to other Spring projects (and JVM, JEE)
* Add reference documentation and what's new
2014-02-04 16:30:03 -05:00
Artem Bilan
4ac1a9113a INT-3283: Prevent AbstractSelectableChannel NPE
JIRA: https://jira.springsource.org/browse/INT-3283

INT-3236: Remove deprecated `AbstractConnectionFactory.close`

JIRA: https://jira.springsource.org/browse/INT-3236

INT-3283: Remove `selectorLock`

As far as the issue in JVM's `AbstractSelectableChannel` was fixed in Java 7 and 8,
just catch entire `Exception` on `stop()`.
2014-02-03 12:43:12 -05:00
Spring Buildmaster
dd4fdee0cb [artifactory-release] Next development version 2014-01-30 17:03:38 -08:00
Spring Buildmaster
05cf2123a0 [artifactory-release] Release version 4.0.0.M3 2014-01-30 17:03:31 -08:00
Artem Bilan
59bde8ad44 INT-3282: Add BrokerRunning Rule
JIRA: https://jira.springsource.org/browse/INT-3282

Remove `@Ignore` from integration tests and some polishing
2014-01-30 18:49:46 -05:00
Gary Russell
af3160bc60 INT-3281 Bump Spring-AMQP to 1.3.0.M2
JIRA: https://jira.springsource.org/browse/INT-3281
2014-01-30 18:45:09 -05:00
Gary Russell
c0637b6e99 INT-3259 Map Inbound JMSPriority to priority
JIRA: https://jira.springsource.org/browse/INT-3259

Add an option to suppress if needed.

INT-3259: Polishing according PR comments
2014-01-30 17:17:10 +02:00
Artem Bilan
ad1035c33a Merge branch 'INT-3280' 2014-01-30 11:36:58 +02:00
Gary Russell
5db740b1ad INT-3278 Ignore ChannelTests
Some CI Servers don't have Rabbit running.

Need to port the BrokerRunning rule from Spring-AMQP
2014-01-29 18:48:27 -05:00
Gary Russell
5aa0bcadf8 INT-3280 Fix SFTP Class Tangle
JIRA: https://jira.springsource.org/browse/INT-3280
2014-01-29 17:46:49 -05:00
Gary Russell
22c0bb4180 INT-3275 Update Spring Data Redis to 1.1.1
JIRA: https://jira.springsource.org/browse/INT-3275
2014-01-29 17:44:19 -05:00
Artem Bilan
7e32b17a10 INT-3005: Add throwExceptionOnLateReply Property
JIRA: https://jira.springsource.org/browse/INT-3005

* `GenericMessagingTemplate` has `throwExceptionOnLateReply` property.
This change provides a global `messagingTemplate.throwExceptionOnLateReply` property
to allow change default `false` to `true` using `spring.integration.properties`

* Refactor `spring.integration.properties` keys to be consistent with other Spring properties - adde prefix `spring.integraton.`

INT-3005: Add test for `lateReply`

INT-3279: Fix classes tangle
2014-01-29 11:52:48 -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
062e7bc9d2 INT-3130: Add result-type to <o-to-j-transformer>
JIRA: https://jira.springsource.org/browse/INT-3130

* add `result-type` attribute to the `<object-to-json-transformer>`
based on enumeration values: `STRING`, `NODE`
* Provide implementations for methods to convert value to the node representation
* Refactoring according new generic option in the `JsonObjectMapper`
* Add tests and documentation

Need Migration Guide note according this refactoring

INT-3130: remove some deprecation and JavaDocs

Addressed PR comments

Doc Polishing
2014-01-28 13:05:14 -05:00
Gary Russell
9005938ab5 INT-3278 AMQP PubSub Redeclare After Conn. Loss
JIRA: https://jira.springsource.org/browse/INT-3278

A broker-named auto-delete queue is not suitable for use
with a message listener container. If the connection is lost,
the queue is deleted and the container cannot recover its
consumer.

Use an AnonymousQueue, which has the same semantics as the
current queue, but can be redeclared after a connection loss.

Register the channel as a ConnectionListener and redeclare
the queue and binding as necessary.

Note: You cannot currently unregister a listener (AMQP-367)
so if the context is destroyed, the channel will remain a
listener. However, the isRunning() flag can be used to
avoid declaring the channels when in that state.

INT-3278 Polishing

* PR Comments
* Remove the listener when the bean is destroy()ed.
2014-01-28 19:54:47 +02:00
Artem Bilan
7e7fbe7247 INT-3274: build.gradle: BUILD-SNAPSHOT condition
JIRA: https://jira.springsource.org/browse/INT-3274

* Change the `libs-snapshot` repository to `libs-milestone`
* Add condition on `project.version` to check `BUILD-SNAPSHOT` release category
and enable `libs-snapshot` repository
* Remove redundant directories from `mqtt` module
* and one more project property for Spring AMQP version

To test it om master:
1. `gradle.properties -> version=4.0.0.M3`
2. `gradlew clean test --refresh-dependencies -PspringAmqpVersion=1.2.1.RELEASE`
2014-01-27 10:51:23 -05:00
Gary Russell
cb25d5ab05 INT-3239 Fix JDK8 Javadoc 2014-01-25 09:51:58 -05:00