CAMEL-23548: camel-aws2-s3 - allow Simple expressions in destinationB…#23334
Merged
davsclaus merged 1 commit intoMay 20, 2026
Conversation
7a96a3c to
20f43d7
Compare
oscerd
approved these changes
May 19, 2026
20f43d7 to
d1a8eae
Compare
…ucketPrefix and destinationBucketSuffix
d1a8eae to
f8a8ee9
Compare
Contributor
Author
|
Sorry for the force pushes: I accidentally used the wrong account to commit. It is solved now and I will not be doing any more. |
davsclaus
approved these changes
May 19, 2026
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
All tested modules (9 modules)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
camel-aws2-s3consumer supports amoveAfterReadoption that copies consumed objects to a destination bucket. ThedestinationBucketPrefixanddestinationBucketSuffixoptions allow customising the destination key, but previously only accepted literal strings.This PR adds Simple expression language support to both options, following the same pattern already used by
AWS2S3Utils.determineKey()andAWS2S3Utils.determineBucketName():LanguageSupport.hasSimpleFunction()detects whether the value contains a${...}expression; if so, the"simple"language is resolved from the Camel context and evaluated against the current exchange.Literal strings and
null/empty values continue to behave exactly as before, so existing routes usingRAW(somePrefix)are unaffected.A practical use case is organising moved objects by date:
Changes:
AWS2S3Utils: two new static helpersevaluateDestinationBucketPrefix/evaluateDestinationBucketSuffixAWS2S3Consumer.processCommit(): uses the new helpers instead of plain string concatenationAWS2S3UtilsTest: 6 new unit tests (literal pass-through, Simple expression evaluation, null/empty for prefix and suffix)aws2-s3-component.adoc: documents expression support with a static and a dynamic date exampleTarget
mainbranch)Tracking
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 -DskipTestslocally from root folder and I have committed all auto-generated changes.