davsclaus opened a new pull request, #29909: URL: https://github.com/apache/camel/pull/29909
Item 2 of [CAMEL-26929](https://issues.apache.org/jira/browse/CAMEL-26929). ## Problem A name given to a command for running integrations is a prefix unless it ends with `!` (`ProcessFinder.pattern()`). With `orders` and `orders-v2` running: - `camel stop orders` stops both. So do `camel cmd logger`, `reset-stats`, `stop-route`, `trace` and the other commands that act on every match. - Every command that needs one integration (`camel cmd send orders`, `camel get route orders`, ...) fails with exit 3 ("matches 2 running Camel integrations"), and the message does not say how to pick one. - The MCP runtime tools behave the same way, because their `nameOrPid` goes through the same finder. ## Change `ProcessFinder` now prefers an exact name. When some integration has exactly the given name (its name, its file name without extension, or its CamelContext name, ignoring case), the name matches only the integrations with that name. A name that no integration has stays a prefix, and `orders*`, `orders!`, regular expressions and pids behave as before. | running | name | before | after | |---|---|---|---| | `orders`, `orders-v2` | `orders` | both | `orders` | | `orders`, `orders-v2` | `order` | both | both | | `orders`, `orders-v2` | `orders*` | both | both | | `orders`, `orders-v2` | `orders!` | `orders` | `orders` | The ambiguity message now says to give the pid, or a name that matches exactly one. Because every command and the MCP server go through `ProcessFinder`, this covers them all. The TUI has its own copy of the prefix match, which only filters the integrations it shows, so it is unchanged. The docs note in `camel-jbang-managing.adoc` and the 4.24 upgrade guide describe the new rule: `camel stop orders` no longer stops `orders-v2`. ## Tests - `ProcessFinderTest`: two new tests, one for the name and one for the file name / CamelContext name. `requireOneNeedsExactlyOneMatch` is updated: `orders` now picks `orders`, and `ord` is the ambiguous name. - Without the fix, 3 of the 12 tests fail. - The camel-jbang-core suite passes. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
