Commit Graph

110 Commits

Author SHA1 Message Date
Gary Russell
90e5457260 File Cleanup - ws to xmpp 2016-06-04 12:50:39 -04:00
Artem Bilan
47d7a67bda Some various upgrades, fixes and refactoring
* Upgrade to SA and SF snapshots
* Address TODOs regarding those upgrades
* Resolve some other TODOs
* Replace `PropertyPlaceholderConfigurer` beans with the `<context:property-placeholder>`
* Upgrade to Spring Social Twitter 1.1.2 and resolve deprecations via mocks (https://github.com/spring-projects/spring-social-twitter/issues/91)
* Upgrade to Curator `3.1.0` and resolve deprecation in the `ZookeeperMetadataStore`
2016-04-25 23:32:14 -04:00
Gary Russell
4027b38da8 Remove System.out/.err Calls From All Tests 2016-04-14 16:22:45 -04:00
Gary Russell
05cc7be644 checkstyle WhiteAround
WhiteAroundCheck script
2016-04-05 13:50:11 -04:00
Gary Russell
842aded9a4 checkstyle MutableException
checkstyle EmptyBlock

checkstyle fixRightCurly Script

checkstyle EmptyStatement

checkstyle RightCurly

checkstyle TailingWhite

checkstyle NeedBraces

Fix the line separator in the `fixRightCurly.gradle`
2016-04-05 13:10:33 -04:00
Artem Bilan
b363bdb15e INT-3541: The XMPP Extension Support on Outbound
JIRA: https://jira.spring.io/browse/INT-3541

Address PR comments
2016-04-01 13:07:52 -04:00
Gary Russell
4bfcdb9dfa INT-3944: Async JMS Outbound Gateway
JIRA: https://jira.spring.io/browse/INT-3944

Polishing (PR comments) and Doc Polish

Polishing - PR Comments

Remove custom `async` boolean in favor of the now public setter.

Add exception to `JmsException` hierarchy.

INT-3944: Polishing

* Rename `asyncReplySupported` just to `async`. As well as its getter and setter. Plus fix docs on the matter
* Polishing for the `JmsOutboundGateway` according PR comments
* Rework `JmsOutboundGateway` to return `AbstractIntegrationMessageBuilder` instead of `Message`
since `AbstractMessageProducingHandler` rebuilds `Message` for a new one to copy headers from request
* Add `getPayload()` and `getHeaders()` to the `AbstractIntegrationMessageBuilder` to make the `Routing Slip`
users happy, when the `AbstractIntegrationMessageBuilder` is pushed to the `Routing Slip path` function
* Fix race condition in the `ChatMessageListeningEndpointTests`: the `stanza` parsing is done in the different Thread.

Doc Polishing (Routing Slip)

Fix timing issue in the `LastModifiedFileListFilterTests`:
`Thread.sleep()` not always reflects the reality.
Switch to the "past simulation" via explicit `File.setLastModified()`
2016-03-25 16:44:35 -04:00
Artem Bilan
69ee423ce2 INT-3972: Allow Disabling of Roster Subscriptions
JIRA: https://jira.spring.io/browse/INT-3972
2016-03-25 13:52:12 -04:00
Artem Bilan
f7c59b3b18 INT-3963: Add XMPP Extensions Support
JIRA: https://jira.spring.io/browse/INT-3963

* Update to Smack-4.1.6
* Introduce `stanza-filter` option for the `<int-xmpp:inbound-channel-adapter>`
* Introduce `payloadExpression` for the complex and specific `stanza` parsing, e.g. GCM packets
* Deprecate `extract-payload` in favor of `payload-expression`
* Add `ChatMessageListeningEndpointTests` test for GCM protocol
* Add `ChatMessageInboundChannelAdapterParser` test for new attributes
* Document changes

Polishing according PR comments

Extract `#extension` SpEL variable

Document the `#extension` SpEL variable
2016-03-22 14:08:26 -04:00
Artem Bilan
fec2a36f42 INT-3916: Don't Use CTOR Injection in FactoryBean
JIRA: https://jira.spring.io/browse/INT-3916

The `JpaOutboundGatewayFactoryBean` used CTOR injection for the `JpaExecutor`.
That one, in turn, uses CTOR injection for the `EntityManagerFactory`.

Such a dependency may cause the `early bean instantiating` in case of `AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()`.
And we end up with the `BeanCurrentlyInCreationException`.

Therefore no one `FactoryBean` should use CTOR injection if there is a potential hierarchical dependency.

NOTE: there is no tests on the matter, since we don't change the components behavior.
The `JPA` sample application will be changed to the Boot to track this fix.

**Cherry-pick to 4.2.x**

Address PR comments and fix other `FactoryBean`s for the same issue, when it is reasonable

Polishing

Address PR comments

Make setter `setSockJsTaskScheduler` as `public`
2016-01-06 12:02:26 -05:00
Artem Bilan
7da183f8ed INT-3834: Upgrade to Smack-4.1.5
JIRA: https://jira.spring.io/browse/INT-3834
2015-12-09 12:09:25 -05:00
Stéphane Nicoll
463c185b38 Refactor AbstractHeaderMapper
This commit updates AbstractHeaderMapper in a number of ways:

* The 'userDefinedHeaderPrefix' property has been removed as some
  advanced tests revealed that the feature is actually broken right
  now and there is no easy way to fix it. A new richer hook point
  that indicates if the property comes from the target object or the
  standard MessageHeaders has been added.
* A HeaderMatcher interface has been introduced to replace the
  lengthy checks in shouldMapHeader. Several implementations
  of that interface are provided
* An additional pattern has been added that maps any header that is
  *not* a standard header. It uses the standardHeaderPrefix property
  for that purpose
* A number of protected method that were only used to create the
  instance have been removed in favour of a non default constructor.
  Subclasses should provide those *static* values in their own default
  constructor.
* The list of transient headers can now be customized. Transient
  headers are headers that should never be mapped. The standard
  ErrorChannel and ReplyChannel headers have also been removed from
  the default transient headers list as they no longer need to be
  transient

header-mapper: Polishing
2014-08-19 12:02:01 +03:00
Florian Schmaus
714db85681 INT-3383: Update to Smack 4.0.0
JIRA: https://jira.spring.io/browse/INT-3383

The family of Message.(set|get)Properties methods has been factored out
of Smack as an extra extension. Use JivePropertiesManager as replacement.

It is no longer necessary to supress Smack path warnings.

Delete custom smack-config.xml, as all it did was disabling
certain (important) SASL mechanisms. Also remove the unit test that
verified this.

Some unit tests mock ChatManager and Chat for no reason, delete
those lines.

XMPPConnection.getHost() and .getPort() are only valid after the
connection got established, due the fact that those information is
often only available after a DNS SRV lookup was performed. Remove the
lines in unit tests that verified their value.

Remove the truststorePath example in documentation, since Smack 4.0 no
longer provides support for providing a custom truststore. Instead
ConnectionConfiguration in Smack 4.0 allows to set a custom SSLContext
(which then again can provide a TrustManager that uses a custom
truststore).
2014-06-17 15:56:19 +03:00
Gary Russell
aeeb9db4f6 INT-3379 - Allow Placeholders for Enums
JIRA: https://jira.spring.io/browse/INT-3379

Change enumerated attributes to a union with xsd:string
to allow placeholders.

JMS and XML deferred to 4.1 due to the amount of
changes needed to the parsers. See INT-3384.
2014-04-23 13:58:00 -04: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
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
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
7dcd2b5fe9 Remove SI GenericMessage
- Deprecate for now to ease XD migration.
2013-10-24 09:46:30 -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
Gunnar Hillert
0271acaf4c INT-2916 - Upgrade to JUnit 4.11 in support of JDK7
For reference see: https://jira.springsource.org/browse/INT-2916

Changes:

* INT-2919 - Upgrade Spring Data Gemfire to 1.2.2.RELEASE
* Exclude Hamcrest transitive dependency from JUnit (as already explicitly declared)
* Set sourceCompatibility in build.gradle to 1.6
* Set targetCompatibility in build.gradle to 1.6
* Upgrade Hamcrest to 1.3 and fix deprications
  - Corematcher is(*class) change to is(instanceOf(*class))
  - Change org.junit.internal.matchers.TypeSafeMatcher to org.hamcrest.TypeSafeMatcher
  - Change import org.junit.matchers.JUnitMatchers.containsString to org.hamcrest.CoreMatchers.containsString
  - Change import org.junit.matchers.JUnitMatchers.both to org.hamcrest.CoreMatchers.both
  - Change import org.junit.matchers.JUnitMatchers.containsString to org.hamcrest.CoreMatchers.containsString
* Fix JUnit deprecations
  - changed junit.framework.Assert to org.junit.Assert
* Add few missing licenses headers to tests
* Marked several test classes with: @DirtiesContext(classMode=ClassMode.AFTER_EACH_TEST_METHOD)
  - SplitterIntegrationTests
  - GatewayInvokingMessageHandlerTests
  - FileToChannelIntegrationTests
  - FileInboundChannelAdapterWithRecursiveDirectoryTests
  - JdbcMessageStoreChannelTests
  - ChatMessageInboundChannelAdapterParserTests
* 3 Tests ignored (Still needs to be addressed):
  - testOperationOnPrototypeBean
  - testFailOperationWithCustomScope
  - testOperationOfControlBus
* Update SQL script (test-failure):
  - spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundSchema.sql
  - add drop table statements
  - add ignore-failures="DROPS" to "jdbcOutboundChannelAdapterCommonConfig.xml"

INT-2916 - Code Review Changes

INT-2916 - Fix ignored Tests

Fix 3 previously ignored tests in *GroovyControlBusTests*:

* testOperationOnPrototypeBean
* testFailOperationWithCustomScope
* testOperationOfControlBus

INT-2916 - CI Build Testing

INT-2963 - Remove JDK7 Compilation Warnings

* Upgrade Mockito to 1.9.5
* Fix failing SubscribableJmsChannelTests

INT-2916 - Standardize Hamcrest assertions
Ensure Hamcrest assertions are standardized to: is(instanceOf(...))
2013-04-04 13:40:46 -04:00
Tomasz Sterna
9e5ec80533 INT-2786 Do not Provide Fixed XMPP Resource String
Previously, the connection resource was hard-coded to 'Smack' by
default.

According to RFC 6120 section 7.6.  Server-Generated Resource Identifier
if the connecting client does not provide resource string, server will
generate RANDOM one for it.
Smack API allows this by providing null resource in
XMPPConnection#login(username, password, resource) call.
See Smack's SASLAuthentication documentation.

Tested with XMPP sample (including default resource and configuring
as 'Smack').
2012-10-12 11:34:21 -04:00
Gary Russell
08cbab08c2 INT-2214, INT-343, INT-2250 MessageHandler Advice
Add general capability to advise just the handleRequestMessage
part of an AbstractReplyProducingMessageHandler.

This is to advise just the immediate operation, and not the
entire downstream flow.

Uses include:

* outbound gateway post processing
* adding retry behavior using spring-retry
* adding circuit breaker functionality

Initial commit for review.

Also need to advise simple message handlers (such as file
etc) to allow them to post-process file operations
with payload.delete(), payload.renameTo(...) etc.

INT-2250 Add Circuit Breaker Advice

INT-343 Add Retry Advice

Stateless and Stateful retry using spring-retry. Stateless
means the RetryTemplate performs the retries internally.
Stateful means the exception is thrown (e.g. to JMS container)
and the retry state is maintained by spring-retry.

INT-2215, INT-343, INT-2250 Refactoring

Factor out common abstract Advice class.

INT-2214 Catch Evaluation Expression Exceptions

If an onSuccess expression evaluation fails, add an
option so the user can decide whether such an exception is
caught, or propagated to the caller.

INT-2214 etc PR Review Polishing

INT-2214 etc Namespace Core, File, FTP

Add <request-handler-advice-chain/> to outbound endpoints.

INT-2214 etc. More Namespace Support

amqp, event, gemfire, groovy, http, ip, jdbc, jms, jmx, jpa, mail, rmi, sftp, twitter, ws, xmpp

INT-2214 etc Polishing

PR Review

INT-2214 etc Polishing

Don't catch Throwable.

Move Advice classes to handler.advice package.
2012-08-06 09:15:58 -04:00
Oleg Zhurakousky
2b49c66f64 INT-1141 Improve on how MessageHandlers are stored
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
2012-06-21 13:03:50 -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
292aa90599 INT-2404 Fix Auto-Created Channel; Event, TCP, UDP
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
2012-01-23 10:12:34 -05:00
Oleg Zhurakousky
c39eb005b6 INT-2357
upgraded XMPP to Smack 3.2.1

The changes in teh tests are due to changes in the underlying API where
XMPPConnection now exposes the configuration properties.
2012-01-05 09:49:09 -05:00
Mark Fisher
77abc55a1e INT-2322 2011-12-20 13:18:57 -05:00
Mark Fisher
5805528faa removing warnings 2011-12-19 16:38:48 -05:00
Oleg Zhurakousky
634e190f5c INT-2267
removed test compile warnings

INT-2267
removed test compile warnings(2)
2011-11-29 13:50:08 -05:00
Mark Fisher
adf93e5560 HeaderMapper refactoring
INT-2083
added outbound namespace support for XMPP header mapper

INT-2083
added inbound namespace support for XMPP header mapper

INT-2083
polished XMPP inbound/outbound header mappings, added namespace support for AMQP inbound adapter/gateway header mappings

INT-2083
added support and tests for AMQP outbound gateways and adapters

INT-2083
polishing and adding more tests for AMQP support for header mappings

INT-2083
polishing AMQP and XMPP header mappings, generalized headerMapper configuration in IntegrationNamespaceUtils.configureHeaderMapper(..) method

INT-2803
added headermapping support to WS outbound gateways

INT-2803 polishing

INT-2083
refactored SimpleWebServiceOutboundGateway, added full request/reply test

INT-2083
polished MarshallingWebServiceOutboundGateway to add marshalling callback handlers, added test for marshalling call

INT-2083
polishing based on PR comments

INT-2083 interim commit

INT-2083
added RequestReplyHeaderMapper startegy and migrated AMQP Header Mapper to use it

INT-2083
migrated WS and XMPP to use a new RequestReplyHeaderMapper strategy

INT-2083 polishing with PR comments

INT-2083 polishing
removed introspection method, simplified things

INT-2083 polishing based on recent PR comments

INT-2083 interim commit

INT-2083 polishing WS module

INT-2083
refactored to make sure that Soap action header is set within HeaderMapper

INT-2083 polishing
ensured the Soap header is set to default value if not provided

INT-2083 polishing, putting tests back
2011-11-22 17:04:27 -05:00
Mark Fisher
e86cbff7dc versionless schemas for xmpp module 2011-10-10 14:10:53 -04:00
Gary Russell
bf55b88e54 INT-1848 Add order Attribute (xmpp) 2011-04-30 11:35:57 -04:00
Oleg Zhurakousky
a7e970bbe3 INT-1728 added validation to ChatMessageListeningEndpoint to make sure that it ignores messages with 'null' content, since such messages may be sent by a different clients (e.g., Adium). An example of valid chat message with no content is message with the ChatState of 'composing'. For now we are ignoring such messages. 2011-01-04 15:57:49 -05:00
Mark Fisher
e80913c639 XmppConnectionFactoryBean's autoStartup property is now true by default (not just via schema-based configuration + parsing) 2010-12-16 17:52:11 -05:00
Oleg Zhurakousky
ddd2805520 INT-1682 added parser support for error-channel for XMPP inbound adapters 2010-12-13 14:38:50 -05:00
Oleg Zhurakousky
76f0afef4f INT-1682 added tests for error-channel for both ChatMessageListeningEndpoint and PresenceListeningEndpoint 2010-12-13 14:29:27 -05:00
Mark Fisher
228edd8b37 INT-1682, INT-1683 ChatMessageListeningEndpoint and PresenceListeningEndpoint now extend MessageProducerSupport, gaining errorChannel and history writing capabilities 2010-12-13 14:00:31 -05:00
Oleg Zhurakousky
07e0d0c806 INT-1673 added SpEL documentation for @Header, updated @Header javadocs 2010-12-10 13:04:10 -05:00
Oleg Zhurakousky
9a714528e6 polishing, got rid of warining markers HTTP, XMPP 2010-12-10 12:25:19 -05:00
Oleg Zhurakousky
41d64cdf6b INT-1652 added documentation for default naming convention for XMPP 2010-11-30 18:28:40 -05:00
Oleg Zhurakousky
a58e8a83b3 INT-1651 added support for default XMPP connection name and auto-discovery of that name by the XMPP adapters 2010-11-30 16:57:33 -05:00
Oleg Zhurakousky
a5c67073d5 INT-1648 added support for sending Smack Message 2010-11-30 13:30:26 -05:00
Oleg Zhurakousky
498fcd8c3c polished and tested all XMPP samples in the ignored package 2010-11-15 20:17:43 -05:00
Oleg Zhurakousky
1fbb5d107a polishing XMPP samples, resuming @Ignored 2010-11-15 19:55:15 -05:00
Oleg Zhurakousky
706a360eda polishing XMPP samples 2010-11-15 19:54:36 -05:00
Mark Fisher
762df2f477 generating id as a fallback for inbound XMPP channel adapters 2010-11-15 17:19:50 -05:00
Mark Fisher
d45f54ba70 INT-1617 renaming test classes and config files 2010-11-15 16:52:10 -05:00
Mark Fisher
bd6fdaa239 INT-1617 renaming test classes and confif files 2010-11-15 16:47:21 -05:00
Mark Fisher
9550fcf87b INT-1617 renaming test classes and confif files 2010-11-15 16:36:03 -05:00
Mark Fisher
1b3d295783 INT-1617 renaming test classes and confif files 2010-11-15 16:31:33 -05:00