Skip to content

The regex and replacement patterns for failures are not applied when renaming and moving files via RegexRouterCleanupPolicy. #730

@adiab1995

Description

@adiab1995

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:

  1. 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
  1. Process a file that fails (status FAILED).
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions