Build: #1408 was successful Scheduled with changes by Alexander Pinske <[email protected]> and Artem Bilan

Code commits

Plan Repository

  • Alexander Pinske <alex@pinske.eu>

    Alexander Pinske <[email protected]> 07a6fb3a9a2215058f39737e7ffffdfdbef69d2f

    Fix IMAP race condition around idle()
    `IMAPFolder.idle()` by default keeps idle-ing after each response.
    We don't need that, because we want to fetch the new mails immediately (over the same connection).
    To make `idle()` not keep on going, we called
    `folder.isOpen()` which in most cases makes `idle()` stop by calling `noop()`
    internally (to keep the connection alive) which leads to the current
    `idle()`-call being canceled.

    The problem this commits addresses is that the call to `noop()` only
    happens if there were no calls in the last second.
    There is a check for that in `com.sun.mail.imap.IMAPFolder.keepConnectionAlive`.
    So if a new message appears less then a second after idle started, we will miss it.

    This new way interrupts `idle()` more often than before, e.g. when there
    is an expunge-message (i.e. a message was deleted), which we don't care about.
    But the subsequent `receive()` in IdleTask will simply get no
    messages and then turn around and start idle-ing again.

    **Cherry-pick to `5.3.x` & `master`**

    • spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java (version 07a6fb3a9a2215058f39737e7ffffdfdbef69d2f)
    • spring-integration-mail/src/test/java/org/springframework/integration/mail/ImapMailReceiverTests.java (version 07a6fb3a9a2215058f39737e7ffffdfdbef69d2f)
  • Artem Bilan

    Artem Bilan 3f0c57894b085398bcbc02278a764b8d2eb4158d

    GH-3502: More refactoring to avoid reflection (#3532)
    * GH-3502: More refactoring to avoid reflection

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

    * Move `ChannelInitializer` bean registration into an `AbstractIntegrationNamespaceHandler` -
    it was never used for annotations and Java DSL...
    * Rework `IntegrationFlows.fromSupplier()` to call a provided `Supplier` directly -
    not via reflection in the `MethodInvokingMessageSource`
    * Resolve new Sonar smells
    * Rework `EndpointSpec` to accept an expected factory bean instance via ctor arg
    instead of reflection
    * Rework `Jackson2JsonObjectMapper` to use well-known module instances directly -
    not via reflection from their class names

    * * Revert `DefaultMethodInvokingMethodInterceptor.methodHandleCache` property definition wrap

    • build.gradle (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/config/ChannelInitializer.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/config/DefaultConfiguringBeanFactoryPostProcessor.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/config/GlobalChannelInterceptorInitializer.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationConfigUtils.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationRegistrar.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/config/PublisherRegistrar.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractIntegrationNamespaceHandler.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/config/xml/AnnotationConfigParser.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/dsl/ConsumerEndpointSpec.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/dsl/EndpointSpec.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlows.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/dsl/SourcePollingChannelAdapterSpec.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/dsl/context/DslIntegrationConfigurationInitializer.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/gateway/DefaultMethodInvokingMethodInterceptor.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/json/JsonNodeWrapperToJsonNodeConverter.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/main/java/org/springframework/integration/support/json/Jackson2JsonObjectMapper.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests-context.xml (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)
    • spring-integration-http/src/main/java/org/springframework/integration/http/dsl/BaseHttpMessageHandlerSpec.java (version 3f0c57894b085398bcbc02278a764b8d2eb4158d)