Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camelContext is not supported in XML DSL routedefinition #731

Closed
ewcchan opened this issue Jun 7, 2019 · 10 comments
Closed

camelContext is not supported in XML DSL routedefinition #731

ewcchan opened this issue Jun 7, 2019 · 10 comments
Labels
status/waiting-for-feedback Needs some feedback

Comments

@ewcchan
Copy link

ewcchan commented Jun 7, 2019

the following XML content does not work and no route is detected

<?xml version="1.0" encoding="UTF-8"?>
<!-- Configures the Camel Context-->

<camelContext  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://camel.apache.org/schema/spring"
        xsi:schemaLocation="
            http://camel.apache.org/schema/spring
            http://camel.apache.org/schema/spring/camel-spring.xsd">
    
    <restConfiguration component="restlet" port="8081" host="localhost"/> 

    <rests>
    <rest path="/api/demo3/">
        <post>
            <to uri="direct:handleRestRequest"/>
        </post>
    </rest>
    </rests>

    <routes>
    <route>
            <from uri="direct:handleRestRequest"/>
            <log message="handling REST request --&gt; [${body}]"/>
            <log message="applying AtlasMap mapping"/>
            <to  uri="atlas:atlasmapping-UI.795711.json"/>
            <log message="completed mapping result --&gt; [${body}]"/>
    </route>
    </routes>
</camelContext>

I noticed in the the output it states that
**[1] 2019-06-07 20:31:59.387 DEBUG [main] XmlLoader - Unable to load RoutesDefinition: unexpected element (uri:"http://camel.apache.org/schema/spring", local:"camelContext"). **

How to probably define both rest configurations alongside routes? Should camelContext be supported?

full output

kamel run --dev --name demo3 --resource atlasmapping-UI.795711.json --dependency mvn:io.atlasmap/camel-atlasmap:1.40.0-alpha2 --dependency camel-restlet --logging-level org.apache.camel.k=DEBUG camel-context.xml
integration "demo" created
integration "demo" in phase Building Context
integration "demo" in phase Deploying
integration "demo" in phase Running
[1] Monitoring pod demo-7f767cf469-j7ptc[1] Starting the Java application using /opt/run-java/run-java.sh ...
[1] exec java -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:+ExitOnOutOfMemoryError -cp ./resources:/etc/camel/conf:/etc/camel/resources:/etc/camel/resources/i-resource-000:/etc/camel/sources/i-source-000:dependencies/com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar:dependencies/com.fasterxml.jackson.core.jackson-core-2.8.11.jar:dependencies/com.fasterxml.jackson.core.jackson-databind-2.8.11.3.jar:dependencies/com.fasterxml.jackson.module.jackson-module-jsonSchema-2.8.11.jar:dependencies/com.sun.xml.bind.jaxb-core-2.3.0.jar:dependencies/com.sun.xml.bind.jaxb-impl-2.3.0.jar:dependencies/com.sun.xsom.xsom-20140925.jar:dependencies/commons-codec.commons-codec-1.5.jar:dependencies/commons-io.commons-io-2.6.jar:dependencies/commons-logging.commons-logging-1.1.3.jar:dependencies/io.atlasmap.atlas-api-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-core-1.40.0-alpha2-tests.jar:dependencies/io.atlasmap.atlas-core-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-expression-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-java-core-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-java-model-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-java-module-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-json-core-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-json-model-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-json-module-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-model-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-xml-core-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-xml-model-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-xml-module-1.40.0-alpha2.jar:dependencies/io.atlasmap.camel-atlasmap-1.40.0-alpha2.jar:dependencies/javax.servlet.javax.servlet-api-3.1.0.jar:dependencies/javax.validation.validation-api-1.1.0.Final.jar:dependencies/net.jcip.jcip-annotations-1.0.jar:dependencies/org.apache.camel.camel-core-2.23.2.jar:dependencies/org.apache.camel.camel-http-common-2.23.2.jar:dependencies/org.apache.camel.camel-restlet-2.23.2.jar:dependencies/org.apache.camel.k.camel-k-adapter-camel-2-0.3.2.jar:dependencies/org.apache.camel.k.camel-k-runtime-core-0.3.2.jar:dependencies/org.apache.camel.k.camel-k-runtime-jvm-0.3.2.jar:dependencies/org.apache.commons.commons-lang3-3.8.1.jar:dependencies/org.apache.httpcomponents.httpclient-4.3.2.jar:dependencies/org.apache.httpcomponents.httpcore-4.3.1.jar:dependencies/org.apache.httpcomponents.httpmime-4.3.jar:dependencies/org.apache.james.apache-mime4j-core-0.7.2.jar:dependencies/org.apache.logging.log4j.log4j-api-2.11.2.jar:dependencies/org.apache.logging.log4j.log4j-core-2.11.2.jar:dependencies/org.apache.logging.log4j.log4j-slf4j-impl-2.11.2.jar:dependencies/org.jooq.joor-java-8-0.9.10.jar:dependencies/org.restlet.jee.org.restlet-2.3.12.jar:dependencies/org.restlet.jee.org.restlet.ext.httpclient-2.3.12.jar:dependencies/org.slf4j.slf4j-api-1.7.25.jar:dependencies/relaxngDatatype.relaxngDatatype-20020414.jar org.apache.camel.k.jvm.Application
[1] OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
[1] 2019-06-07 20:31:58.190 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.ContextConfigurer@40ef3420
[1] 2019-06-07 20:31:58.201 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.ContextLifecycleConfigurer@6dc17b83
[1] 2019-06-07 20:31:58.203 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.RoutesConfigurer@71809907
[1] 2019-06-07 20:31:58.204 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.RoutesDumper@158da8e
[1] 2019-06-07 20:31:58.259 INFO  [main] RoutesConfigurer - Loading routes from: file:/etc/camel/sources/i-source-000/camel-context.xml?language=xml
[1] 2019-06-07 20:31:58.348 INFO  [main] DefaultTypeConverter - Type converters loaded (core: 195, classpath: 10)
[1] 2019-06-07 20:31:59.387 DEBUG [main] XmlLoader - Unable to load RoutesDefinition: unexpected element (uri:"http://camel.apache.org/schema/spring", local:"camelContext"). Expected elements are <{http://camel.apache.org/schema/spring}aggregate>,<{http://camel.apache.org/schema/spring}aop>,<{http://camel.apache.org/schema/spring}apiKey>,<{http://camel.apache.org/schema/spring}asn1>,<{http://camel.apache.org/schema/spring}avro>,<{http://camel.apache.org/schema/spring}barcode>,<{http://camel.apache.org/schema/spring}base64>,<{http://camel.apache.org/schema/spring}basicAuth>,<{http://camel.apache.org/schema/spring}batch-config>,<{http://camel.apache.org/schema/spring}bean>,<{http://camel.apache.org/schema/spring}beanio>,<{http://camel.apache.org/schema/spring}bindy>,<{http://camel.apache.org/schema/spring}blacklistServiceFilter>,<{http://camel.apache.org/schema/spring}boon>,<{http://camel.apache.org/schema/spring}cachingServiceDiscovery>,<{http://camel.apache.org/schema/spring}castor>,<{http://camel.apache.org/schema/spring}choice>,<{http://camel.apache.org/schema/spring}circuitBreaker>,<{http://camel.apache.org/schema/spring}claimCheck>,<{http://camel.apache.org/schema/spring}combinedServiceDiscovery>,<{http://camel.apache.org/schema/spring}combinedServiceFilter>,<{http://camel.apache.org/schema/spring}constant>,<{http://camel.apache.org/schema/spring}consulServiceDiscovery>,<{http://camel.apache.org/schema/spring}contextScan>,<{http://camel.apache.org/schema/spring}convertBodyTo>,<{http://camel.apache.org/schema/spring}crypto>,<{http://camel.apache.org/schema/spring}csv>,<{http://camel.apache.org/schema/spring}customDataFormat>,<{http://camel.apache.org/schema/spring}customLoadBalancer>,<{http://camel.apache.org/schema/spring}customServiceFilter>,<{http://camel.apache.org/schema/spring}dataFormats>,<{http://camel.apache.org/schema/spring}defaultLoadBalancer>,<{http://camel.apache.org/schema/spring}delay>,<{http://camel.apache.org/schema/spring}delete>,<{http://camel.apache.org/schema/spring}description>,<{http://camel.apache.org/schema/spring}dnsServiceDiscovery>,<{http://camel.apache.org/schema/spring}doCatch>,<{http://camel.apache.org/schema/spring}doFinally>,<{http://camel.apache.org/schema/spring}doTry>,<{http://camel.apache.org/schema/spring}dynamicRouter>,<{http://camel.apache.org/schema/spring}el>,<{http://camel.apache.org/schema/spring}enrich>,<{http://camel.apache.org/schema/spring}etcdServiceDiscovery>,<{http://camel.apache.org/schema/spring}exchangeProperty>,<{http://camel.apache.org/schema/spring}expression>,<{http://camel.apache.org/schema/spring}expressionDefinition>,<{http://camel.apache.org/schema/spring}failover>,<{http://camel.apache.org/schema/spring}fhirJson>,<{http://camel.apache.org/schema/spring}fhirXml>,<{http://camel.apache.org/schema/spring}filter>,<{http://camel.apache.org/schema/spring}flatpack>,<{http://camel.apache.org/schema/spring}from>,<{http://camel.apache.org/schema/spring}get>,<{http://camel.apache.org/schema/spring}globalOption>,<{http://camel.apache.org/schema/spring}globalOptions>,<{http://camel.apache.org/schema/spring}groovy>,<{http://camel.apache.org/schema/spring}gzip>,<{http://camel.apache.org/schema/spring}head>,<{http://camel.apache.org/schema/spring}header>,<{http://camel.apache.org/schema/spring}healthyServiceFilter>,<{http://camel.apache.org/schema/spring}hessian>,<{http://camel.apache.org/schema/spring}hl7>,<{http://camel.apache.org/schema/spring}hystrix>,<{http://camel.apache.org/schema/spring}hystrixConfiguration>,<{http://camel.apache.org/schema/spring}ical>,<{http://camel.apache.org/schema/spring}idempotentConsumer>,<{http://camel.apache.org/schema/spring}inOnly>,<{http://camel.apache.org/schema/spring}inOut>,<{http://camel.apache.org/schema/spring}inputType>,<{http://camel.apache.org/schema/spring}intercept>,<{http://camel.apache.org/schema/spring}interceptFrom>,<{http://camel.apache.org/schema/spring}interceptSendToEndpoint>,<{http://camel.apache.org/schema/spring}jacksonxml>,<{http://camel.apache.org/schema/spring}javaScript>,<{http://camel.apache.org/schema/spring}jaxb>,<{http://camel.apache.org/schema/spring}jibx>,<{http://camel.apache.org/schema/spring}json>,<{http://camel.apache.org/schema/spring}jsonpath>,<{http://camel.apache.org/schema/spring}jxpath>,<{http://camel.apache.org/schema/spring}kubernetesServiceDiscovery>,<{http://camel.apache.org/schema/spring}language>,<{http://camel.apache.org/schema/spring}loadBalance>,<{http://camel.apache.org/schema/spring}loadBalancerConfiguration>,<{http://camel.apache.org/schema/spring}log>,<{http://camel.apache.org/schema/spring}loop>,<{http://camel.apache.org/schema/spring}lzf>,<{http://camel.apache.org/schema/spring}marshal>,<{http://camel.apache.org/schema/spring}method>,<{http://camel.apache.org/schema/spring}mime-multipart>,<{http://camel.apache.org/schema/spring}multiServiceDiscovery>,<{http://camel.apache.org/schema/spring}multiServiceFilter>,<{http://camel.apache.org/schema/spring}multicast>,<{http://camel.apache.org/schema/spring}mvel>,<{http://camel.apache.org/schema/spring}oauth2>,<{http://camel.apache.org/schema/spring}ognl>,<{http://camel.apache.org/schema/spring}onCompletion>,<{http://camel.apache.org/schema/spring}onException>,<{http://camel.apache.org/schema/spring}onFallback>,<{http://camel.apache.org/schema/spring}optimisticLockRetryPolicy>,<{http://camel.apache.org/schema/spring}options>,<{http://camel.apache.org/schema/spring}otherwise>,<{http://camel.apache.org/schema/spring}outputType>,<{http://camel.apache.org/schema/spring}packageScan>,<{http://camel.apache.org/schema/spring}param>,<{http://camel.apache.org/schema/spring}passThroughServiceFilter>,<{http://camel.apache.org/schema/spring}patch>,<{http://camel.apache.org/schema/spring}pgp>,<{http://camel.apache.org/schema/spring}php>,<{http://camel.apache.org/schema/spring}pipeline>,<{http://camel.apache.org/schema/spring}policy>,<{http://camel.apache.org/schema/spring}pollEnrich>,<{http://camel.apache.org/schema/spring}post>,<{http://camel.apache.org/schema/spring}process>,<{http://camel.apache.org/schema/spring}properties>,<{http://camel.apache.org/schema/spring}property>,<{http://camel.apache.org/schema/spring}protobuf>,<{http://camel.apache.org/schema/spring}put>,<{http://camel.apache.org/schema/spring}python>,<{http://camel.apache.org/schema/spring}random>,<{http://camel.apache.org/schema/spring}recipientList>,<{http://camel.apache.org/schema/spring}redeliveryPolicy>,<{http://camel.apache.org/schema/spring}ref>,<{http://camel.apache.org/schema/spring}removeHeader>,<{http://camel.apache.org/schema/spring}removeHeaders>,<{http://camel.apache.org/schema/spring}removeProperties>,<{http://camel.apache.org/schema/spring}removeProperty>,<{http://camel.apache.org/schema/spring}resequence>,<{http://camel.apache.org/schema/spring}responseHeader>,<{http://camel.apache.org/schema/spring}responseMessage>,<{http://camel.apache.org/schema/spring}rest>,<{http://camel.apache.org/schema/spring}restBinding>,<{http://camel.apache.org/schema/spring}restConfiguration>,<{http://camel.apache.org/schema/spring}restContextRef>,<{http://camel.apache.org/schema/spring}restProperty>,<{http://camel.apache.org/schema/spring}rests>,<{http://camel.apache.org/schema/spring}ribbonLoadBalancer>,<{http://camel.apache.org/schema/spring}rollback>,<{http://camel.apache.org/schema/spring}roundRobin>,<{http://camel.apache.org/schema/spring}route>,<{http://camel.apache.org/schema/spring}routeBuilder>,<{http://camel.apache.org/schema/spring}routeContextRef>,<{http://camel.apache.org/schema/spring}routes>,<{http://camel.apache.org/schema/spring}routingSlip>,<{http://camel.apache.org/schema/spring}rss>,<{http://camel.apache.org/schema/spring}ruby>,<{http://camel.apache.org/schema/spring}saga>,<{http://camel.apache.org/schema/spring}sample>,<{http://camel.apache.org/schema/spring}script>,<{http://camel.apache.org/schema/spring}secureXML>,<{http://camel.apache.org/schema/spring}security>,<{http://camel.apache.org/schema/spring}securityDefinitions>,<{http://camel.apache.org/schema/spring}serialization>,<{http://camel.apache.org/schema/spring}serviceCall>,<{http://camel.apache.org/schema/spring}serviceCallConfiguration>,<{http://camel.apache.org/schema/spring}serviceChooserConfiguration>,<{http://camel.apache.org/schema/spring}serviceDiscoveryConfiguration>,<{http://camel.apache.org/schema/spring}serviceExpression>,<{http://camel.apache.org/schema/spring}serviceFilterConfiguration>,<{http://camel.apache.org/schema/spring}setBody>,<{http://camel.apache.org/schema/spring}setExchangePattern>,<{http://camel.apache.org/schema/spring}setFaultBody>,<{http://camel.apache.org/schema/spring}setHeader>,<{http://camel.apache.org/schema/spring}setOutHeader>,<{http://camel.apache.org/schema/spring}setProperty>,<{http://camel.apache.org/schema/spring}simple>,<{http://camel.apache.org/schema/spring}soapjaxb>,<{http://camel.apache.org/schema/spring}sort>,<{http://camel.apache.org/schema/spring}spel>,<{http://camel.apache.org/schema/spring}split>,<{http://camel.apache.org/schema/spring}sql>,<{http://camel.apache.org/schema/spring}staticServiceDiscovery>,<{http://camel.apache.org/schema/spring}sticky>,<{http://camel.apache.org/schema/spring}stop>,<{http://camel.apache.org/schema/spring}stream-config>,<{http://camel.apache.org/schema/spring}string>,<{http://camel.apache.org/schema/spring}syslog>,<{http://camel.apache.org/schema/spring}tarfile>,<{http://camel.apache.org/schema/spring}terser>,<{http://camel.apache.org/schema/spring}threadPoolProfile>,<{http://camel.apache.org/schema/spring}threads>,<{http://camel.apache.org/schema/spring}thrift>,<{http://camel.apache.org/schema/spring}throttle>,<{http://camel.apache.org/schema/spring}throwException>,<{http://camel.apache.org/schema/spring}tidyMarkup>,<{http://camel.apache.org/schema/spring}to>,<{http://camel.apache.org/schema/spring}toD>,<{http://camel.apache.org/schema/spring}tokenize>,<{http://camel.apache.org/schema/spring}topic>,<{http://camel.apache.org/schema/spring}transacted>,<{http://camel.apache.org/schema/spring}transform>,<{http://camel.apache.org/schema/spring}transformers>,<{http://camel.apache.org/schema/spring}typeFilter>,<{http://camel.apache.org/schema/spring}univocity-csv>,<{http://camel.apache.org/schema/spring}univocity-fixed>,<{http://camel.apache.org/schema/spring}univocity-header>,<{http://camel.apache.org/schema/spring}univocity-tsv>,<{http://camel.apache.org/schema/spring}unmarshal>,<{http://camel.apache.org/schema/spring}validate>,<{http://camel.apache.org/schema/spring}validators>,<{http://camel.apache.org/schema/spring}verb>,<{http://camel.apache.org/schema/spring}weighted>,<{http://camel.apache.org/schema/spring}when>,<{http://camel.apache.org/schema/spring}wireTap>,<{http://camel.apache.org/schema/spring}xmlBeans>,<{http://camel.apache.org/schema/spring}xmljson>,<{http://camel.apache.org/schema/spring}xmlrpc>,<{http://camel.apache.org/schema/spring}xpath>,<{http://camel.apache.org/schema/spring}xquery>,<{http://camel.apache.org/schema/spring}xstream>,<{http://camel.apache.org/schema/spring}xtokenize>,<{http://camel.apache.org/schema/spring}yaml>,<{http://camel.apache.org/schema/spring}zip>,<{http://camel.apache.org/schema/spring}zipFile>,<{http://camel.apache.org/schema/spring}zookeeperServiceDiscovery>
[1] 2019-06-07 20:31:59.566 DEBUG [main] XmlLoader - Unable to load RestsDefinition: unexpected element (uri:"http://camel.apache.org/schema/spring", local:"camelContext"). Expected elements are <{http://camel.apache.org/schema/spring}aggregate>,<{http://camel.apache.org/schema/spring}aop>,<{http://camel.apache.org/schema/spring}apiKey>,<{http://camel.apache.org/schema/spring}asn1>,<{http://camel.apache.org/schema/spring}avro>,<{http://camel.apache.org/schema/spring}barcode>,<{http://camel.apache.org/schema/spring}base64>,<{http://camel.apache.org/schema/spring}basicAuth>,<{http://camel.apache.org/schema/spring}batch-config>,<{http://camel.apache.org/schema/spring}bean>,<{http://camel.apache.org/schema/spring}beanio>,<{http://camel.apache.org/schema/spring}bindy>,<{http://camel.apache.org/schema/spring}blacklistServiceFilter>,<{http://camel.apache.org/schema/spring}boon>,<{http://camel.apache.org/schema/spring}cachingServiceDiscovery>,<{http://camel.apache.org/schema/spring}castor>,<{http://camel.apache.org/schema/spring}choice>,<{http://camel.apache.org/schema/spring}circuitBreaker>,<{http://camel.apache.org/schema/spring}claimCheck>,<{http://camel.apache.org/schema/spring}combinedServiceDiscovery>,<{http://camel.apache.org/schema/spring}combinedServiceFilter>,<{http://camel.apache.org/schema/spring}constant>,<{http://camel.apache.org/schema/spring}consulServiceDiscovery>,<{http://camel.apache.org/schema/spring}contextScan>,<{http://camel.apache.org/schema/spring}convertBodyTo>,<{http://camel.apache.org/schema/spring}crypto>,<{http://camel.apache.org/schema/spring}csv>,<{http://camel.apache.org/schema/spring}customDataFormat>,<{http://camel.apache.org/schema/spring}customLoadBalancer>,<{http://camel.apache.org/schema/spring}customServiceFilter>,<{http://camel.apache.org/schema/spring}dataFormats>,<{http://camel.apache.org/schema/spring}defaultLoadBalancer>,<{http://camel.apache.org/schema/spring}delay>,<{http://camel.apache.org/schema/spring}delete>,<{http://camel.apache.org/schema/spring}description>,<{http://camel.apache.org/schema/spring}dnsServiceDiscovery>,<{http://camel.apache.org/schema/spring}doCatch>,<{http://camel.apache.org/schema/spring}doFinally>,<{http://camel.apache.org/schema/spring}doTry>,<{http://camel.apache.org/schema/spring}dynamicRouter>,<{http://camel.apache.org/schema/spring}el>,<{http://camel.apache.org/schema/spring}enrich>,<{http://camel.apache.org/schema/spring}etcdServiceDiscovery>,<{http://camel.apache.org/schema/spring}exchangeProperty>,<{http://camel.apache.org/schema/spring}expression>,<{http://camel.apache.org/schema/spring}expressionDefinition>,<{http://camel.apache.org/schema/spring}failover>,<{http://camel.apache.org/schema/spring}fhirJson>,<{http://camel.apache.org/schema/spring}fhirXml>,<{http://camel.apache.org/schema/spring}filter>,<{http://camel.apache.org/schema/spring}flatpack>,<{http://camel.apache.org/schema/spring}from>,<{http://camel.apache.org/schema/spring}get>,<{http://camel.apache.org/schema/spring}globalOption>,<{http://camel.apache.org/schema/spring}globalOptions>,<{http://camel.apache.org/schema/spring}groovy>,<{http://camel.apache.org/schema/spring}gzip>,<{http://camel.apache.org/schema/spring}head>,<{http://camel.apache.org/schema/spring}header>,<{http://camel.apache.org/schema/spring}healthyServiceFilter>,<{http://camel.apache.org/schema/spring}hessian>,<{http://camel.apache.org/schema/spring}hl7>,<{http://camel.apache.org/schema/spring}hystrix>,<{http://camel.apache.org/schema/spring}hystrixConfiguration>,<{http://camel.apache.org/schema/spring}ical>,<{http://camel.apache.org/schema/spring}idempotentConsumer>,<{http://camel.apache.org/schema/spring}inOnly>,<{http://camel.apache.org/schema/spring}inOut>,<{http://camel.apache.org/schema/spring}inputType>,<{http://camel.apache.org/schema/spring}intercept>,<{http://camel.apache.org/schema/spring}interceptFrom>,<{http://camel.apache.org/schema/spring}interceptSendToEndpoint>,<{http://camel.apache.org/schema/spring}jacksonxml>,<{http://camel.apache.org/schema/spring}javaScript>,<{http://camel.apache.org/schema/spring}jaxb>,<{http://camel.apache.org/schema/spring}jibx>,<{http://camel.apache.org/schema/spring}json>,<{http://camel.apache.org/schema/spring}jsonpath>,<{http://camel.apache.org/schema/spring}jxpath>,<{http://camel.apache.org/schema/spring}kubernetesServiceDiscovery>,<{http://camel.apache.org/schema/spring}language>,<{http://camel.apache.org/schema/spring}loadBalance>,<{http://camel.apache.org/schema/spring}loadBalancerConfiguration>,<{http://camel.apache.org/schema/spring}log>,<{http://camel.apache.org/schema/spring}loop>,<{http://camel.apache.org/schema/spring}lzf>,<{http://camel.apache.org/schema/spring}marshal>,<{http://camel.apache.org/schema/spring}method>,<{http://camel.apache.org/schema/spring}mime-multipart>,<{http://camel.apache.org/schema/spring}multiServiceDiscovery>,<{http://camel.apache.org/schema/spring}multiServiceFilter>,<{http://camel.apache.org/schema/spring}multicast>,<{http://camel.apache.org/schema/spring}mvel>,<{http://camel.apache.org/schema/spring}oauth2>,<{http://camel.apache.org/schema/spring}ognl>,<{http://camel.apache.org/schema/spring}onCompletion>,<{http://camel.apache.org/schema/spring}onException>,<{http://camel.apache.org/schema/spring}onFallback>,<{http://camel.apache.org/schema/spring}optimisticLockRetryPolicy>,<{http://camel.apache.org/schema/spring}options>,<{http://camel.apache.org/schema/spring}otherwise>,<{http://camel.apache.org/schema/spring}outputType>,<{http://camel.apache.org/schema/spring}packageScan>,<{http://camel.apache.org/schema/spring}param>,<{http://camel.apache.org/schema/spring}passThroughServiceFilter>,<{http://camel.apache.org/schema/spring}patch>,<{http://camel.apache.org/schema/spring}pgp>,<{http://camel.apache.org/schema/spring}php>,<{http://camel.apache.org/schema/spring}pipeline>,<{http://camel.apache.org/schema/spring}policy>,<{http://camel.apache.org/schema/spring}pollEnrich>,<{http://camel.apache.org/schema/spring}post>,<{http://camel.apache.org/schema/spring}process>,<{http://camel.apache.org/schema/spring}properties>,<{http://camel.apache.org/schema/spring}property>,<{http://camel.apache.org/schema/spring}protobuf>,<{http://camel.apache.org/schema/spring}put>,<{http://camel.apache.org/schema/spring}python>,<{http://camel.apache.org/schema/spring}random>,<{http://camel.apache.org/schema/spring}recipientList>,<{http://camel.apache.org/schema/spring}redeliveryPolicy>,<{http://camel.apache.org/schema/spring}ref>,<{http://camel.apache.org/schema/spring}removeHeader>,<{http://camel.apache.org/schema/spring}removeHeaders>,<{http://camel.apache.org/schema/spring}removeProperties>,<{http://camel.apache.org/schema/spring}removeProperty>,<{http://camel.apache.org/schema/spring}resequence>,<{http://camel.apache.org/schema/spring}responseHeader>,<{http://camel.apache.org/schema/spring}responseMessage>,<{http://camel.apache.org/schema/spring}rest>,<{http://camel.apache.org/schema/spring}restBinding>,<{http://camel.apache.org/schema/spring}restConfiguration>,<{http://camel.apache.org/schema/spring}restContextRef>,<{http://camel.apache.org/schema/spring}restProperty>,<{http://camel.apache.org/schema/spring}rests>,<{http://camel.apache.org/schema/spring}ribbonLoadBalancer>,<{http://camel.apache.org/schema/spring}rollback>,<{http://camel.apache.org/schema/spring}roundRobin>,<{http://camel.apache.org/schema/spring}route>,<{http://camel.apache.org/schema/spring}routeBuilder>,<{http://camel.apache.org/schema/spring}routeContextRef>,<{http://camel.apache.org/schema/spring}routes>,<{http://camel.apache.org/schema/spring}routingSlip>,<{http://camel.apache.org/schema/spring}rss>,<{http://camel.apache.org/schema/spring}ruby>,<{http://camel.apache.org/schema/spring}saga>,<{http://camel.apache.org/schema/spring}sample>,<{http://camel.apache.org/schema/spring}script>,<{http://camel.apache.org/schema/spring}secureXML>,<{http://camel.apache.org/schema/spring}security>,<{http://camel.apache.org/schema/spring}securityDefinitions>,<{http://camel.apache.org/schema/spring}serialization>,<{http://camel.apache.org/schema/spring}serviceCall>,<{http://camel.apache.org/schema/spring}serviceCallConfiguration>,<{http://camel.apache.org/schema/spring}serviceChooserConfiguration>,<{http://camel.apache.org/schema/spring}serviceDiscoveryConfiguration>,<{http://camel.apache.org/schema/spring}serviceExpression>,<{http://camel.apache.org/schema/spring}serviceFilterConfiguration>,<{http://camel.apache.org/schema/spring}setBody>,<{http://camel.apache.org/schema/spring}setExchangePattern>,<{http://camel.apache.org/schema/spring}setFaultBody>,<{http://camel.apache.org/schema/spring}setHeader>,<{http://camel.apache.org/schema/spring}setOutHeader>,<{http://camel.apache.org/schema/spring}setProperty>,<{http://camel.apache.org/schema/spring}simple>,<{http://camel.apache.org/schema/spring}soapjaxb>,<{http://camel.apache.org/schema/spring}sort>,<{http://camel.apache.org/schema/spring}spel>,<{http://camel.apache.org/schema/spring}split>,<{http://camel.apache.org/schema/spring}sql>,<{http://camel.apache.org/schema/spring}staticServiceDiscovery>,<{http://camel.apache.org/schema/spring}sticky>,<{http://camel.apache.org/schema/spring}stop>,<{http://camel.apache.org/schema/spring}stream-config>,<{http://camel.apache.org/schema/spring}string>,<{http://camel.apache.org/schema/spring}syslog>,<{http://camel.apache.org/schema/spring}tarfile>,<{http://camel.apache.org/schema/spring}terser>,<{http://camel.apache.org/schema/spring}threadPoolProfile>,<{http://camel.apache.org/schema/spring}threads>,<{http://camel.apache.org/schema/spring}thrift>,<{http://camel.apache.org/schema/spring}throttle>,<{http://camel.apache.org/schema/spring}throwException>,<{http://camel.apache.org/schema/spring}tidyMarkup>,<{http://camel.apache.org/schema/spring}to>,<{http://camel.apache.org/schema/spring}toD>,<{http://camel.apache.org/schema/spring}tokenize>,<{http://camel.apache.org/schema/spring}topic>,<{http://camel.apache.org/schema/spring}transacted>,<{http://camel.apache.org/schema/spring}transform>,<{http://camel.apache.org/schema/spring}transformers>,<{http://camel.apache.org/schema/spring}typeFilter>,<{http://camel.apache.org/schema/spring}univocity-csv>,<{http://camel.apache.org/schema/spring}univocity-fixed>,<{http://camel.apache.org/schema/spring}univocity-header>,<{http://camel.apache.org/schema/spring}univocity-tsv>,<{http://camel.apache.org/schema/spring}unmarshal>,<{http://camel.apache.org/schema/spring}validate>,<{http://camel.apache.org/schema/spring}validators>,<{http://camel.apache.org/schema/spring}verb>,<{http://camel.apache.org/schema/spring}weighted>,<{http://camel.apache.org/schema/spring}when>,<{http://camel.apache.org/schema/spring}wireTap>,<{http://camel.apache.org/schema/spring}xmlBeans>,<{http://camel.apache.org/schema/spring}xmljson>,<{http://camel.apache.org/schema/spring}xmlrpc>,<{http://camel.apache.org/schema/spring}xpath>,<{http://camel.apache.org/schema/spring}xquery>,<{http://camel.apache.org/schema/spring}xstream>,<{http://camel.apache.org/schema/spring}xtokenize>,<{http://camel.apache.org/schema/spring}yaml>,<{http://camel.apache.org/schema/spring}zip>,<{http://camel.apache.org/schema/spring}zipFile>,<{http://camel.apache.org/schema/spring}zookeeperServiceDiscovery>
[1] 2019-06-07 20:31:59.569 INFO  [main] DefaultCamelContext - Apache Camel 2.23.2 (CamelContext: camel-k) is starting
[1] 2019-06-07 20:31:59.574 INFO  [main] ManagedManagementStrategy - JMX is enabled
[1] 2019-06-07 20:31:59.726 INFO  [main] DefaultCamelContext - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
[1] 2019-06-07 20:31:59.728 INFO  [main] DefaultCamelContext - Total 0 routes, of which 0 are started
[1] 2019-06-07 20:31:59.729 INFO  [main] DefaultCamelContext - Apache Camel 2.23.2 (CamelContext: camel-k) started in 0.160 seconds

@lburgazzoli
Copy link
Contributor

lburgazzoli commented Jun 7, 2019 via email

@WillemJiang
Copy link
Member

It looks this current XmlLoader doesn't support to load the different fragments at the same time.
@ewcchan Could you try to spilte the camel context into two separated fragments as the unit test does?

@ewcchan
Copy link
Author

ewcchan commented Jun 10, 2019

I tried with separating the rest fragments out in its standalone xml.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rests xmlns="http://camel.apache.org/schema/spring">
  <restConfiguration component="restlet" port="8081" host="127.0.0.1"/>	
  <rest path="/api/demo2">
     <post>
        <to uri="direct:handleRestRequest"/>
     </post>
  </rest>  
</rests>

however the port and host are not consumed.

[1] OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
[1] 2019-06-10 16:34:26.747 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.ContextConfigurer@3c407114
[1] 2019-06-10 16:34:26.755 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.ContextLifecycleConfigurer@7714e963
[1] 2019-06-10 16:34:26.757 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.RoutesConfigurer@55b7a4e0
[1] 2019-06-10 16:34:26.758 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.RoutesDumper@72057ecf
[1] 2019-06-10 16:34:26.813 INFO  [main] RoutesConfigurer - Loading routes from: file:/etc/camel/sources/i-source-000/rests.xml?language=xml
[1] 2019-06-10 16:34:26.893 INFO  [main] DefaultTypeConverter - Type converters loaded (core: 195, classpath: 10)
[1] 2019-06-10 16:34:27.962 DEBUG [main] XmlLoader - Loaded 1 rests from Source{location='file:/etc/camel/sources/i-source-000/rests.xml', language=xml, compressed=false}
[1] 2019-06-10 16:34:27.982 INFO  [main] DefaultCamelContext - Apache Camel 2.23.2 (CamelContext: camel-k) is starting
[1] 2019-06-10 16:34:27.984 INFO  [main] ManagedManagementStrategy - JMX is enabled
[1] 2019-06-10 16:34:28.211 INFO  [main] DefaultCamelContext - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
[1] 2019-06-10 16:34:28.376 INFO  [main] DefaultCamelContext - Route: route1 started and consuming from: restlet:///api/demo2?restletMethods=POST
[1] 2019-06-10 16:34:28.377 INFO  [main] DefaultCamelContext - Total 1 routes, of which 1 are started
[1] 2019-06-10 16:34:28.379 INFO  [main] DefaultCamelContext - Apache Camel 2.23.2 (CamelContext: camel-k) started in 0.396 seconds
[1] 2019-06-10 16:34:28.595 DEBUG [main] RoutesDumper - Routes: 
[1] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
[1] <routes xmlns="http://camel.apache.org/schema/spring">
[1]     <route customId="false" id="route1" rest="true">
[1]         <from uri="rest://post:/api/demo2?routeId=route1"/>
[1]         <to id="to1" uri="direct:handleRestRequest"/>
[1]     </route>
[1] </routes>
[1] 
[1] 2019-06-10 16:34:28.731 DEBUG [main] RoutesDumper - Rests: 
[1] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
[1] <rests xmlns="http://camel.apache.org/schema/spring">
[1]     <rest path="/api/demo2">
[1]         <post id="verb1" routeId="route1">
[1]             <to id="to1" uri="direct:handleRestRequest"/>
[1]         </post>
[1]     </rest>
[1] </rests>
[1] 

@WillemJiang
Copy link
Member

@ewcchan you cannot use the "127.0.0.1" as the address for the restlet to listen if you deploy the serivce into K8s unless you use servicemesh. Please change it to "0.0.0.0", then you can access the service with the pod IP.

@ewcchan
Copy link
Author

ewcchan commented Jun 11, 2019

I tried with 0.0.0.0 and it does not work neither...

ubuntu@eugene-kamel-dev:~/repos/demos/camel-atlasmap-demo3$ cat rests.xml 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rests xmlns="http://camel.apache.org/schema/spring">
  <restConfiguration component="restlet" port="8081" host="0.0.0.0"/>	
  <rest path="/api/demo2">
     <post>
        <to uri="direct:handleRestRequest"/>
     </post>
  </rest>  
</rests>

ubuntu@eugene-kamel-dev:~/repos/demos/camel-atlasmap-demo3$ kamel run --name=demo3-atlasmap --resource atlasmapping-UI.795711.json --dependency mvn:io.atlasmap/camel-atlasmap:1.40.0-alpha2 --dependency camel-restlet --logging-level org.apache.camel.k=DEBUG --dev rests.xml
integration "demo3-atlasmap" created
integration "demo3-atlasmap" in phase Building Context
integration "demo3-atlasmap" in phase Deploying
integration "demo3-atlasmap" in phase Running
[1] Monitoring pod demo3-atlasmap-78b6c69f4-vs9lt[1] Starting the Java application using /opt/run-java/run-java.sh ...
[1] exec java -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:+ExitOnOutOfMemoryError -cp ./resources:/etc/camel/conf:/etc/camel/resources:/etc/camel/resources/i-resource-000:/etc/camel/sources/i-source-000:dependencies/com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar:dependencies/com.fasterxml.jackson.core.jackson-core-2.8.11.jar:dependencies/com.fasterxml.jackson.core.jackson-databind-2.8.11.3.jar:dependencies/com.fasterxml.jackson.module.jackson-module-jsonSchema-2.8.11.jar:dependencies/com.sun.xml.bind.jaxb-core-2.3.0.jar:dependencies/com.sun.xml.bind.jaxb-impl-2.3.0.jar:dependencies/com.sun.xsom.xsom-20140925.jar:dependencies/commons-codec.commons-codec-1.5.jar:dependencies/commons-io.commons-io-2.6.jar:dependencies/commons-logging.commons-logging-1.1.3.jar:dependencies/io.atlasmap.atlas-api-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-core-1.40.0-alpha2-tests.jar:dependencies/io.atlasmap.atlas-core-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-expression-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-java-core-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-java-model-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-java-module-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-json-core-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-json-model-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-json-module-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-model-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-xml-core-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-xml-model-1.40.0-alpha2.jar:dependencies/io.atlasmap.atlas-xml-module-1.40.0-alpha2.jar:dependencies/io.atlasmap.camel-atlasmap-1.40.0-alpha2.jar:dependencies/javax.servlet.javax.servlet-api-3.1.0.jar:dependencies/javax.validation.validation-api-1.1.0.Final.jar:dependencies/net.jcip.jcip-annotations-1.0.jar:dependencies/org.apache.camel.camel-core-2.23.2.jar:dependencies/org.apache.camel.camel-http-common-2.23.2.jar:dependencies/org.apache.camel.camel-restlet-2.23.2.jar:dependencies/org.apache.camel.k.camel-k-adapter-camel-2-0.3.2.jar:dependencies/org.apache.camel.k.camel-k-runtime-core-0.3.2.jar:dependencies/org.apache.camel.k.camel-k-runtime-jvm-0.3.2.jar:dependencies/org.apache.commons.commons-lang3-3.8.1.jar:dependencies/org.apache.httpcomponents.httpclient-4.3.2.jar:dependencies/org.apache.httpcomponents.httpcore-4.3.1.jar:dependencies/org.apache.httpcomponents.httpmime-4.3.jar:dependencies/org.apache.james.apache-mime4j-core-0.7.2.jar:dependencies/org.apache.logging.log4j.log4j-api-2.11.2.jar:dependencies/org.apache.logging.log4j.log4j-core-2.11.2.jar:dependencies/org.apache.logging.log4j.log4j-slf4j-impl-2.11.2.jar:dependencies/org.jooq.joor-java-8-0.9.10.jar:dependencies/org.restlet.jee.org.restlet-2.3.12.jar:dependencies/org.restlet.jee.org.restlet.ext.httpclient-2.3.12.jar:dependencies/org.slf4j.slf4j-api-1.7.25.jar:dependencies/relaxngDatatype.relaxngDatatype-20020414.jar org.apache.camel.k.jvm.Application
[1] OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
[1] 2019-06-11 01:52:35.542 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.ContextConfigurer@1d9b7cce
[1] 2019-06-11 01:52:35.551 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.ContextLifecycleConfigurer@661972b0
[1] 2019-06-11 01:52:35.553 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.RoutesConfigurer@2e005c4b
[1] 2019-06-11 01:52:35.554 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.RoutesDumper@6356695f
[1] 2019-06-11 01:52:35.602 INFO  [main] RoutesConfigurer - Loading routes from: file:/etc/camel/sources/i-source-000/rests.xml?language=xml
[1] 2019-06-11 01:52:35.681 INFO  [main] DefaultTypeConverter - Type converters loaded (core: 195, classpath: 10)
[1] 2019-06-11 01:52:36.855 DEBUG [main] XmlLoader - Loaded 1 rests from Source{location='file:/etc/camel/sources/i-source-000/rests.xml', language=xml, compressed=false}
[1] 2019-06-11 01:52:36.877 INFO  [main] DefaultCamelContext - Apache Camel 2.23.2 (CamelContext: camel-k) is starting
[1] 2019-06-11 01:52:36.881 INFO  [main] ManagedManagementStrategy - JMX is enabled
[1] 2019-06-11 01:52:37.107 INFO  [main] DefaultCamelContext - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
[1] 2019-06-11 01:52:37.274 INFO  [main] DefaultCamelContext - Route: route1 started and consuming from: restlet:///api/demo2?restletMethods=POST
[1] 2019-06-11 01:52:37.275 INFO  [main] DefaultCamelContext - Total 1 routes, of which 1 are started
[1] 2019-06-11 01:52:37.276 INFO  [main] DefaultCamelContext - Apache Camel 2.23.2 (CamelContext: camel-k) started in 0.398 seconds
[1] 2019-06-11 01:52:37.511 DEBUG [main] RoutesDumper - Routes: 
[1] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
[1] <routes xmlns="http://camel.apache.org/schema/spring">
[1]     <route customId="false" id="route1" rest="true">
[1]         <from uri="rest://post:/api/demo2?routeId=route1"/>
[1]         <to id="to1" uri="direct:handleRestRequest"/>
[1]     </route>
[1] </routes>
[1] 
[1] 2019-06-11 01:52:37.666 DEBUG [main] RoutesDumper - Rests: 
[1] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
[1] <rests xmlns="http://camel.apache.org/schema/spring">
[1]     <rest path="/api/demo2">
[1]         <post id="verb1" routeId="route1">
[1]             <to id="to1" uri="direct:handleRestRequest"/>
[1]         </post>
[1]     </rest>
[1] </rests>
[1] 

I dont see the port and host in the restlet output
[1] 2019-06-11 01:52:37.274 INFO [main] DefaultCamelContext - Route: route1 started and consuming from: restlet:///api/demo2?restletMethods=POST

@WillemJiang
Copy link
Member

WillemJiang commented Jun 11, 2019

It looks like the restConfiguration part is not loaded yet. For the Rest routes, there are RestConfigurationDefinition, RestSecuritiesDefinition need to be loaded. Current XmlLoader doesn't support it. As the spring boot runtime support is removed from camel-k-runtime, we need to figure out how to provide fully support of XML DSL.

@lburgazzoli
Copy link
Contributor

For what IO can see, camel's RestsDefinition ModelCamelContext::loadRestsDefinition(InputStream is) does not take into account any rest configuration, in camel k you can configure rest using properties with prefix camel.rest.

@ewcchan
Copy link
Author

ewcchan commented Jun 11, 2019

Thanks @lburgazzoli and @WillemJiang, with --property camel.rest.port=8081 --property camel.rest.host=0.0.0. The restlet is correctly loaded with the request configuration setup.

[1] OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
[1] 2019-06-11 16:07:58.578 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.ContextConfigurer@3daa422a
[1] 2019-06-11 16:07:58.587 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.ContextLifecycleConfigurer@50eac852
[1] 2019-06-11 16:07:58.589 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.RoutesConfigurer@6a192cfe
[1] 2019-06-11 16:07:58.590 INFO  [main] ApplicationRuntime - Add listener: org.apache.camel.k.listener.RoutesDumper@20deea7f
[1] 2019-06-11 16:07:58.651 INFO  [main] RoutesConfigurer - Loading routes from: file:/etc/camel/sources/i-source-000/rests.xml?language=xml
[1] 2019-06-11 16:07:58.736 INFO  [main] DefaultTypeConverter - Type converters loaded (core: 195, classpath: 10)
[1] 2019-06-11 16:07:59.952 DEBUG [main] XmlLoader - Loaded 1 rests from Source{location='file:/etc/camel/sources/i-source-000/rests.xml', language=xml, compressed=false}
[1] 2019-06-11 16:07:59.965 INFO  [main] DefaultCamelContext - Apache Camel 2.23.2 (CamelContext: camel-k) is starting
[1] 2019-06-11 16:07:59.970 INFO  [main] ManagedManagementStrategy - JMX is enabled
[1] 2019-06-11 16:08:00.235 INFO  [main] DefaultCamelContext - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
[1] Jun 11, 2019 4:08:00 PM org.restlet.engine.connector.NetServerHelper start
[1] INFO: Starting the internal [HTTP/1.1] server on port 8081
[1] 2019-06-11 16:08:00.428 INFO  [main] DefaultCamelContext - Route: route1 started and consuming from: restlet://http://0.0.0.0:8081/api/demo2?restletMethods=GET
[1] 2019-06-11 16:08:00.430 INFO  [main] DefaultCamelContext - Total 1 routes, of which 1 are started
[1] 2019-06-11 16:08:00.431 INFO  [main] DefaultCamelContext - Apache Camel 2.23.2 (CamelContext: camel-k) started in 0.465 seconds
[1] 2019-06-11 16:08:00.665 DEBUG [main] RoutesDumper - Routes: 
[1] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
[1] <routes xmlns="http://camel.apache.org/schema/spring">
[1]     <route customId="false" id="route1" rest="true">
[1]         <from uri="rest://get:/api/demo2?routeId=route1"/>
[1]         <to id="to1" uri="direct:handleRestRequest"/>
[1]     </route>
[1] </routes>
[1] 
[1] 2019-06-11 16:08:00.799 DEBUG [main] RoutesDumper - Rests: 
[1] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
[1] <rests xmlns="http://camel.apache.org/schema/spring">
[1]     <rest path="/api/demo2">
[1]         <get id="verb1" routeId="route1">
[1]             <to id="to1" uri="direct:handleRestRequest"/>
[1]         </get>
[1]     </rest>
[1] </rests>
[1] 
[1] Jun 11, 2019 4:11:00 PM org.restlet.engine.log.LogFilter afterHandle
[1] INFO: 2019-06-11	16:11:00	127.0.0.1	-	0.0.0.0	8081	GET	/api/demo3	-	404	439	015	http://0.0.0.0:8081	curl/7.29.0	-
^[[A[1] Jun 11, 2019 4:11:16 PM org.restlet.engine.log.LogFilter afterHandle
[1] INFO: 2019-06-11	16:11:16	127.0.0.1	-	0.0.0.0	8081	GET	/api/demo3	-	404	439	01	http://0.0.0.0:8081	curl/7.29.0	-

@WillemJiang
Copy link
Member

I found that camel-k JVM runtime setup the RestConfiguration through RuntimeSupport.configureRest()

@lburgazzoli
Copy link
Contributor

@ewcchan can we close this ?

@lburgazzoli lburgazzoli added the status/waiting-for-feedback Needs some feedback label Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/waiting-for-feedback Needs some feedback
Projects
None yet
Development

No branches or pull requests

3 participants