k-krawczyk commented on PR #25892:
URL: https://github.com/apache/camel/pull/25892#issuecomment-5468284362
@davsclaus one open question on the documentation, not blocking the merge -
the code is unchanged either way.
The `ai-resource` docs show reading a static file with
`pollEnrich("file:config?fileName=app.json&noop=true&idempotent=false")`. Two
defaults bite there and I would rather have them spelled out than discovered:
* `noop=true` implies `idempotent=true`, so without `idempotent=false` the
file is read once and skipped afterwards - wrong for a resource that should be
readable on every request.
* `pollEnrich` defaults to `timeout=-1`, which waits until a message is
available and can block indefinitely. If the file is missing, the route thread
parks forever. The bridge still answers the client: after
`camel.server.mcp-resource-timeout` (20s by default) the read returns a timeout
error. But the route keeps running and its exchange is not returned to the
pool, exactly as documented for a tool call that overruns.
My inclination is the smallest thing that works: put an explicit
`&timeout=5000` in the file examples and add one sentence saying why, so nobody
copies a route that can park a thread on a missing file. No behaviour change.
The alternatives I can see, if you prefer something stronger:
1. Leave the examples as they are - the timeout is a `pollEnrich` property
and arguably not this component's business to teach.
2. Have the bridge cancel harder on timeout rather than leaving the route
running. That would be a change to shared behaviour, since tools work the same
way today, so it belongs in its own issue rather than here.
Which would you like? Happy to push the docs tweak to this PR if option zero
is fine.
_Reported by Claude Code on behalf of Karol Krawczyk_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]