Question: I have a pretty easy route where I pickup files from a directory and send it to a bean:

`from("file:/mydir?delete=true").bean(MyProcessor.class);`

It can happen that an exception occures in MyProcessor.class and so I want to delay the processing of that file again. How can I setup a redelivery for that as I tried already different things with

`onException().redeliveryDelay(10000);`

but it didn't work and right after the exception the same file gets processed again.

Answer: 
You should probably start by moving your string variables out of the if blocks

And then return the concatenated string.

```
public IActionResult TestingSample(int A, int B)
{
    string rescorr = string.Empty;
    string reswron = string.Empty;

    if (A > B && B != 0)
    {
        int corr = 2 + A * B;
        rescorr = corr.ToString();
    }
    else
    {
        int wron = 2 * A + B;
        reswron = wron.ToString();
    }

    return rescorr + reswron;
}

```

Then you realise that only 1 of these will ever get set so we change the string assignments in to individual returns. We get get rid of the variables and the else block because that's now redundant too.

```
public IActionResult TestingSample(int A, int B)
{
    if (A > B && B != 0)
    {
        int corr = 2 + A * B;
        return corr.ToString();
    }

    int wron = 2 * A + B;
    return wron.ToString();

}

```
Something like this:

```
 public IActionResult TestingSample(int A, int B) => A > B && B != 0 
     ? $"{2 + (long)A * B}"   // "correct"
     : $"{2L * A + B}";       // "wrong" 

```

here if  `A > B && B != 0` we have *correct* arguments and we return `2 + A * B`, othevise arguments are *wrong* and we return `2 + A * B`.

I've introduced `long` to fight with possible integer overflow (when, say, `A == 2_000_000`, `A = 1_000_000`)