[ 
https://issues.apache.org/jira/browse/CAMEL-24002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-24002:
--------------------------------
    Priority: Minor  (was: Major)

> camel cmd send exits 0 on failure; Terminated launcher entries make 
> integration names ambiguous for exported runtimes
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24002
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24002
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jbang
>    Affects Versions: 4.20.0
>            Reporter: Federico Mariani
>            Priority: Minor
>
> Two related {{camel cmd send}} defects on 4.20.0, observed when driving an 
> integration started with {{camel run --runtime=spring-boot}} (same with 
> {{--runtime=quarkus}}):
> 1. The launcher process leaves a {{Terminated}} status entry under the 
> integration name next to the real application process:
> {code}
>  PID   NAME    READY    STATUS    AGE
> 79082  myapp    0/1   Terminated  28s     <- launcher leftover
> 79153  myapp    1/1      Running  21s     <- actual application
> {code}
> {{camel cmd send myapp --endpoint=direct:events --body='hello'}} then fails 
> with:
> {code}
> Name or pid myapp matches 2 running Camel integrations. Specify a name or PID 
> that matches exactly one.
> {code}
> Terminated entries should not count as running integrations for name 
> matching. This does not happen with the default camel-main runtime (single 
> process).
> 2. {{camel cmd send}} exits 0 on failure — both for the ambiguous-name error 
> above and for {{Send timeout}}. Tooling that drives integrations 
> programmatically (e.g. the Citrus citrus-camel JBang connector) checks the 
> exit code and reports the send as successful, so messages are silently lost. 
> A failed send should exit non-zero.
> *Reproducer:*
> {code}
> cat > sendtest.camel.yaml <<'EOF'
> - route:
>     from:
>       uri: direct
>       parameters:
>         name: events
>       steps:
>         - log:
>             message: "Received: ${body}"
> EOF
> camel run sendtest.camel.yaml --runtime=spring-boot --name=sendtest &
> # after the Spring Boot app has started:
> camel ps                # 2 entries for 'sendtest' (Terminated + Running)
> camel cmd send sendtest --endpoint=direct:events --body='hello'
> echo $?                 # 0, despite the error; nothing delivered
> {code}
> Found via the Camel Forage integration tests (KaotoIO/forage, 
> JdbcTest.aggregationTest failing on spring-boot/quarkus, passing on 
> camel-main). Works as expected on 4.18.2.



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

Reply via email to