Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 26A73117BC for ; Sun, 10 Aug 2014 10:18:22 +0000 (UTC) Received: (qmail 10958 invoked by uid 500); 10 Aug 2014 10:18:22 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 10900 invoked by uid 500); 10 Aug 2014 10:18:22 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 10889 invoked by uid 99); 10 Aug 2014 10:18:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Aug 2014 10:18:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Aug 2014 10:17:55 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A6A852388868 for ; Sun, 10 Aug 2014 10:17:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r918932 - in /websites/production/camel/content: cache/main.pageCache rest-dsl.html swagger.html Date: Sun, 10 Aug 2014 10:17:52 -0000 To: commits@camel.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140810101752.A6A852388868@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Sun Aug 10 10:17:52 2014 New Revision: 918932 Log: Production update by buildbot for camel Added: websites/production/camel/content/swagger.html Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/rest-dsl.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/rest-dsl.html ============================================================================== --- websites/production/camel/content/rest-dsl.html (original) +++ websites/production/camel/content/rest-dsl.html Sun Aug 10 10:17:52 2014 @@ -249,7 +249,7 @@ public class UserPojo {


And with XML DSL

-


You can configure properties on these levels. 

  • component - Is used to set any options on the Component class. You can also configure these directly on the component.
  • endpoint - Is used set any option on the endpoint level. Many of the Camel components has many options you can set on endpoint level.
  • consumer - Is used to set any option on the consumer level. Some components has consumer options, which you can also configure from endpoint level by prefixing the option with "consumer." 
  • data format - Is used to set any option on the data formats. For example to enable pretty print in the json data format.

You can set multiple options of the same level, so you can can for example configure 2 component options, and 3 endpoint options etc.

Integration a Camel component with Rest DSL

Any Apache Camel component can integrate with the Rest DSL if they can be used as a REST service (eg as a REST consumer in Camel lingo). To integrate with the Rest DSL, then the component should implement the org.apache.camel.spi.RestConsumerFactory. The Rest DSL will then invoke the createConsumer method when it setup the Camel routes from the defined DSL. The component should then implement logic to create a Camel consumer that exposes the REST services based on the given parameters, such as path, verb, and other options. For example see the source code for camel-restlet, camel-spark-rest.

 

See Also

DSL

Rest

Spark-rest

How do I import rests from other XML files

+


You can configure properties on these levels. 

  • component - Is used to set any options on the Component class. You can also configure these directly on the component.
  • endpoint - Is used set any option on the endpoint level. Many of the Camel components has many options you can set on endpoint level.
  • consumer - Is used to set any option on the consumer level. Some components has consumer options, which you can also configure from endpoint level by prefixing the option with "consumer." 
  • data format - Is used to set any option on the data formats. For example to enable pretty print in the json data format.

You can set multiple options of the same level, so you can can for example configure 2 component options, and 3 endpoint options etc.

Integration a Camel component with Rest DSL

Any Apache Camel component can integrate with the Rest DSL if they can be used as a REST service (eg as a REST consumer in Camel lingo). To integrate with the Rest DSL, then the component should implement the org.apache.camel.spi.RestConsumerFactory. The Rest DSL will then invoke the createConsumer method when it setup the Camel routes from the defined DSL. The component should then implement logic to create a Camel consumer that exposes the REST services based on the given parameters, such as path, verb, and other options. For example see the source code for camel-restlet, camel-spark-rest.

Swagger API

The Rest DSL supports Swagger by the camel-swagger module. See more details at  Swagger and the camel-example-servlet-rest-tomcat example from the Apache Camel distribution.

See Also

DSL

Rest

Swagger

Spark-rest

How do I import rests from other XML files