Commit Graph

95 Commits

Author SHA1 Message Date
Artem Bilan
fb14976f61 GH-3675: Restore nativeHeaders for WebSocketInChA
Fixes https://github.com/spring-projects/spring-integration/issues/3675

The `WebSocketInboundChannelAdapter` removes a `SimpMessageHeaderAccessor.NATIVE_HEADERS`
from headers used to create an outbound message.
Turns out not all native headers are mapped by the `StompHeaderAccessor`
to the top-level header entries.

**Cherry-pick to `5.4.x` & `5.3.x`**
2021-11-15 15:33:56 -05:00
Artem Bilan
fc7d338302 GH-3656: Fix package tangles
Fixes https://github.com/spring-projects/spring-integration/issues/3656

* Move `JavaUtils` from `util` package to the root one to break any possible
tangling to/from other packages.
* Deprecate an existing `JavaUtils` for backward compatibility
* Remove `@IntegrationConverter` from the `JsonNodeWrapperToJsonNodeConverter`
and register it manually in the `ConverterRegistrar`.
The bean registration for the `JsonNodeWrapperToJsonNodeConverter` must be removed
in the next `6.0`
* Remove usage of `IntegrationContextUtils` from the `support` package
2021-11-01 15:06:01 -04:00
Artem Bilan
ee8afc5b28 BeanDefinitions: Mix instanceSupplier and props 2021-10-22 15:17:46 -04:00
Artem Bilan
d7dfea7bd0 Optimize ZeroMqMessageHandlerTests for ZMQ.Poller
* Fix unused import in the `IntegrationDynamicWebSocketHandlerMapping`
2021-06-17 11:21:57 -04:00
Artem Bilan
93743f69fe Fix dynamic Websocket endpoints for SockJS (#3581)
* Fix dynamic Websocket endpoints for SockJS

Related to https://stackoverflow.com/questions/67971467/registration-of-dynamic-websocket-at-application-initialization-time-and-at-runt

The SockJS wrapper for dynamic endpoint is not initialized properly.
Technically we just don't map to the SockJS service if such one is requested from the `ServerWebSocketContainer` configuration

* Postpone the path mapping for the target endpoint until after the `ServerWebSocketContainer` applies all the options
into its registration to expose.
* Fix `ServerWebSocketContainer` to propagate a default `TaskScheduler` for underlying SockJS Service on the endpoint
* Fix `IntegrationDynamicWebSocketHandlerMapping` to deal with path patterns as well,  which is the case for the mentioned SockJS wrapper:
the SockJS Service is able to handle the rest of the path according its setting and request requirements

* * Fix unused imports
* Add Javadoc for new `ServerWebSocketContainer.setSockJsTaskScheduler()` API

* * Cover SockJS server configuration in the WebSocketDslTests
2021-06-15 10:16:20 -04:00
Artem Bilan
6ef079819b Fix Websocket dynamic registration mapping order (#3580)
Related to https://stackoverflow.com/questions/67923303/dynamic-registration-of-websocket-output-adapter-is-not-working

By default the `AbstractHandlerMapping` comes with the `order = Ordered.LOWEST_PRECEDENCE` which sorts
added mappings to the end of chain.
At the same time Spring Boot registers a `SimpleUrlHandlerMapping` as a fallback for all not handled requests
leaving our own mapping behind consideration

* Add `order = 0` to the `IntegrationDynamicWebSocketHandlerMapping` bean registration to let it to be
consulted before `SimpleUrlHandlerMapping`
* Add a note into `web-sockets.adoc` that `@EnableWebsocket` would disable Spring Integration dynamic WebSocket
endpoints
2021-06-11 15:20:33 -04:00
Artem Bilan
560c5918f7 Fix WebSocket CORS configs for trailing slashes
Related to https://github.com/spring-projects/spring-framework/issues/26892

The WebSocket tests with `allowedOrigins` fail now because CORS processor
in Spring Framework removes a trailing slash from the request where possible one
in the config is left as is.

* Remove the trailing slash from the CORS config to match the current SF behavior
2021-05-09 18:38:02 -04:00
Artem Bilan
3c541c52b4 Make @IntegrationConverter Native compatible (#3551)
* Make `@IntegrationConverter` Native compatible

* Add `BASE_PACKAGE` into an `IntegrationContextUtils`;
deprecate similar in the `IntegrationConfigUtils`.
This fixes a package tangle between `config` and `context`
* Move `ConverterRegistrar` and `CustomConversionServiceFactoryBean`
into a `config` package since they are package protected and
created their instances in the `IntegrationConverterInitializer`
functional way instead of reflection
* Use new `IntegrationContextUtils.BASE_PACKAGE` constant instead of
deprecated one
* Make `DefaultConfiguringBeanFactoryPostProcessor` `public` to
make it available for Spring Native `trigger` option in the `@NativeHint`
declaration
* Simplify logic around `JsonPath` to just a `ClassUtils.isPresent()`
* Move the `@IntegrationConverter` processing logic into the `ConverterRegistrar`
to avoid reflection via `BeanDefinition` ctor arg manipulation
* Move the reflection logic into a `ConverterParser` which, being a part of XML
configuration, is not going to be compatible with native any way
* Mark `JsonNodeWrapperToJsonNodeConverter` with an `@IntegrationConverter`
since it is not registered via reflection any more
* Expose `MicrometerMetricsCaptorRegistrar.METER_REGISTRY_PRESENT` and use
it in the `IntegrationGraphServer`
* Extract `UnmarshallingTransformer.MIME_MESSAGE_PRESENT` for less
reflection at runtime
* Use `null` for a `ClassLoader` arg in the `ClassUtils.isPresent()`
relying on the default one internally

* * Fix Checkstyle violations
2021-04-21 11:01:05 -04:00
Artem Bilan
35fd9c5809 GH-3533: Register WebSocket endpoints at runtime (#3548)
* GH-3533: Register WebSocket endpoints at runtime

Fixes https://github.com/spring-projects/spring-integration/issues/3533

* Rework `WebSocketIntegrationConfigurationInitializer` to register beans functional way
to avoid reflection for Spring Native support
* Move `IntegrationServletWebSocketHandlerRegistry` into a separate file for better readability
* Implement `DestructionAwareBeanPostProcessor` for `IntegrationServletWebSocketHandlerRegistry`
to track runtime bean registrations and removals
* Introduce an `IntegrationDynamicWebSocketHandlerMapping` to manage runtime mapping
registrations and removals
* Add `servlet-api` dependency into `websocket` to be able to compile an
`IntegrationDynamicWebSocketHandlerMapping`
* Fix typo in the exception message of the `StandardIntegrationFlowRegistration`
* Start dynamically added beans together with associated `IntegrationFlow` in the
`StandardIntegrationFlowContext`
* Document new feature

* * Fix language in docs
* Don't start those `SmartLifecycle`s together with a dynamic flow
which are not `isAutoStartup()`

* * Fix `TomcatWebSocketTestServer` to configure servlet for `loadOnStartup = 1`
* Fix `WebSocketDslTests` to make `clientWebSocketContainer.setAutoStartup(true)`
2021-04-13 17:36:01 -04:00
Artem Bilan
df62147f5d Fix new Sonar smells 2021-04-07 11:37:05 -04:00
Artem Bilan
bb608d8922 Rework more JMS tests to common CF resource
* Refactor STOMP and WebSocket tests into JUnit 5
* Close a server application context in those tests when Tomcat is destroyed
2021-03-15 12:03:27 -04:00
Artem Bilan
0331933c16 Rely on MProducerSupport.active for Flux (#3423)
* Rely on `MProducerSupport.active` for `Flux`

* Fix `MessageProducerSupport` to extract an `active` flag and set it before
`isRunning` - the `Flux` subscription relies on the `takeWhile()`
where in case of `autoStartup = false` we will never start consume because
it is set to `true` already after `doStart()`
* Refactor all the `MessageProducerSupport` implementation with similar
`active` state to use already one from the super class

**Cherry-pick to 5.3.x**

* * Remove `MessageProducerSupport.setActive()`
to not let to mutate it from the implementations
* Set `active` to `false` in the `destroy()`
* Clean up and fix typos in the affected `JmsMessageDrivenEndpoint`

* * Pull `active` flag down to the `AbstractEndpoint`
* Set `active = true` in the `start()` before calling `doStart()`
* Do same for `active = false` in the `stop()`
* Clean up `AbstractEndpoint` impls to not call `doStart/doStop` for nothing
* Refactor endpoints to rely on the `active` state from the `AbstractEndpoint`
not their own
2020-11-06 13:51:03 -05:00
Artem Bilan
c7ff99a4e8 Use LogAccessor from SF
* Change main classes to use a `LogAccessor` API to simplify code flow
* Fix tests according `LogAccessor` property
* Fix some Sonar smells
2020-10-06 13:56:50 -04:00
Artem Bilan
fcf7f761a5 Enable STOMP test back to check the solution
* Remove more `ManageableSmartLifecycle` from non-channel adapter components
2020-08-09 08:11:15 -04:00
Gary Russell
1beb854fb4 Remove Legacy Metrics
- Simplify MBeans - instead of wrapping to expose lifecycle methods,
  implement `ManageableLifecycle`. Register an additional MBean for
  polled endpoints to control the lifecycle.

* Polishing

- Move `QueueChannel` `@ManagedAttribute`s to `QueueChannelOperations`
- Make all `AbstractEndpoints` `IntegrationManagedResource`s and remove `ManagedEndpoint`
  to allow exposure of any `@Managed*` methods (including those on `Pausable`)
- Revert to `Lifecycle` for classes that are not related to endpoints
- Remove legacy metrics from docs
2020-08-07 12:56:57 -04:00
Artem Bilan
8f92bb26d3 Start version 5.4
* Fix compatibility after upgrading to some latest dependencies
2020-05-19 12:47:30 -04:00
Artem Bilan
5ac262f866 GH-3132: Remove usage of super();
Fixes https://github.com/spring-projects/spring-integration/issues/3132

It turns out that Checkstyle EmptyBlock doesn't complain about
empty default ctor.
Plus a new check for `super();` call treats it as a violation

* Remove `super();` from all the no-arg ctors
* Code style clean up in the affected classes according
IDEA suggestions

* Fix new Sonar smells
2019-12-27 15:13:00 -05:00
Artem Bilan
9dc3519f20 Start version 5.3
* Move `What's New` into `changes-5.1-5.2.adoc`
* Remove version from the `XSD` files:
 1. Align with SF
 2. The version for XSD doesn't matter for the current jar version,
 since only the version is available in classpath is from the current
 jar version
 3. Modify `spring.schemas` to map all the possible versions for XSD
 into the current one in a jar.
 This way target applications can upgrade without changing the version
 for XSD location and we don't need to require `versionless` variant
 any more
 4. The jar in classpath can handle only its own XSD, so independently
 of version or no-version variants we still may fail because the current
 jar may not support end-user code any more - need some fix over there
 anyway.
* Remove `checkTestConfigs` Gradle task since we don't worry about XSD
version any more
* Modify `schemaZip` Gradle task to populate XSDs into a distribution
still with a version to avoid overriding on-line XSDs for version `1.0.x`.
We may consider not do that since SF doesn't and just bite a bullet
for always overriding those on-line XSDs to the actual one from the latest
release.
2019-12-26 15:41:19 -05:00
Artem Bilan
80d679a9b0 GH-2748: More bean definitions into exceptions
Fixes https://github.com/spring-projects/spring-integration/issues/2748

* Refactor more `MessageHandlingException`s to include `this` into an
exception message
* Revert using `MessagingException` in some places which really are not
about messaging.
This helps to wrap them into `MessageHandlingException` later in the
`MessageHandler` for the `BeanDefinition` reference
* Remove `volatile` from configuration properties in the affected
classes
* Remove already deprecated `JmsOutboundGateway.setPriority()`
* Add `resource` and `source` for `BeanDefinition` in the
`AbstractChannelAdapterParser` & `AbstractInboundGatewayParser`
* Document the feature
2019-07-23 15:19:56 -04:00
Artem Bilan
c109e1df34 GH-2987: Add HTTPS entries into spring.schemas
Fixes https://github.com/spring-projects/spring-integration/issues/2987

To resolve XSD files properly from the classpath, their HTTPS reference
must be present in the `spring.schemas` to avoid the Internet interaction
for resolving an XSD file

**Cherry-pick to 5.1.x, 5.0.x & 4.3.x**
2019-07-18 14:05:18 -04:00
Artem Bilan
315f0e711f Fix Sonar vulnerabilities for varargs
* Fix smell for static `AmqpInboundGateway.attributesHolder`

* Fix readOnlyHeaders in the `MessageBuilder`
2019-05-30 15:41:53 -04:00
Artem Bilan
65c884cec7 Enable nohttp Gradle plugin
* Add `io.spring.nohttp` Gradle plugin into the build script and allow
it only on CI server, since it is going to parse every file
* Fix tests do not use `http` any more
* Fix `test.html` in the `mail` modules tests to exclude a Namespace for
OExchange XRD protocol
* Fix some files for new line in the end of file according Checkstyle
violations
2019-05-30 09:32:26 -04:00
Artem Bilan
d21e8f0349 URL Cleanup
This commit updates URLs to prefer the https protocol.
Redirects are not followed to avoid accidentally expanding intentionally
shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status.
While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 2638 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-21 19:22:26 -04:00
Artem Bilan
20e8f0af2f Fix HTTP urls to HTTPS
* Do not fix urls for the `http://apache.org/xml/features` when we
configure XML components
* Do not fix urls for localhost and fake links in tests
* Fix all the dead links in docs
2019-03-21 17:16:30 -04:00
Artem Bilan
c9e5f99de5 Fix tests according HTTPS for origin urls 2019-03-20 11:24:44 -04:00
Spring Operator
fd30d1b48b URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://foo.com (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com) result SSLHandshakeException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://diveintomark.org/ (302) with 1 occurrences migrated to:
  /ZKSXZ/ ([https](https://diveintomark.org/) result IllegalArgumentException).
* http://foo.bar.com (UnknownHostException) with 1 occurrences migrated to:
  https://foo.bar.com ([https](https://foo.bar.com) result UnknownHostException).
* http://site1.com,http://site2.com (UnknownHostException) with 1 occurrences migrated to:
  https://site1.com,http://site2.com ([https](https://site1.com,https://site2.com) result UnknownHostException).
* http://example.org/2005/04/02/atom (404) with 1 occurrences migrated to:
  https://example.org/2005/04/02/atom ([https](https://example.org/2005/04/02/atom) result 404).
* http://example.org/audio/ph34r_my_podcast.mp3 (404) with 1 occurrences migrated to:
  https://example.org/audio/ph34r_my_podcast.mp3 ([https](https://example.org/audio/ph34r_my_podcast.mp3) result 404).
* http://example.org/feed.atom (404) with 1 occurrences migrated to:
  https://example.org/feed.atom ([https](https://example.org/feed.atom) result 404).
* http://www.puppycrawl.com/dtds/configuration_1_2.dtd (404) with 1 occurrences migrated to:
  https://www.puppycrawl.com/dtds/configuration_1_2.dtd ([https](https://www.puppycrawl.com/dtds/configuration_1_2.dtd) result 404).
* http://www.puppycrawl.com/dtds/suppressions_1_1.dtd (404) with 1 occurrences migrated to:
  https://www.puppycrawl.com/dtds/suppressions_1_1.dtd ([https](https://www.puppycrawl.com/dtds/suppressions_1_1.dtd) result 404).
* http://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd (404) with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd ([https](https://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd) result 404).
* http://www.springframework.org/schema/integration/spring-integration-ws.xsd (404) with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/spring-integration-ws.xsd ([https](https://www.springframework.org/schema/integration/spring-integration-ws.xsd) result 404).
* http://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd (404) with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd ([https](https://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://example.org with 22 occurrences migrated to:
  https://example.org ([https](https://example.org) result 200).
* http://example.org/ with 2 occurrences migrated to:
  https://example.org/ ([https](https://example.org/) result 200).
* http://feeds.bbci.co.uk/news/rss.xml with 1 occurrences migrated to:
  https://feeds.bbci.co.uk/news/rss.xml ([https](https://feeds.bbci.co.uk/news/rss.xml) result 200).
* http://www.example.com/ with 1 occurrences migrated to:
  https://www.example.com/ ([https](https://www.example.com/) result 200).
* http://www.springframework.org/schema/aop/spring-aop.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/aop/spring-aop.xsd ([https](https://www.springframework.org/schema/aop/spring-aop.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans.xsd with 813 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context.xsd with 122 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context.xsd ([https](https://www.springframework.org/schema/context/spring-context.xsd) result 200).
* http://www.springframework.org/schema/data/jpa/spring-jpa.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/data/jpa/spring-jpa.xsd ([https](https://www.springframework.org/schema/data/jpa/spring-jpa.xsd) result 200).
* http://www.springframework.org/schema/data/mongo/spring-mongo.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/data/mongo/spring-mongo.xsd ([https](https://www.springframework.org/schema/data/mongo/spring-mongo.xsd) result 200).
* http://www.springframework.org/schema/geode/spring-geode.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/geode/spring-geode.xsd ([https](https://www.springframework.org/schema/geode/spring-geode.xsd) result 200).
* http://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd ([https](https://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd) result 200).
* http://www.springframework.org/schema/integration/event/spring-integration-event.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/event/spring-integration-event.xsd ([https](https://www.springframework.org/schema/integration/event/spring-integration-event.xsd) result 200).
* http://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd ([https](https://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd) result 200).
* http://www.springframework.org/schema/integration/file/spring-integration-file.xsd with 27 occurrences migrated to:
  https://www.springframework.org/schema/integration/file/spring-integration-file.xsd ([https](https://www.springframework.org/schema/integration/file/spring-integration-file.xsd) result 200).
* http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd with 15 occurrences migrated to:
  https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd ([https](https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd) result 200).
* http://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd with 6 occurrences migrated to:
  https://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd ([https](https://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd) result 200).
* http://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd with 11 occurrences migrated to:
  https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd ([https](https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd) result 200).
* http://www.springframework.org/schema/integration/http/spring-integration-http.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/integration/http/spring-integration-http.xsd ([https](https://www.springframework.org/schema/integration/http/spring-integration-http.xsd) result 200).
* http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd with 27 occurrences migrated to:
  https://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd ([https](https://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd) result 200).
* http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd with 47 occurrences migrated to:
  https://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd ([https](https://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd) result 200).
* http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd with 93 occurrences migrated to:
  https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd ([https](https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd) result 200).
* http://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd with 32 occurrences migrated to:
  https://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd ([https](https://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd) result 200).
* http://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd with 11 occurrences migrated to:
  https://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd ([https](https://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd) result 200).
* http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd ([https](https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd) result 200).
* http://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd with 17 occurrences migrated to:
  https://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd ([https](https://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd) result 200).
* http://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd ([https](https://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd) result 200).
* http://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd with 17 occurrences migrated to:
  https://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd ([https](https://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd) result 200).
* http://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd ([https](https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd) result 200).
* http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd ([https](https://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd) result 200).
* http://www.springframework.org/schema/integration/security/spring-integration-security.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/integration/security/spring-integration-security.xsd ([https](https://www.springframework.org/schema/integration/security/spring-integration-security.xsd) result 200).
* http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd ([https](https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd) result 200).
* http://www.springframework.org/schema/integration/spring-integration.xsd with 731 occurrences migrated to:
  https://www.springframework.org/schema/integration/spring-integration.xsd ([https](https://www.springframework.org/schema/integration/spring-integration.xsd) result 200).
* http://www.springframework.org/schema/integration/stomp/spring-integration-stomp.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/stomp/spring-integration-stomp.xsd ([https](https://www.springframework.org/schema/integration/stomp/spring-integration-stomp.xsd) result 200).
* http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd with 17 occurrences migrated to:
  https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd ([https](https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd) result 200).
* http://www.springframework.org/schema/integration/syslog/spring-integration-syslog.xsd with 5 occurrences migrated to:
  https://www.springframework.org/schema/integration/syslog/spring-integration-syslog.xsd ([https](https://www.springframework.org/schema/integration/syslog/spring-integration-syslog.xsd) result 200).
* http://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd ([https](https://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd) result 200).
* http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd with 10 occurrences migrated to:
  https://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd ([https](https://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd) result 200).
* http://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd ([https](https://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd) result 200).
* http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd ([https](https://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd) result 200).
* http://www.springframework.org/schema/integration/zookeeper/spring-integration-zookeeper.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/zookeeper/spring-integration-zookeeper.xsd ([https](https://www.springframework.org/schema/integration/zookeeper/spring-integration-zookeeper.xsd) result 200).
* http://www.springframework.org/schema/jdbc/spring-jdbc.xsd with 52 occurrences migrated to:
  https://www.springframework.org/schema/jdbc/spring-jdbc.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc.xsd) result 200).
* http://www.springframework.org/schema/jms/spring-jms.xsd with 7 occurrences migrated to:
  https://www.springframework.org/schema/jms/spring-jms.xsd ([https](https://www.springframework.org/schema/jms/spring-jms.xsd) result 200).
* http://www.springframework.org/schema/lang/spring-lang.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang.xsd ([https](https://www.springframework.org/schema/lang/spring-lang.xsd) result 200).
* http://www.springframework.org/schema/mvc/spring-mvc.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/mvc/spring-mvc.xsd ([https](https://www.springframework.org/schema/mvc/spring-mvc.xsd) result 200).
* http://www.springframework.org/schema/rabbit/spring-rabbit.xsd with 9 occurrences migrated to:
  https://www.springframework.org/schema/rabbit/spring-rabbit.xsd ([https](https://www.springframework.org/schema/rabbit/spring-rabbit.xsd) result 200).
* http://www.springframework.org/schema/security/spring-security.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/security/spring-security.xsd ([https](https://www.springframework.org/schema/security/spring-security.xsd) result 200).
* http://www.springframework.org/schema/task/spring-task.xsd with 44 occurrences migrated to:
  https://www.springframework.org/schema/task/spring-task.xsd ([https](https://www.springframework.org/schema/task/spring-task.xsd) result 200).
* http://www.springframework.org/schema/tool/spring-tool.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/tool/spring-tool.xsd ([https](https://www.springframework.org/schema/tool/spring-tool.xsd) result 200).
* http://www.springframework.org/schema/tx/spring-tx.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/tx/spring-tx.xsd ([https](https://www.springframework.org/schema/tx/spring-tx.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util.xsd with 92 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util.xsd ([https](https://www.springframework.org/schema/util/spring-util.xsd) result 200).
* http://www.springframework.org/schema/websocket/spring-websocket.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/websocket/spring-websocket.xsd ([https](https://www.springframework.org/schema/websocket/spring-websocket.xsd) result 200).
* http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd with 1 occurrences migrated to:
  https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd ([https](https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd) result 302).

# Ignored
These URLs were intentionally ignored.

* http://java.sun.com/xml/ns/persistence with 2 occurrences
* http://localhost with 1 occurrences
* http://localhost/ with 1 occurrences
* http://localhost/test1 with 25 occurrences
* http://localhost/test1/%2f with 1 occurrences
* http://localhost/test2 with 2 occurrences
* http://localhost/test2/ with 1 occurrences
* http://localhost:18080/it/ with 3 occurrences
* http://localhost:51235/%2f/testApps?param= with 1 occurrences
* http://test with 1 occurrences
* http://test.example.org with 1 occurrences
* http://test.org with 1 occurrences
* http://testServer/test with 1 occurrences
* http://testServer/testmp with 1 occurrences
* http://www.springframework.org/schema/aop with 25 occurrences
* http://www.springframework.org/schema/beans with 1633 occurrences
* http://www.springframework.org/schema/c with 1 occurrences
* http://www.springframework.org/schema/context with 244 occurrences
* http://www.springframework.org/schema/data/jpa with 3 occurrences
* http://www.springframework.org/schema/data/mongo with 36 occurrences
* http://www.springframework.org/schema/geode with 8 occurrences
* http://www.springframework.org/schema/integration with 1465 occurrences
* http://www.springframework.org/schema/integration/amqp with 28 occurrences
* http://www.springframework.org/schema/integration/event with 8 occurrences
* http://www.springframework.org/schema/integration/feed with 8 occurrences
* http://www.springframework.org/schema/integration/file with 54 occurrences
* http://www.springframework.org/schema/integration/ftp with 30 occurrences
* http://www.springframework.org/schema/integration/gemfire with 12 occurrences
* http://www.springframework.org/schema/integration/groovy with 27 occurrences
* http://www.springframework.org/schema/integration/http with 36 occurrences
* http://www.springframework.org/schema/integration/ip with 54 occurrences
* http://www.springframework.org/schema/integration/jdbc with 94 occurrences
* http://www.springframework.org/schema/integration/jms with 186 occurrences
* http://www.springframework.org/schema/integration/jmx with 64 occurrences
* http://www.springframework.org/schema/integration/jpa with 22 occurrences
* http://www.springframework.org/schema/integration/jsr223 with 2 occurrences
* http://www.springframework.org/schema/integration/mail with 36 occurrences
* http://www.springframework.org/schema/integration/mongodb with 34 occurrences
* http://www.springframework.org/schema/integration/mqtt with 8 occurrences
* http://www.springframework.org/schema/integration/redis with 34 occurrences
* http://www.springframework.org/schema/integration/rmi with 8 occurrences
* http://www.springframework.org/schema/integration/scripting with 28 occurrences
* http://www.springframework.org/schema/integration/security with 6 occurrences
* http://www.springframework.org/schema/integration/sftp with 36 occurrences
* http://www.springframework.org/schema/integration/stomp with 2 occurrences
* http://www.springframework.org/schema/integration/stream with 34 occurrences
* http://www.springframework.org/schema/integration/syslog with 10 occurrences
* http://www.springframework.org/schema/integration/webflux with 8 occurrences
* http://www.springframework.org/schema/integration/websocket with 2 occurrences
* http://www.springframework.org/schema/integration/ws with 22 occurrences
* http://www.springframework.org/schema/integration/xml with 24 occurrences
* http://www.springframework.org/schema/integration/xmpp with 28 occurrences
* http://www.springframework.org/schema/integration/zookeeper with 2 occurrences
* http://www.springframework.org/schema/jdbc with 104 occurrences
* http://www.springframework.org/schema/jms with 13 occurrences
* http://www.springframework.org/schema/lang with 8 occurrences
* http://www.springframework.org/schema/mvc with 2 occurrences
* http://www.springframework.org/schema/p with 19 occurrences
* http://www.springframework.org/schema/rabbit with 18 occurrences
* http://www.springframework.org/schema/security with 4 occurrences
* http://www.springframework.org/schema/task with 88 occurrences
* http://www.springframework.org/schema/tool with 8 occurrences
* http://www.springframework.org/schema/tx with 28 occurrences
* http://www.springframework.org/schema/util with 184 occurrences
* http://www.springframework.org/schema/websocket with 2 occurrences
* http://www.w3.org/1999/xhtml with 1 occurrences
* http://www.w3.org/2001/XMLSchema with 1 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 814 occurrences
* http://www.w3.org/2005/Atom with 1 occurrences

* Use the latest Checkstyle DTDs with their HTTPS variants
2019-03-20 10:39:37 -04:00
Gary Russell
b187bca36e Avoid throws Exception where possible - Phase I
* Polishing - PR Comments
2019-03-07 12:53:52 -05:00
Artem Bilan
221393e02f MessageHandlingException consistency
* Use `IntegrationUtils.wrapInHandlingExceptionIfNecessary()` whenever
it is possible to avoid double wrapping into the `MessageHandlingException`
* Some code polishing for affected classes `@Nullable`, streams, diamonds etc.
2019-02-22 09:43:59 -05:00
Artem Bilan
7e3b56939e Fix XSDs for actual core schema version 2019-02-21 12:43:21 -05:00
Artem Bilan
622d42c71a Migrate tests to AssertJ
Mostly thanks to IDEA's plugin: https://plugins.jetbrains.com/plugin/10345-assertions2assertj
There is still a lot of work to do when complex and composite matchers are used.

* Add `awaitility` dependency and deprecate `EventuallyMatcher` in favor
of `awaitility`
* Remove Hamcrest from dependencies and disable JUnit & Hamcrest
static imports to encourage to use only AssertJ
* Migrate JUnit assumptions in rules to AssertJ's assumptions
* Deprecate some custom matchers in favor of existing in Hamcrest
after upgrading the last to version `2.1`
* Replace `ExpectedException` rules with `assertThatThrownBy()`
* Mention `MessagePredicate` in the `testing.adoc`
2019-02-21 10:20:45 -05:00
Gary Russell
520ebbbd2c Move master to 5.2 2019-02-15 12:01:24 -05:00
Artem Bilan
5c46efe067 Fix Sonar smells for websocket module
* Introduce `JavaUtils` for chaining properties setting
* Fix method complexity in the `ServerWebSocketContainer` using newly
introduced `JavaUtils`
* Make `JavaUtils` as `final`
2019-02-11 14:17:49 -05:00
Gary Russell
1bafe89d49 Sonar Fixes
- avoid parameter assignments
2019-01-07 11:35:58 -05:00
Gary Russell
113a371f2c Remove Exception from IOS.onInit() 2018-12-22 17:25:56 -05:00
Artem Bilan
81b4ea1bef Sonar fixes according latest report (#2676)
* Sonar fixes according latest report

* Fix initialization order in the `GatewayMethodInboundMessageMapper`

* Fix mock in the `DelegatingSessionFactoryTests`

* Fix `AbstractRemoteFileOutboundGateway.listFilesInRemoteDir`

* * PR comments

* * Fix `AbstractRemoteFileOutboundGateway.listFilesInRemoteDir` complexity
2018-12-22 11:57:35 -05:00
Artem Bilan
93d7c58b64 Enable ModifierOrderCheck Checkstyle rule (#2673)
* Enable ModifierOrderCheck Checkstyle rule

* Fix violations for `static` and `abstract` modifier
* Remove redundant code in the `TcpNioConnection`
* Mark `connectionFactoryName` as `@Nullable` in the `TcpConnectionSupport`
ctor and its inheritors
* Fix some smells according IDEA suggestions in the affected classes
* This should fix some Sonar smells as well

* * Fix `HeaderMapperTests`

* * Polishing `TcpConnection` code style and fix Javdocs
2018-12-20 19:19:47 -05:00
Artem Bilan
8ce8bf9d73 Fix code smell in websocket and webflux modules (#2669)
* * Fix code smell in websocket and webflux modules

* * More fixes

* * Fix NPE in the `IntegrationHandlerResultHandler`
2018-12-19 12:33:47 -05:00
Artem Bilan
b931112776 Upgrades to the latest dependencies and fixes
* Spring AMQP 2.1 B-S and fix imports for moved classes
* Reactor GA
* SF-5.1 B-S and exclude `org.springframework` from all the
Spring Security dependencies
* the latest Hibernate and JPA and fix the test query for the
appropriate actual syntax
* latest SSHD and add required dependency for `sshd-sftp`
* latest Groovy and extra dependency for the `groovy-dateutil`
* latest Smack for XMPP and appropriate code fixes for compatibility
* Fix `StompIntegrationTests` to use `AFTER_EACH_TEST_METHOD`:
when session is disconnected on the server, we can't interact with it
anymore
2018-09-20 15:01:10 -04:00
Artem Bilan
a7ffbde07f Fix WebSocketInChA according latest SF
* The `SimpleBrokerMessageHandler` has been fixed the way it consults
a `session` store for sending reply.
The session can be added to that store only when we send a `CONNECT`
command.
Fix `WebSocketInboundChannelAdapter` to send additional `CONNECT` message
in the `afterSessionStarted()` and when selected `SubProtocolHandler` is
a `StompSubProtocolHandler`
* Add extract check into the `StompIntegrationTests` for events: now
we also get a `SessionConnectedEvent` as well
* Fix typo in the `index-docinfo.xml`
2018-07-24 14:59:39 -04:00
Artem Bilan
eb1efdb0ff No JSONP WebSocket transport any more
https://build.spring.io/browse/INT-MASTER-1070/

See: https://jira.spring.io/browse/SPR-16914
2018-06-11 17:11:53 -04:00
Gary Russell
324c54d8ef Remove use of deprecated ChannelInterceptorAdapter
Deprecated in favor of default methods on `ChannelInterceptor`.

* Fix race in RouterConcurrencyTest; no assertion on executor shutdown; increase time.
2018-05-24 15:11:11 -04:00
Artem Bilan
8a61e16413 Increase response timeout for WebSocketClientTests 2018-05-21 15:22:04 -04:00
Artem Bilan
027021d6e4 Move XSDs to version 5.1
* Upgrade to Spring AMQP-2.1 and fix compatibility
2018-03-17 09:58:40 -04:00
Artem Bilan
aca79f842d Fix deprecation from SF-5.0.3
* Upgrade to Spring Data Key SR3, Reactor-3.1.3, Reactor Netty-0.7.3
2018-01-24 11:13:01 -05:00
Artem Bilan
30450c48be INT-4376: Upgage to Log4J 2 (#2321)
* INT-4376: Upgage to Log4J 2

JIRA: https://jira.spring.io/browse/INT-4376

* Deprecate Log4J 1.x components in favor of newly added
a `Log4j2LevelAdjuster` JUnit `@Rule`
* Update all the logging configuration to Log4J 2

* Polishing after testing
2018-01-11 10:59:55 -05:00
Artem Bilan
6891d5a2e2 INT-4277: Add Java DSL chapter to the Docs
JIRA: https://jira.spring.io/browse/INT-4277

*Mostly migration from the https://github.com/spring-projects/spring-integration-java-dsl/wiki/Spring-Integration-Java-DSL-Reference
* Add cross links from some appropriate chapters
* Fix log message in the `WebSocketInboundChannelAdapter`

* Document `IntegrationFlowContext`
* Document gateways via `IntegrationFlow`
2017-11-10 11:31:48 -05:00
Artem Bilan
8766262399 INT-4360: Add ClientStompEncoder support
The `StompSubProtocolHandler` explicitly sets `stompCommand` header
to the `MESSAGE` value ignoring any client inputs.
In this case the message is treated as from the server and ignored on
the STOMP Broker side from the client session.

* Introduce `ClientStompEncoder` for the client side to be injected
into the `StompSubProtocolHandler` for the proper client side messages
encoding/decoding.
Override `stompCommand` header to the `SEND` value if it is `MESSAGE`
before encoding to the `byte[]` to send to the session

JIRA: https://jira.spring.io/browse/INT-4360

**Cherry-pick to 4.3.x**

Fix WebSocket test to rely on the proper client config class
and don't pick up the server config unconditionally in the test context
2017-10-31 09:25:52 -04:00
Artem Bilan
bf1fef39db INT-4345: ServerWebSocketContainer: Fix Lifecycle
JIRA: https://jira.spring.io/browse/INT-4345

Resolves https://github.com/spring-projects/spring-integration/issues/2238

The `DefaultHandshakeHandler` doesn't implement `SmartLifecycle`
(just `Lifecycle`) there it doesn't delegate its `start()` to the
`RequestUpgradeStrategy`, e.g. `JettyRequestUpgradeStrategy`.
On the other hand `DefaultHandshakeHandler` can be started as a dependant
`Lifecycle` from some other `SmartLifecycle`, like it happens with the
`WebSocketHandlerMapping`

* Implement `SmartLifecycle` for the `ServerWebSocketContainer` and
delegate its lifecycle to the provided `HandshakeHandler`
* Fix `WebSocketInboundChannelAdapter` to properly implement `doStop()`
with the propagation to the provided `webSocketContainer`
* Fix deprecation warning in the `StompMessageHandlerWebSocketIntegrationTests`

**Cherry-pick to 4.3.x**
2017-10-16 17:28:55 -04:00
Artem Bilan
fabc5fb725 Fix STOMP and WebSocket modules to the latest SF
* The `@MessageMapping` now requires `@SendTo` for replies
even if we are going to send to the default topic
* Fix assertion for exception message in the `StompInboundChannelAdapterWebSocketIntegrationTests`
2017-06-07 15:26:55 -04:00
Artem Bilan
709cb7fe4c Remove Jackson Imports from JacksonJsonUtils
Since the classes load their imports explicitly we can't use them for
classes which provides utilities to check classpath

* Move imports to fully qualified names in the target utility method

**Cherry-pick to 4.3.x**

Move `JacksonJsonUtils.isPresent` methods to separate `JacksonPresent` class

Polishing
2017-05-11 15:39:47 -04:00