You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2026/03/31 12:25:56 UTC
(camel) branch backport/22355-to-camel-4.18.x created (now d9f0ae6742ac)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch backport/22355-to-camel-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
at d9f0ae6742ac CAMEL-23272: Enable main HTTP server when --port is explicitly specified (#22355)
This branch includes the following new commits:
new d9f0ae6742ac CAMEL-23272: Enable main HTTP server when --port is explicitly specified (#22355)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(camel) 01/01: CAMEL-23272: Enable main HTTP server when --port is explicitly specified (#22355)
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch backport/22355-to-camel-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit d9f0ae6742acadbea6a00b52195ace1069242016
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 31 14:11:08 2026 +0200
CAMEL-23272: Enable main HTTP server when --port is explicitly specified (#22355)
When using camel run with --port and --management-port together, the REST
endpoints were incorrectly served on the management port because the main
HTTP server was never enabled. The --port option wrote camel.server.port
but not camel.server.enabled=true, so BaseMainSupport skipped creating
the main server.
This is consistent with how ExportCamelMain already handles port
configuration.
Co-authored-by: Claude Opus 4.6 (1M context) <no...@anthropic.com>
---
.../main/java/org/apache/camel/dsl/jbang/core/commands/Run.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 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 8ba6b5dff370..0d74d2cbda17 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
@@ -733,8 +733,12 @@ public class Run extends CamelCommand {
() -> maxSeconds > 0 ? String.valueOf(maxSeconds) : null);
writeSetting(main, profileProperties, "camel.main.durationMaxIdleSeconds",
() -> maxIdleSeconds > 0 ? String.valueOf(maxIdleSeconds) : null);
- if (port != -1 && port != 8080) {
- writeSetting(main, profileProperties, "camel.server.port", () -> String.valueOf(port));
+ if (port != -1) {
+ // enable the main HTTP server when --port is explicitly specified
+ writeSetting(main, profileProperties, "camel.server.enabled", "true");
+ if (port != 8080) {
+ writeSetting(main, profileProperties, "camel.server.port", () -> String.valueOf(port));
+ }
}
if (port == 0 && managementPort == -1) {
// use same port for management