Hi Mikhail

For what it's worth, I asked a similar question before. Part of my REST config:
        if (Boolean.parseBoolean(System.getenv("authDisabled"))) {
            endpointProperty = "myLog";
        } else endpointProperty = "myLog, sessionHandler";

        restConfiguration()
                .component("jetty")
                .endpointProperty("handlers", endpointProperty)

sessionHandler is an object that contains my integration into Keycloak for 
OAUTH2 things

My use case was that I'd like to run a 2nd rest config on a different port 
(which will be unsecured) so that I can put a 2nd instance of my rest endpoints 
behind an API gateway. Unfortunately I received no response, so my solution was 
to run two instances of my camel code. I am fortunate enough to be able to do 
that because I don't keep state inside camel but rather in things like mongodb/ 
postgresql.

Unless someone pipes up to let us know how to run multiple rest configs, I 
suggest looking at a solution like mine

Riaan

-----Original Message-----
From: Mikhail Lukyanov <[email protected]> 
Sent: Friday, 24 January 2020 09:52
To: [email protected]
Subject: Is it possible to have several rest configurations in rest dsl, for 
example with http and https schemes on different ports?

I hava one rest config for http scheme, but I need several configurations, for 
example, for https scheme to on different port. I use 2.20.2 camel-version. My 
config

*-<camelContext xmlns="http://camel.apache.org/schema/spring
<http://camel.apache.org/schema/spring>" id="rest">*
*   -<restConfiguration scheme="http" producerComponent="http" port="9090"
host="0.0.0.0" contextPath="/fesb-rest" component="jetty"
bindingMode="off">*
*   <dataFormatProperty value="true" key="prettyPrint"/>*
*</restConfiguration>*
*   -<rest id="4f777f7b-f2fd-4107-8271-a50640d4525c"
produces="application/json" path="/path">*
*   -<get id="026ea872-e2f8-4772-8d10-6482b8549f11"
produces="application/json" uri="/get">*
*   <description/>*
*   <to uri="direct-vm://restLink"/>*
*</get>*
*</rest>*

Reply via email to