Skip to content

Camel 22510 avoid leaking internal data types#21704

Draft
chandru9 wants to merge 4 commits intoapache:mainfrom
chandru9:CAMEL-22510-avoid-leaking-internal-data-types
Draft

Camel 22510 avoid leaking internal data types#21704
chandru9 wants to merge 4 commits intoapache:mainfrom
chandru9:CAMEL-22510-avoid-leaking-internal-data-types

Conversation

@chandru9
Copy link
Contributor

@chandru9 chandru9 commented Mar 4, 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.

@Croway
Copy link
Contributor

Croway commented Mar 4, 2026

please rebase this branch

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 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.

@davsclaus
Copy link
Contributor

use junit6 instead of 5

@jamesnetherton
Copy link
Contributor

Do we expect users will want to convert from BufferedImage? Just wondering if we can avoid introducing AWT and just check the mime / content-type and use byte[] or InputStream if image processing is required?

@davsclaus
Copy link
Contributor

Do we expect users will want to convert from BufferedImage? Just wondering if we can avoid introducing AWT and just check the mime / content-type and use byte[] or InputStream if image processing is required?

No we dont use that anywhere else. And indeed its not a type anyone really use.

Also this PR has an unit that doesn't really test the newly introduced converter

@davsclaus davsclaus marked this pull request as draft March 5, 2026 08:48
@davsclaus
Copy link
Contributor

@chandru9 can you eplain your reason for this PR

@chandru9
Copy link
Contributor Author

chandru9 commented Mar 5, 2026

@jamesnetherton : Good point. The BufferedImage converter was added to support direct image processing inputs, but since Camel routes typically handle images as byte[], InputStream, or WrappedFile, and we already detect the MIME type to create the appropriate ImageContent, introducing BufferedImage may not be necessary.

To avoid introducing the AWT dependency, I can remove the BufferedImage converter and rely on byte[] / InputStream based conversion using the detected content-type. This should cover the intended use cases for image processing in routes.

@chandru9
Copy link
Contributor Author

chandru9 commented Mar 5, 2026

@davsclaus : PR intended to improve the usability of the langchain4j-agent component by enabling automatic body conversion to AiAgentBody for common input types such as files, streams,text.image etc.
final advantage is to avoid the usage of convertBodyTo().
Also I will add tests for converter.

@davsclaus
Copy link
Contributor

Thanks, removing that AWT BufferedImage is welcome.

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.

4 participants