Skip to content

CAMEL-23153 - Camel-Google: Add Google Cloud Vision AI component#21853

Merged
oscerd merged 5 commits intomainfrom
23153
Mar 9, 2026
Merged

CAMEL-23153 - Camel-Google: Add Google Cloud Vision AI component#21853
oscerd merged 5 commits intomainfrom
23153

Conversation

@oscerd
Copy link
Contributor

@oscerd oscerd commented Mar 9, 2026

Description

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • 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.

oscerd added 3 commits March 9, 2026 10:01
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

🌟 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 build-all, build-dependents, 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.

Copy link
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

GoogleCloudVisionConfiguration has both:

  • String operation (UriPath — set from the URI remaining, e.g., google-vision:labelDetection)
  • GoogleCloudVisionOperations operationType (UriParam — typed enum)

In GoogleCloudVisionProducer.determineOperation() (line 167-183), the logic is:

  1. Check message header
  2. Check operationType (enum)
  3. Check operation (string) → parse to enum via valueOf()

The operation UriPath is always set by GoogleCloudVisionComponent.createEndpoint() (line 47: configurationCopy.setOperation(remaining)), but it's the string name of the
operation, not a separate concept. So operationType and operation represent the same thing in two different types. This is confusing for users — they might set both, and
precedence is unclear.

Suggestion: Either remove operationType and just use the operation string (parsed to enum internally), or make operation a GoogleCloudVisionOperations UriPath (like other Camel components that use enums in the path). Having both is a source of confusion.

I'll push a commit to fix along with other minor issues.

gnodet added 2 commits March 9, 2026 11:18
- Add error check in processPojo() (was missing unlike processImage())
- Use RuntimeCamelException instead of raw RuntimeException
- Use enhanced switch expressions (Java 21+)
- Use List.of() instead of ArrayList for single-element lists
- Remove unnecessary static getMessageForResponse() helper
- Make endpoint field final

Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
The operation is already specified in the URI path (e.g.,
google-vision:labelDetection). Having a separate operationType
query parameter with the same purpose is confusing. Remove it
and simplify the producer's operation resolution.

Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
@oscerd
Copy link
Contributor Author

oscerd commented Mar 9, 2026

yarn gulp failures are unrelated

@oscerd oscerd merged commit 0d9ff40 into main Mar 9, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants