You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "allthingssecurity (via GitHub)" <gi...@apache.org> on 2026/10/04 00:09:24 UTC

[PR] CAMEL-25292: camel-plc4x - a stopped triggered consumer must stop its scraper, and the triggered consumer must start [camel]

allthingssecurity opened a new pull request, #27323:
URL: https://github.com/apache/camel/pull/27323

   # Description
   
   [CAMEL-25292](https://issues.apache.org/jira/browse/CAMEL-25292)
   
   `Plc4XConsumer` with a `trigger` created and started a `TriggeredScraperImpl` and a `TriggerCollectorImpl` in local variables, and `doStop` never stopped them: after the route was stopped the scraper kept reading the PLC and sending exchanges to the route, and after a restart the old and the new scraper both ran, so every triggered read was routed twice (once more per restart). The consumer also created its own `Executors.newSingleThreadScheduledExecutor()` per instance and never shut it down.
   
   The triggered consumer could not even start with camel-plc4x alone: the pom excludes `jackson-databind` from `plc4j-scraper`, which `ScraperConfigurationTriggeredImpl` needs (`NoClassDefFoundError: com/fasterxml/jackson/databind/exc/MismatchedInputException` in `doStart`). The existing `Plc4XConsumerTest.shouldStartTriggeredScraperWhenTriggerPresent` stubs `getTrigger()` after creating the consumer, so it runs the untriggered path and did not notice.
   
   This change keeps the scraper and the collector and stops them in `doStop`, creates the executor of the one-time read from the `ExecutorServiceManager` and shuts it down in `doStop`, and removes the `jackson-databind` exclusion (a compile dependency of `plc4j-scraper`; the exclusion came with the import of the component in 2022 without a comment; the version comes from Camel's Jackson BOM, 2.22.3 like jackson-core). Note: `TriggeredScraperImpl.stop()` cancels its tasks but does not shut down its own thread pools (PLC4X library).
   
   Tests:
   - `Plc4XConsumerStopTest` (new, scraper and collector replaced with Mockito `mockConstruction`): start and stop a triggered consumer; the scraper and the collector must be stopped.
   - On main it fails at start with the `NoClassDefFoundError`; with only the pom change it fails with `Wanted but not invoked: triggeredScraperImpl.stop()`.
   - With the change the module suite passes (18 tests).
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
     (I built and tested the affected module, including the formatter and import-sort plugins. I did not run the full root build.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used.
     This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer.
   
   _Claude Code on behalf of allthingssecurity_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25292: camel-plc4x - a stopped triggered consumer must stop its scraper, and the triggered consumer must start [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #27323:
URL: https://github.com/apache/camel/pull/27323


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25292: camel-plc4x - a stopped triggered consumer must stop its scraper, and the triggered consumer must start [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27323:
URL: https://github.com/apache/camel/pull/27323#issuecomment-5977469757

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `components/camel-plc4x`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 9 of 698 tested, 3 compile-only — current: 9 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **9 affected modules** (current approach: 9).
   
   **Skip-tests mode would test 9 modules** (1 direct + 0 downstream), **skip tests for 3** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (9)</summary>
   
   - `camel-jbang-mcp` ← depends on affected reactor module org.apache.camel:camel-yaml-dsl-validator
   - `camel-jbang-plugin-mcp` ← depends on affected reactor module org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-route-parser` ← depends on affected reactor module org.apache.camel:camel-route-parser
   - `camel-jbang-plugin-tui` ← depends on affected reactor module org.apache.camel:camel-yaml-dsl-validator
   - `camel-jbang-plugin-validate` ← depends on affected reactor module org.apache.camel:camel-yaml-dsl-validator
   - `camel-launcher-container` ← depends on affected reactor module org.apache.camel:camel-launcher
   - `camel-plc4x` ← components/camel-plc4x/src/main/java/org/apache/camel/component/plc4x/Plc4XConsumer.java, components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/Plc4XConsumerStopTest.java, own pom components/camel-plc4x/pom.xml changed
   - `camel-yaml-dsl-validator` ← depends on affected reactor module org.apache.camel:camel-catalog
   - `camel-yaml-dsl-validator-maven-plugin` ← depends on affected reactor module org.apache.camel:camel-yaml-dsl-validator
   
   </details>
   
   <details><summary>Modules with tests skipped (3)</summary>
   
   - `camel-itest`
   - `camel-yaml-dsl`
   - `camel-yaml-dsl-deserializers`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (36 modules, 5m 54s total)</summary>
   
   **Total reactor time:** 5m 54s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 46.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: TUI | 45.2s | SUCCESS |
   | Camel :: JBang :: MCP | 40.8s | SUCCESS |
   | Camel :: Component DSL | 31.2s | SUCCESS |
   | Camel :: Catalog :: Camel Catalog | 24.8s | SUCCESS |
   | Camel :: YAML DSL | 20.1s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 19.5s | SUCCESS |
   | Camel :: YAML DSL :: Validator | 18.7s | SUCCESS |
   | Camel :: Docs | 16.1s | SUCCESS |
   | Camel :: PLC4X | 13.8s | SUCCESS |
   | Camel :: Kamelet Main | 10.1s | SUCCESS |
   | Camel :: YAML DSL :: Deserializers | 9.1s | SUCCESS |
   | Camel :: Catalog :: Camel Route Parser | 7.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 7.9s | SUCCESS |
   | Camel :: Catalog :: Camel Report Maven Plugin | 6.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 5.2s | SUCCESS |
   | Camel :: All Components Sync point | 5.0s | SUCCESS |
   | Camel :: YAML DSL :: Validator Maven Plugin | 4.4s | SUCCESS |
   | Camel :: YAML DSL :: Maven Plugins | 3.5s | SUCCESS |
   | Camel :: Catalog :: Maven | 3.2s | SUCCESS |
   | Camel :: Catalog :: Suggest (deprecated) | 2.4s | SUCCESS |
   | Camel :: Assembly | 1.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.3s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.2s | SUCCESS |
   | Camel :: Catalog :: Dummy Component | 1.2s | SUCCESS |
   | Camel :: Coverage | 1.1s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.1s | SUCCESS |
   | Camel :: Catalog :: Console | 0.9s | SUCCESS |
   | Camel :: Launcher :: Container | 0.7s | SUCCESS |
   | Camel :: Endpoint DSL :: Support | 0.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 0.7s | SUCCESS |
   | Camel :: JBang :: Main | 0.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 0.5s | SUCCESS |
   | Camel :: Endpoint DSL | n/a |  |
   | Camel :: Integration Tests | n/a |  |
   | Camel :: JBang :: Core | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (46.4s)
   - `Camel :: JBang :: Plugin :: TUI` (45.2s)
   - `Camel :: JBang :: MCP` (40.8s)
   - `Camel :: Component DSL` (31.2s)
   - `Camel :: Catalog :: Camel Catalog` (24.8s)
   - `Camel :: YAML DSL` (20.1s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (19.5s)
   - `Camel :: YAML DSL :: Validator` (18.7s)
   - `Camel :: Docs` (16.1s)
   - `Camel :: PLC4X` (13.8s)
   - `Camel :: Kamelet Main` (10.1s)
   - `Camel :: YAML DSL :: Deserializers` (9.1s)
   - `Camel :: Catalog :: Camel Route Parser` (7.9s)
   - `Camel :: JBang :: Plugin :: Testing` (7.9s)
   - `Camel :: Catalog :: Camel Report Maven Plugin` (6.7s)
   - `Camel :: JBang :: Plugin :: Validate` (5.2s)
   - `Camel :: All Components Sync point` (5.0s)
   - `Camel :: YAML DSL :: Validator Maven Plugin` (4.4s)
   - `Camel :: YAML DSL :: Maven Plugins` (3.5s)
   - `Camel :: Catalog :: Maven` (3.2s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/37182519446)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25292: camel-plc4x - a stopped triggered consumer must stop its scraper, and the triggered consumer must start [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27323:
URL: https://github.com/apache/camel/pull/27323#issuecomment-5977280695

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org