Skip to content

CAMEL-24526: camel-djl - reject the zoo tabular applications instead of returning no-op predictors - #25849

Merged
Croway merged 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24526
Aug 28, 2026
Merged

CAMEL-24526: camel-djl - reject the zoo tabular applications instead of returning no-op predictors#25849
Croway merged 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24526

Conversation

@oscerd

@oscerd oscerd commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Issue

CAMEL-24526

Problem

ZooLinearRegressionPredictor and ZooSoftmaxRegressionPredictor were empty stubs:

@Override
public void process(Exchange exchange) throws Exception {
    // TODO: impl
}

ModelPredictorProducer.getZooPredictor() routes djl:tabular/linear_regression and
djl:tabular/softmax_regression (in zoo mode) to these classes, so the producer did nothing and
the exchange body was passed through unchanged — the input was silently returned as if it were the
model's prediction. This is a silent wrong-result bug: a route appears to run a regression but never
does.

Why not just implement them?

The DJL model zoo publishes no tabular regression models — the test class documents exactly this
(ModelPredictorProducerTest lines 92–93: "No builtin zoo model available for tabular/linear_regression / softmax_regression"),
consistent with the other applications that have no downloadable artifact. Unlike CV (Image
Classifications) or NLP (String → …), a tabular model has no fixed input/output type pair and DJL
provides no generic tabular Translator; those types are specific to the user's data. There is
therefore nothing generic a zoo predictor could load or translate. The supported way to run a tabular
model is the custom variant (CustomTabularPredictor), where the user supplies their own Model
and Translator via the registry.

Fix

  • Remove the two no-op stub classes.
  • getZooPredictor() now throws a clear RuntimeCamelException for the tabular applications,
    telling the user to provide their own model and translator and use the custom predictor instead —
    a loud, actionable failure instead of a silently wrong result.
  • Add testGetZooPredictorRejectsTabularApplications covering both applications.

The custom tabular path (CustomTabularPredictor) is unchanged and still fully supported.

Testing

  • mvn -pl components/camel-ai/camel-djl test (new test green; existing tests unaffected).
  • mvn -Psourcecheck validate green (formatter + impsort).

Claude Code on behalf of oscerd

…of returning no-op predictors

The zoo linear/softmax regression predictors were empty "// TODO: impl" stubs
whose process() did nothing, so a djl:tabular/linear_regression or
tabular/softmax_regression route silently returned the input body unchanged as
if it were the prediction (a silent wrong result). The DJL model zoo publishes no
tabular regression models, and the input/output types of a tabular model are
specific to the user's data, so no generic zoo predictor can exist for these
applications. getZooPredictor now throws a clear RuntimeCamelException for the
tabular applications, pointing users to the supported custom model+translator
path, and the two no-op stub classes are removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd added the bug Something isn't working label Aug 28, 2026
@oscerd oscerd added this to the 4.23.0 milestone Aug 28, 2026
@oscerd
oscerd requested review from Croway and davsclaus August 28, 2026 04:32
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 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 have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-ai/camel-djl

🔬 Scalpel shadow comparison — Scalpel: 9 tested, 28 compile-only — current: 9 all tested

Maveniverse Scalpel detected 37 affected modules (current approach: 9).

⚠️ Modules only in Scalpel (28)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 9 modules (1 direct + 8 downstream), skip tests for 28 (generated code, meta-modules)

Modules Scalpel would test (9)
  • camel-djl
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules with tests skipped (28)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • components/camel-ai/camel-djl: 1 test(s) disabled on GitHub Actions
All tested modules (37 modules)
  • Camel :: AI :: Deep Java Library
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix — the deleted ZooLinearRegressionPredictor and ZooSoftmaxRegressionPredictor were genuine stubs with empty process() methods (// TODO: impl), so replacing them with a clear RuntimeCamelException is the right approach. The error message is actionable, directing users to the custom predictor path which remains fully functional.

One thing I believe is missing:

Upgrade guide entry — This PR changes user-visible behavior: routes using djl:tabular/linear_regression or djl:tabular/softmax_regression in zoo mode previously completed silently (no-op); they now throw a RuntimeCamelException. Per project convention, this should be documented in camel-4x-upgrade-guide-4_23.adoc.

There is direct precedent: CAMEL-22518 (commit 66d00a5f6ab) removed the nlp/word_embedding zoo path under identical circumstances and included an upgrade guide entry in camel-4x-upgrade-guide-4_21.adoc.


AI-generated review on behalf of Guillaume Nodet — verify any suggestions before applying.

@Croway
Croway merged commit fecd393 into apache:main Aug 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working components components-ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants