Skip to content

Commit

Permalink
[Rest] Add a method to override context
Browse files Browse the repository at this point in the history
  • Loading branch information
avano committed Feb 24, 2025
1 parent b8ed332 commit 91f4035
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@

public class RestCustomizer extends ProductsCustomizer {
private static final String DEFAULT_PATH = "/camel";
private final String path;

public RestCustomizer() {
this.path = DEFAULT_PATH;
}

// Needed to override the path when using platform-http and not servlet
public RestCustomizer(String path) {
this.path = path;
}

@Override
public void customizeQuarkus() {
getIntegrationBuilder().addToApplicationProperties("quarkus.camel.servlet.url-patterns", DEFAULT_PATH + "/*");
getIntegrationBuilder().addToApplicationProperties("quarkus.camel.servlet.url-patterns", path + "/*");
getIntegrationBuilder().addToApplicationProperties("quarkus.openshift.route.expose", "true");
getIntegrationBuilder().dependencies("rest");
}
Expand All @@ -27,6 +37,6 @@ public void customizeSpringboot() {
}

public String getReadinessCheckPath() {
return DEFAULT_PATH + "/";
return "/".equals(path) ? path : path + "/";
}
}

0 comments on commit 91f4035

Please sign in to comment.