Serdar Gökay created CAMEL-25386:
------------------------------------

             Summary: camel-jbang - the route control MCP tools report a 
timeout although the route command succeeded
                 Key: CAMEL-25386
                 URL: https://issues.apache.org/jira/browse/CAMEL-25386
             Project: Camel
          Issue Type: Bug
          Components: camel-jbang
    Affects Versions: 4.22.1
         Environment: Camel JBang 4.22.1, JBang 0.142.0, Java 25.0.4, macOS; 
also seen in a Linux container on Kubernetes
            Reporter: Serdar Gökay


{{start_route}}, {{stop_route}}, {{suspend_route}} and {{resume_route}} change 
the route state, but each call waits 10 seconds and then returns, with 
isError=false:
{noformat}
Timeout waiting for response from PID 39618 for action: route
{noformat}
{{camel get route}} then shows the route in the requested state. The result 
reads like a failure although the command worked. {{camel cmd stop-route}} 
returns immediately.

h3. Reproduce

Camel JBang 4.22.1. {{demo.camel.yaml}}:
{noformat}
- route:
    id: tick
    from:
      uri: timer:tick
      steps:
        - log: tick
- route:
    id: echo
    from:
      uri: direct:echo
      steps:
        - log: "foo=${header.foo}"
{noformat}
{noformat}
camel run demo.camel.yaml --mcp
{noformat}
Then call {{stop_route}} from an MCP client connected to the {{/mcp}} endpoint, 
with these arguments:
{noformat}
{"routeId": "tick"}
{noformat}

h3. Cause

The tools call {{ToolContext.executeAction("route", ...)}}, and 
{{RuntimeHelper.executeAction}} waits up to {{ACTION_TIMEOUT_MS}} (10 s) for 
the output file. {{LocalCliConnector.doActionRouteTask}} writes no output, 
since the {{camel cmd}} route commands do not wait for one. Of the actions the 
tools call through {{executeAction}}, it is the only one without output. 
Writing a short result from the route action, or not waiting in these four 
tools, would fix it.

>From reading the code, the route control tool of the {{camel mcp}} server 
>({{RuntimeTools}}) delegates to the same tools. The code is unchanged on main.



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

Reply via email to