Commit Graph

2224 Commits

Author SHA1 Message Date
Artem Bilan
6eeec50b4a INT-4572: Add MessageProducer.setOutputChannelName
JIRA: https://jira.spring.io/browse/INT-4572

* Add `setOutputChannelName()` contract into the `MessageProducer`
to avoid proxy unwrapping and casting to the `MessageProducerSupport`
2019-01-08 16:32:10 -05:00
Gary Russell
1bafe89d49 Sonar Fixes
- avoid parameter assignments
2019-01-07 11:35:58 -05:00
Gary Russell
e8df546b04 Sonar Fixes - Javadoc-only imports 2019-01-02 12:26:22 -05:00
Artem Bilan
a39881fd0d Fix new issues in Sonar
* Use properly `IntegrationObjectSupport.extractTypeIfPossible()`
2018-12-23 11:48:33 -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
Gary Russell
a01d09f0f1 Sonar Fixes
Final critical smells.
2018-12-20 11:58:32 -05:00
Gary Russell
7790f9e550 Sonar fixes
Critical issues `o.s.i.t*`, `o.s.i.u*`.

* Polishing - PR Comments.
2018-12-19 14:49:27 -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
Gary Russell
e8bd31cc37 Sonar fixes
Critical smells `0.s.i.r*`

* Polishing - PR Comments.
2018-12-19 09:47:57 -05:00
Artem Bilan
12dd73d219 Fix code smell for PayloadTypeConvertTransformers 2018-12-18 15:27:34 -05:00
Artem Bilan
3dd8b63576 INT-4569: Disallow beans override in DSL (#2664)
* INT-4569: Disallow beans override in DSL

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

* Thorw `BeanDefinitionOverrideException` from the
`IntegrationFlowBeanPostProcessor` when it detects existing bean and it
is not the same object we try to register from the DSL
* Document limitations about `prototype` beans
* Some polishing in the DSL chapter of the docs

* * Fix algorithm in the `IntegrationFlowBeanPostProcessor.noBeanPresentForComponent()`

* * Polishing dsl.adoc
* Call `BeanFactory.initializeBean()` for existing beans if they are
`prototype`

* * Code formatting in the `ManualFlowTests`
2018-12-18 14:22:17 -05:00
Gary Russell
65df35bfd1 Sonar fixes
Critical smells `o.s.i.m*`.
2018-12-18 13:28:59 -05:00
Gary Russell
7efe79f457 Sonar fixes
Critical issues for `o.s.i.j*` (except `jdbc`).
2018-12-14 16:12:04 -05:00
Gary Russell
3f522f7efe Fix "new" Sonar issues
Reported as new due to touched source file.
2018-12-13 23:21:42 -05:00
Artem Bilan
d7356aa85d Use Context CL wherever it is applicable (#2656)
* Use Context CL wherever it is applicable

* Use `ClassUtils.getDefaultClassLoader()` in the `IntegrationManagementConfigurer`
for checking a Micrometer presence from the `afterSingletonsInstantiated()`
* Use `ClassUtils.getDefaultClassLoader()` in the `ScatterGatherHandler`
to load required class
* Refactor `HeaderEnricherParserSupport` do not use CL at all.
The `TypedStringValue` will resolve a target type later by the
`BeanFactory`.
This way we honor a property placeholder behavior for the `type` XML
attribute

* * Use `ClassUtils.getDefaultClassLoader()` in the ScatterGatherHandler ctor
2018-12-13 16:14:37 -05:00
Gary Russell
563f526ddc Sonar Fixes
Critical smells for packages `o.s.i.i*`.

* Polishing

* Polishing

* Missed saving a file.

* Polishing - PR Comments

* More PR comments.
2018-12-07 14:59:27 -05:00
Gary Russell
4760c54097 Sonar Fixes
Critical smells `o.s.i.h*`.
2018-12-07 12:39:19 -05:00
Artem Bilan
536b6b1786 INT-4565: Fix IntComponentScan for profiles (#2652)
* INT-4565: Fix IntComponentScan for profiles

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

* Propagate an `Environment` to the internal `ClassPathScanningCandidateComponentProvider`
in the `IntegrationComponentScanRegistrar` for proper profiles activation
* Ensure the logic works in the `GatewayInterfaceTests`
* Some polishing and performance improvement for the `GatewayInterfaceTests`
* Add a note about `@Profile` in the `gateway.adoc`
* Polishing for the `gateway.adoc`

**Cherry-pick to 5.0.x & 4.3.x**

* * Add not activated by profile gateway interface into the `GatewayInterfaceTests`
* More `GatewayInterfaceTests` polishing
* Fix typo in the `gateway.adoc`

* Fix Checkstyle violation
2018-12-06 15:41:40 -05:00
Gary Russell
2cde493fbf Sonar Fixes
Packages `o.s.i.g*`

* Polishing - PR comments
2018-12-06 15:23:54 -05:00
Gary Russell
9832f61d2a INT-4564: ACMH: Fix erroneous error log
JIRA: https://jira.spring.io/browse/INT-4564

INT-4550 added an error log when multiple ACMHs were registered with the
same store; the error log logic was incorrect and the error was logged
when the first ACMH was registered.
2018-12-04 15:13:49 -05:00
Gary Russell
62fc7df693 Sonar Fixes
Critical smells, packages `o.s.i.a*` to `f*`.

Plus new smells caused by these changes.
2018-12-03 10:44:26 -05:00
Gary Russell
7135d0603c INT-4553: Store-backed QueueChannel improvements
JIRA: https://jira.spring.io/browse/INT-4553
Fixes https://github.com/spring-projects/spring-integration/issues/2628
Fixes https://github.com/spring-projects/spring-integration/issues/2629

- Avoid `size()` calls on the MGS, use `poll()` instead.
- Optimize the indexes for the `INT_CHANNEL_MESSAGE` table.

Avoid size call when no timeout too.

Polishing - PR Comments

Missed a doc fix

Another missed %PREFIX%

Fix underscores

Polishing; PR comments; make MGQ extendable.

Fix version in doc.

* Polishing `@since`
* Use diamonds whenever it is possible

**Cherry-pick to 5.0.x**
2018-11-30 13:07:59 -05:00
Gary Russell
f6e9e6649a Fix Resequencer test wait time
https://build.spring.io/browse/INT-MASTERSPRING40-534/

Since we are expecting a message, a large wait time is no detriment
to test runtime and provides a more reliable test on a busy CI server.
2018-11-24 11:11:35 -05:00
Gary Russell
c3f8c4af27 More Sonar resolutions 2018-11-20 14:15:59 -05:00
Gary Russell
aa8068a71b Sonar Address new issues in LambdaMessageProcessor 2018-11-20 11:27:18 -05:00
Gary Russell
c9ae6c794f Sonar: AMQP Fixes
- critical smells
- also import in IMHA

* Polishing
2018-11-20 09:38:15 -05:00
Gary Russell
0c33591676 Log error for class cast exception on lambda
**cherry-pick to 5.0.x**

* Fix test

* Polish log message.

* Polishing - docs and javadocs.
2018-11-19 16:56:35 -05:00
Artem Bilan
b3cf864675 Fix LambdaMessageProcessor for conversion
SO: https://stackoverflow.com/questions/53378821

There is no need to jump into the `MessageConverter` if payload type
is assignable to the target type
2018-11-19 13:39:36 -05:00
Artem Bilan
e9c554534a INT-4556: Fix messaging anns for FactoryBeans
JIRA: https://jira.spring.io/browse/INT-4556

We definitely need to resolve a `@Bean` method to the target object to
be sure do not create a new `MessageHandler` bean.

**Cherry-pick to 5.0.x**
2018-11-19 13:01:52 -05:00
Artem Bilan
5bf6161112 INT-4550: Disallow multi aggregators on same MGS (#2622)
* INT-4550: Disallow multi aggregators on same MGS

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

**Cherry-pick to 5.0.x**

* * Introduce `UniqueExpiryCallback`
* Use `UniqueExpiryCallback` in the `AbstractCorrelatingMessageHandler`
* Check for uniqueness in the `AbstractMessageGroupStore`
* Remove duplicate code in the `ConfigurableMongoDbMessageStore`

* * Fix tests according a new logic

* * Address PR review

* Change `Assert.isTrue` to the `logger.error` for backward compatibility
* Revert changes in tests since we don't throw exception anymore
* Fix language on doc

* * Fix Checkstyle violation in the `AbstractMessageGroupStore`

* * Ignore `testDontReapMessageOfOtherHandler()`
2018-11-15 14:56:14 -05:00
Artem Bilan
1dca553850 INT-4551: Fix exception msg from previous commit
JIRA: https://jira.spring.io/browse/INT-4551

**Cherry-pick to 5.0.x**
2018-11-08 14:52:58 -05:00
Artem Bilan
2d06169f25 INT-4551: Fail if old Java DSL jar is present
JIRA: https://jira.spring.io/browse/INT-4551

**Cherry-pick to 5.0.x**
2018-11-08 13:50:49 -05:00
Artem Bilan
648aeb8e96 Unable ImportOrder Checkstyle rule for tests
* Fix wrong import order in tests
* Polishing for not closed application contexts
* Use diamonds
* Use proper assertion operators
* Remove redundant classes
* Improve performance in JPA tests
* Fix typos
2018-11-07 15:32:31 -05:00
Gary Russell
6861a16b95 INT-4549: Avoiding Aggregator Deadlocks
JIRA: https://jira.spring.io/browse/INT-4549

Polishing - PR comments - avoid ThreadLocals

Fix javadoc

Polishing - discardMessage()

Polishing

5.1.1 only

* Fix typos and some polishing
2018-11-01 15:50:38 -04:00
Artem Bilan
85adea3eae Ignore time sensitive test for aggregator
https://build.spring.io/browse/INT-MASTERSPRING40-511

The `AbstractCorrelatingMessageHandlerTests.testScheduleRemoveAnEmptyGroupAfterConfiguredDelay()`
relies on the `handler.setMinimumTimeoutForEmptyGroups(100);` which may
happen in the scheduled thread before the main thread reaches an
assertion for size
2018-10-31 10:54:01 -04:00
Gary Russell
2b1976ce6f Core Sonar fixes
* Polishing according PR comments
2018-10-26 16:19:40 -04:00
Gary Russell
2b9ba714e6 JDBC, JMS, JPA Sonar fixes 2018-10-26 14:26:43 -04:00
Gary Russell
12bc24dd02 File, FTP, IP Sonar Fixes 2018-10-26 13:53:54 -04:00
Gary Russell
1555a13ee5 AMQP Sonar Fixes 2018-10-26 13:12:18 -04:00
Artem Bilan
7702a6f89e INT-3887: Add receiveTimeout into the @Poller
JIRA: https://jira.spring.io/browse/INT-3887
2018-10-25 17:05:24 -04:00
Artem Bilan
8305c6fec3 INT-4322: Log merged global properties on startup (#2612)
* INT-4322: Log merged global properties on startup

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

Now we have DEBUG message in logs like this:
```
Spring Integration global properties:

spring.integration.endpoints.noAutoStartup=fooService*
spring.integration.taskScheduler.poolSize=20
spring.integration.channels.maxUnicastSubscribers=0x7fffffff
spring.integration.channels.autoCreate=true
spring.integration.channels.maxBroadcastSubscribers=0x7fffffff
spring.integration.readOnly.headers=
spring.integration.messagingTemplate.throwExceptionOnLateReply=true
```

* Also register a `mergedIntegrationGlobalProperties` bean on a first
`IntegrationContextUtils.getIntegrationProperties()` call to avoid a
new `Properties` object on each call

* * Fix `TestUtils` to register a `BeanDefinition` instead of `registerSingleton()`
and an explicit `afterPropertiesSet()` call

* * Document mentioned changes
* Some polishing for `whats-new.adoc`
2018-10-25 15:30:32 -04:00
Artem Bilan
90ac259da7 INT-4520 Make IntegrationGraphServer customizable (#2608)
* INT-4520 Make IntegrationGraphServer customizable

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

* * Polishing according PR comments
2018-10-24 15:02:52 -04:00
Gary Russell
eed5fe7a88 Extensible MicrometerMetricsCaptor and polishing
- change `loadCaptor` to return any existing captor
- make builders and facades protected to allow subclassing
- change `AbstractMeter.getMeter()` to use generics
- add test case demonstrating meter name changes
- docs

* Polishing - PR Comments, and rebase
2018-10-22 19:58:54 -04:00
Artem Bilan
1d1abf257d Polishing for PollingLifecycleTests 2018-10-19 16:02:50 -04:00
Gary Russell
7aa8489279 Fix race in PollingLifecycleTests 2018-10-19 15:42:31 -04:00
Gary Russell
23ebe56838 INT-4530: Remove Meters
JIRA: https://jira.spring.io/browse/INT-4530

- implement `DisposableBean` in all meter-aware components
- remove meters in `destroy()`
- manually destroy annotation components created by `registerSingleton()`
  - changing these beans to register as bean definitions caused some subtle
    initialization side-effects; given we are post-RC, I felt it was too late
    to make such a large change
  - also CPXAC is not a `GenericApplicationContext`
  - hence a bean is registered to destroy them manually

* Rebase; Polishing - PR Comments
2018-10-19 15:00:04 -04:00
Artem Bilan
e3ce37ca36 INT-4544: Allow runtime MBeans (un)registered (#2601)
* INT-4544: Allow runtime MBeans (un)registered

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

* Fix `SourcePollingChannelAdapterFactoryBean` to register an
`outputChannelName` into the `SourcePollingChannelAdapter` for late
binding, especially in case of dynamic `IntegrationFlow` registrations.
This must be back-ported to `5.0.x`
* Implement `DestructionAwareBeanPostProcessor` in the
`IntegrationMBeanExporter` for the runtime beans tracking, e.g. via
dynamic `IntegrationFlow` registrations
* Refactor `IntegrationMBeanExporter` for static and dynamic beans
registration and destruction
* Remove unused properties; introduce some new for tracking beans and
their relationship

* * Move `IntegrationMBeanExporter.registerProducer()` after
`postProcessAfterInitialization()`
* Refactor JMX test configurations to reuse MBeanServer as much as
possible and destroy the server whenever it is necessary

* * More JMX tests polishing

* * And more JMX tests polishing

* * `try...catch` in the `IntegrationMBeanExporter.postProcessAfterInitialization()`
to avoid breaking changes for the current GA phase
* Do not unregister those MBeans explicitly which weren't created at
runtime

* * Log ObjectNames in the `MBeanExporterIntegrationTests`

* * Fix `MessageMetricsAdviceTests` to rely on the application context
* Do not use a cst in the `StandardIntegrationFlowContext` for
`BeanFactory`, but an explicit `BeanDefinitionRegistry`
* Extract targets from proxies in the
`IntegrationMBeanExporter.postProcessAfterInitialization()`
* Remove logging in the `MBeanExporterIntegrationTests`

* * Fix `NotificationListeningMessageProducerTests` to reuse existing `MBeanServer`

* * Change JMX `domain` in the `DslMBeanTests` to `dsl` do not clash with
similar in the `foo` in the `MessageSourceTests`
* Use `MBeanServer` bean in the `Int2307Tests`
* Use JUnit 5ctor injection injection in the `MessageMetricsAdviceTests`

* * Fix JMX tests do not reuse existing `MBeanServer` and make them rely
on the server provided by the managed `MBeanServerFactoryBean` which
destroys a server on application context close
* Fix `StoredProcJmxManagedBeanTests-context.xml` to use `MBeanServer`
from the `<context:mbean-server>`
2018-10-19 09:51:25 -04:00
Artem Bilan
40ba72b84a INT-4545: Fix RPMHWrapper registration for `@SA
JIRA: https://jira.spring.io/browse/INT-4545

Improve the logic in the `AbstractMethodAnnotationPostProcessor` to
check for existing `MessageHandler` and be sure that we need to register
a `ReplyProducingMessageHandlerWrapper` bean

**Cherry-pick to 5.0.x**
2018-10-19 09:10:47 -04:00