You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/06/19 10:17:51 UTC
[camel] branch main updated: camel-jbang - Make camel stop easier to use
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 5b66918f4b2 camel-jbang - Make camel stop easier to use
5b66918f4b2 is described below
commit 5b66918f4b2449ac38a51a76112f9e85cb19dc07
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jun 19 12:16:57 2023 +0200
camel-jbang - Make camel stop easier to use
---
.../modules/ROOT/pages/camel-4-migration-guide.adoc | 2 ++
docs/user-manual/modules/ROOT/pages/camel-jbang.adoc | 6 ++----
.../dsl/jbang/core/commands/process/StopProcess.java | 16 ++++------------
3 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
index 287e9acdcfc..50880b28781 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
@@ -295,6 +295,8 @@ The command `camel dependencies` has been renamed to `camel dependency`.
In Camel JBang the `-dir` parameter for `init` and `run` goal has been renamed to require 2 dashes `--dir` like all the other options.
+The `camel stop` command will now by default stop all running integrations (the option `--all` has been removed).
+
=== camel-openapi-java
The `camel-openapi-java` component has been changed to use `io.swagger.v3` libraries instead of `io.apicurio.datamodels`.
diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
index 8ef85480537..cfe39803219 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
@@ -1038,11 +1038,11 @@ TIP: You do not have to type the full name, as the stop command will match using
that starts with the input, for example you can do `camel stop d` to stop all integrations
starting with d.
-To stop all integrations then you need to use the `--all` option as follows:
+To stop all integrations, then execute without any pid:
[source,bash]
----
-camel stop --all
+camel stop
Stopping running Camel integration (pid: 61818)
Stopping running Camel integration (pid: 62506)
----
@@ -1265,8 +1265,6 @@ $ camel stop chuck
Shutting down Camel integration (pid: 80093)
----
-TIP: To stop all Camel integrations you can use `camel stop --all`.
-
==== Starting and Stopping routes
The `camel cmd` is intended for executing miscellaneous commands in the running Camel integrations.
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/StopProcess.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/StopProcess.java
index 0365b186a63..4ef6e82332f 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/StopProcess.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/StopProcess.java
@@ -24,15 +24,11 @@ import org.apache.camel.util.FileUtil;
import picocli.CommandLine;
import picocli.CommandLine.Command;
-@Command(name = "stop", description = "Shuts down a running Camel integration")
+@Command(name = "stop", description = "Shuts down running Camel integrations")
public class StopProcess extends ProcessBaseCommand {
@CommandLine.Parameters(description = "Name or pid of running Camel integration", arity = "0..1")
- String name;
-
- @CommandLine.Option(names = { "--all" },
- description = "To shutdown all running Camel integrations")
- boolean all;
+ String name = "*";
@CommandLine.Option(names = { "--kill" },
description = "To force killing the process (SIGKILL)")
@@ -45,12 +41,6 @@ public class StopProcess extends ProcessBaseCommand {
@Override
public Integer doCall() throws Exception {
- if (!all && name == null) {
- return 0;
- } else if (all) {
- name = "*";
- }
-
List<Long> pids = findPids(name);
// stop by deleting the pid file
@@ -61,6 +51,8 @@ public class StopProcess extends ProcessBaseCommand {
System.out.println("Shutting down Camel integration (PID: " + pid + ")");
FileUtil.deleteFile(pidFile);
}
+ }
+ for (Long pid : pids) {
if (kill) {
ProcessHandle.of(pid).ifPresent(ph -> {
System.out.println("Killing Camel integration (PID: " + pid + ")");