Andrea Cosentino created CAMEL-24201:
----------------------------------------

             Summary: camel-aws2-step-functions: listExecutions never sets 
stateMachineArn so the operation always fails
                 Key: CAMEL-24201
                 URL: https://issues.apache.org/jira/browse/CAMEL-24201
             Project: Camel
          Issue Type: Bug
          Components: camel-aws
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino
             Fix For: 4.14.9, 4.22.0, 4.18.4


StepFunctions2Producer.listExecutions builds the ListExecutionsRequest with 
only maxResults:

{code:java}
ListExecutionsRequest.Builder builder = ListExecutionsRequest.builder();
if 
(ObjectHelper.isNotEmpty(exchange.getIn().getHeader(StepFunctions2Constants.EXECUTIONS_MAX_RESULTS)))
 {
    int maxRes = 
exchange.getIn().getHeader(StepFunctions2Constants.EXECUTIONS_MAX_RESULTS, 
Integer.class);
    builder.maxResults(maxRes);
}
{code}

The AWS ListExecutions API requires a stateMachineArn (or a mapRunArn), so in 
non-POJO/header mode the call is always rejected by AWS — the operation is 
effectively unusable. The CamelAwsStepFunctionsStateMachineArn header/constant 
already exists and is read by the sibling operations (deleteStateMachine, 
updateStateMachine, describeStateMachine, ...), but listExecutions never reads 
it.

Fix: read StepFunctions2Constants.STATE_MACHINE_ARN and set it on the builder, 
following the same optional-header pattern used by the sibling operations.

Code reference (main): StepFunctions2Producer.java ~lines 635-639.

Present on camel-4.18.x and camel-4.14.x; backport to both.

Found during an agent-assisted audit of the AWS components; verified against 
the cited code.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to