Describe the bug
The failureRegex
and failureReplacement
patterns in the RegexRouterCleanupPolicy
are not correctly applied when renaming and moving files after a failed processing. As a result, failed files are not routed to the expected target folder with the correct name. This issue also affects the related unit tests, which do not properly verify this behavior.
To Reproduce
Steps to reproduce the behavior:
- Configure the policy with custom failure regex and replacement, for example:
FAILURE_ROUTE_TOPIC_REGEX_CONFIG
: (.*).txt
FAILURE_ROUTE_TOPIC_REPLACEMENT_CONFIG
: $1-DONE-FAILURE.txt
- Process a file that fails (status
FAILED
).
- Observe that the file is not renamed and moved as expected.
Expected behavior
Failed files should be renamed and moved according to the configured failureRegex
and failureReplacement
patterns. For example, file.txt
should become file-DONE-FAILURE.txt
in the target folder when processing fails.
Screenshots
Not applicable
Additional context
The fix should ensure that both renaming and moving of failed files use the correct patterns, and that unit tests verify this behavior.