camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-8545) Allow camel-swagger component to run in an internal container
Date Tue, 22 Sep 2015 14:03:04 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-8545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14902680#comment-14902680
] 

Claus Ibsen commented on CAMEL-8545:
------------------------------------

I am working on this. I hope I get this implemented so you just add camel-swagger-java and
configure an api context path, and you get the swagger api out of the box, using the rest
component you have chosen.


> Allow camel-swagger component to run in an internal container
> -------------------------------------------------------------
>
>                 Key: CAMEL-8545
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8545
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-swagger, rest
>    Affects Versions: 2.14.1
>         Environment: All
>            Reporter: Karl Openet
>            Assignee: Claus Ibsen
>             Fix For: 2.16.0
>
>
> I use camel as a front end to provide a RESTful API in front of a mix of various web
services. Requests come in in either xml or json, and are converted to xml, transformed and
sent on to the back end services which only support an RPC style.
> I use rest dsl with configuration via spring xml, and it runs in a java process.
> {noformat}
>   <restConfiguration bindingMode="auto" component="jetty" host="localhost" port="18910"/>
> {noformat}
> I would love to use the camel-swagger component to provide a live API document of the
Rest API's configured, but it seems that it is not possible without configuring a web.xml
file.
> Is this feasible? Is there an alternative to document the Rest API the camel context
provides?
> Camel-context below.
> {noformat}
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:camel="http://camel.apache.org/schema/spring"
>        xmlns:cxf="http://camel.apache.org/schema/cxf"
>        xmlns:context="http://www.springframework.org/schema/context"
>        xsi:schemaLocation="
>        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
>        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
>        http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd">
>                   
>   <import resource="classpath:META-INF/spring/jolokia.xml"/>    
>                                                              
>   <bean id="metricsRoutePolicyFactory" class="org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicyFactory"/>
>   <camelContext xmlns="http://camel.apache.org/schema/spring">
>     <properties>
>         <property key="CamelLogDebugBodyStreams" value="true"/>
>    </properties>
>     <propertyPlaceholder location="classpath:incident.properties,file:target/custom.properties"
id="properties"/>
>     
> 	<endpoint uri="jetty:http://localhost:28950/ig?bridgeEndpoint=true" id="jsonEndpoint"/>
> 	<endpoint uri="cxf:http://localhost:28960/ig?dataFormat=PAYLOAD&amp;wsdlURL=http://localhost:28960/ig?WSDL&amp;loggingFeatureEnabled=true"
id="soapEndpoint"/>         
> 	<dataFormats>
>     		<xmljson id="xmljson" forceTopLevelObject="true" removeNamespacePrefixes="true"/>
>     		<xmljson id="xmljsonWithOptions" trimSpaces="true" skipNamespaces="true"
>              removeNamespacePrefixes="true"/>
> 	</dataFormats>
>     <restConfiguration bindingMode="auto" component="jetty" host="localhost" port="18910"/>
>   <rest path="/SubscriberProfilesJson/" consumes="application/json">
>     <get uri="/{SubscriberId}">
>       <to uri="direct:GetProfileJson"/>
>     </get>
>     <post uri="/{SubscriberId}/Subscriptions" consumes="application/json">
>       <to uri="direct:CreateSubscriptionJson"/>
>     </post>
>     <get uri="/{SubscriberId}/Subscriptions" consumes="application/json">
>       <to uri="direct:GetSubscriptionsJson"/>
>     </get>
>   </rest>
>   
>   <rest path="/SubscriberProfilesXml/" consumes="application/xml">
>     <get uri="/{SubscriberId}">
>       <to uri="direct:GetProfile"/>
>     </get>
>     <get uri="/{SubscriberId}/Subscriptions" consumes="application/xml">
>       <to uri="direct:GetSubscriptions"/>
>     </get>
>     <post uri="/{SubscriberId}/Subscriptions" consumes="application/xml">
>       <to uri="direct:CreateSubscription"/>
>     </post>
>   </rest>
>   
>   <rest path="/SubscriberProfilesJsonConvert/" consumes="application/json">
>     <get uri="/{SubscriberId}/Subscriptions" consumes="application/json">
>       <to uri="direct:GetSubscriptionsJsonConvert"/>
>     </get>
>   </rest>
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message