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 c8ec964a9e17 CAMEL-22715: camel-jbang - send command to accept prop
and properties to load configuration to use when sending
c8ec964a9e17 is described below
commit c8ec964a9e17ee990c04bb5e7c245d9997a99e5e
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Nov 21 11:00:44 2025 +0100
CAMEL-22715: camel-jbang - send command to accept prop and properties to
load configuration to use when sending
---
.../org/apache/camel/dsl/jbang/core/commands/Run.java | 4 ++--
.../dsl/jbang/core/commands/action/CamelSendAction.java | 15 +++++++++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index 2a13a518833f..351680d2a1d2 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -270,10 +270,10 @@ public class Run extends CamelCommand {
@Option(names = { "--properties" },
description = "comma separated list of properties file" +
" (ex.
/path/to/file.properties,/path/to/other.properties")
- String propertiesFiles;
+ public String propertiesFiles;
@Option(names = { "--prop", "--property" }, description = "Additional
properties (override existing)", arity = "0")
- String[] property;
+ public String[] property;
@Option(names = { "--stub" }, description = "Stubs all the matching
endpoint uri with the given component name or pattern."
+ " Multiple names can be
separated by comma. (all = stub all endpoints).")
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSendAction.java
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSendAction.java
index 6650f17f9551..f7509bcb9794 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSendAction.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSendAction.java
@@ -50,6 +50,16 @@ public class CamelSendAction extends ActionBaseCommand {
arity = "0..1")
String name;
+ @CommandLine.Option(names = { "--properties" },
+ description = "comma separated list of properties file
(only applicable when NOT using an existing running Camel)"
+ +
+ " (ex.
/path/to/file.properties,/path/to/other.properties")
+ String propertiesFiles;
+
+ @CommandLine.Option(names = { "--prop", "--property" }, description =
"Additional properties; override existing (only applicable when NOT using an
existing running Camel)",
+ arity = "0")
+ String[] property;
+
@CommandLine.Option(names = { "--endpoint", "--uri" },
description = "Endpoint where to send the message (can
be uri, pattern, or refer to a route id)")
String endpoint;
@@ -261,6 +271,8 @@ public class CamelSendAction extends ActionBaseCommand {
}
};
run.empty = true;
+ run.propertiesFiles = propertiesFiles;
+ run.property = property;
// spawn thread that waits for response file
final CountDownLatch latch = new CountDownLatch(1);
@@ -272,7 +284,6 @@ public class CamelSendAction extends ActionBaseCommand {
try {
showStatus(outputFile);
} catch (Exception e) {
- e.printStackTrace();
// ignore
} finally {
latch.countDown();
@@ -294,7 +305,7 @@ public class CamelSendAction extends ActionBaseCommand {
}
private void printStatusLine(JsonObject jo) {
- // timstamp
+ // timestamp
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String ts = sdf.format(new Date(jo.getLong("timestamp")));
if (loggingColor) {