You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2016/04/09 23:26:45 UTC

svn commit: r985216 [4/4] - in /websites/production/camel/content: ./ 2016/04/ 2016/04/09/ cache/

Modified: websites/production/camel/content/spark-rest.html
==============================================================================
--- websites/production/camel/content/spark-rest.html (original)
+++ websites/production/camel/content/spark-rest.html Sat Apr  9 21:26:44 2016
@@ -117,8 +117,7 @@
         }
     };]]></script>
 </div></div>
-</div>
-<div class="tabs-pane" id="RestDslTabsXml" data-pane-title="XML">
+</div><div class="tabs-pane" id="RestDslTabsXml" data-pane-title="XML">
     <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[  &lt;camelContext xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
     &lt;rest uri=&quot;/hello/{me}&quot;&gt;
@@ -134,8 +133,7 @@
 </div></div>
 </div>
 </div>
-<div style="clear:both"><p> </p></div>
-<p><span style="line-height: 1.4285715;">See more details at the&#160;</span><a shape="rect" href="rest-dsl.html">Rest DSL</a><span style="line-height: 1.4285715;">.</span></p><h3 id="Spark-rest-Moreexamples"><span style="font-size: 16.0px;line-height: 1.5625;">More examples</span></h3><p>There is a <strong>camel-example-spark-rest-tomcat</strong> example in the Apache Camel distribution, that demonstrates how to use camel-spark-rest in a web application that can be deployed on Apache Tomcat, or similar web containers.</p><p></p><h3 id="Spark-rest-SeeAlso">See Also</h3>
+<div style="clear:both"><p> </p></div><p><span style="line-height: 1.4285715;">See more details at the&#160;</span><a shape="rect" href="rest-dsl.html">Rest DSL</a><span style="line-height: 1.4285715;">.</span></p><h3 id="Spark-rest-Moreexamples"><span style="font-size: 16.0px;line-height: 1.5625;">More examples</span></h3><p>There is a <strong>camel-example-spark-rest-tomcat</strong> example in the Apache Camel distribution, that demonstrates how to use camel-spark-rest in a web application that can be deployed on Apache Tomcat, or similar web containers.</p><p></p><h3 id="Spark-rest-SeeAlso">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul style="list-style-type: square;"><li><a shape="rect" href="rest.html">Rest</a></li></ul></div>
         </td>
         <td valign="top">

Modified: websites/production/camel/content/spring-java-config-example.html
==============================================================================
--- websites/production/camel/content/spring-java-config-example.html (original)
+++ websites/production/camel/content/spring-java-config-example.html Sat Apr  9 21:26:44 2016
@@ -104,96 +104,16 @@ mvn camel:run
 </div></div><p>Here is the configuration for camel plugin.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 
-&lt;!-- Allows the routes to be run via &#39;mvn camel:run&#39; --&gt;
+&lt;!-- Allows the routes to be run via &#39;mvn exec:java&#39; --&gt;
 &lt;plugin&gt;
-  &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
-  &lt;artifactId&gt;camel-maven-plugin&lt;/artifactId&gt;
-  &lt;version&gt;${project.version}&lt;/version&gt;
+  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
+  &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
   &lt;configuration&gt;
-    &lt;duration&gt;5s&lt;/duration&gt;
-    &lt;configClasses&gt;org.apache.camel.example.spring.javaconfig.MyRouteConfig&lt;/configClasses&gt;
-    &lt;!--
-        You could set the base package directory and let spring to find
-        the config classes for you
-        &lt;basedPackages&gt;org.apache.camel.example.spring.javaconfig&lt;/basedPackages&gt;
-      --&gt;
+    &lt;mainClass&gt;org.apache.camel.example.spring.javaconfig.MyApplication&lt;/mainClass&gt;
   &lt;/configuration&gt;
 &lt;/plugin&gt;
 ]]></script>
-</div></div><p>What this does is boot up the Spring ApplicationContext defined in the file MyRouteConfig class on the classpath. This is a regular Java file which has the Spring JavaConfig annotation to configure a <a shape="rect" href="camelcontext.html">CamelContext</a>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-/**
- * A simple example router from a file system to an ActiveMQ queue and then to a file system
- *
- * @version 
- */
-@Configuration
-public class MyRouteConfig extends SingleRouteCamelConfiguration implements InitializingBean {
-    
-    /**
-     * Allow this route to be run as an application
-     */
-    public static void main(String[] args) throws Exception {
-        new Main().run(args);
-    }
-    
-    /**
-     * Returns the CamelContext which support Spring
-     */
-    @Override
-    protected CamelContext createCamelContext() throws Exception {
-        return new SpringCamelContext(getApplicationContext());
-    }
-    
-    @Override
-    protected void setupCamelContext(CamelContext camelContext) throws Exception {
-        // setup the ActiveMQ component
-        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
-        connectionFactory.setBrokerURL(&quot;vm://localhost.spring.javaconfig?marshal=false&amp;broker.persistent=false&amp;broker.useJmx=false&quot;);
-
-        // and register it into the CamelContext
-        JmsComponent answer = new JmsComponent();
-        answer.setConnectionFactory(connectionFactory);
-        camelContext.addComponent(&quot;jms&quot;, answer);
-    }
-
-    
-    public static class SomeBean {
-
-        public void someMethod(String body) {
-            System.out.println(&quot;Received: &quot; + body);
-        }
-
-    }
-
-    @Bean
-    @Override
-    public RouteBuilder route() {
-        return new RouteBuilder() {
-            public void configure() {
-                // you can configure the route rule with Java DSL here
-
-                // populate the message queue with some messages
-                from(&quot;file:src/data?noop=true&quot;).
-                        to(&quot;jms:test.MyQueue&quot;);
-
-                from(&quot;jms:test.MyQueue&quot;).
-                        to(&quot;file://target/test?noop=true&quot;);
-
-                // set up a listener on the file component
-                from(&quot;file://target/test?noop=true&quot;).
-                        bean(new SomeBean());
-            }
-        };
-    }
-
-    public void afterPropertiesSet() throws Exception {
-        // just to make SpringDM happy do nothing here
-    }
-
-}
-]]></script>
-</div></div><p>In the method of setupCamelContext(CamelContext camelContext), we setup the JMS component's connection factory and register the component into the camelcontext. You can override this method if you want to setup the another connection factory or start up a JMS broker here.</p><p>You can write the route rule with Java <a shape="rect" href="dsl.html">DSL</a> in the route() method.</p><p>This approach, of using Java code to write the routes in the <a shape="rect" href="dsl.html">DSL</a> and Spring will help your configure the Camel context as the <a shape="rect" href="spring-java-config-example.html">Spring Java Config Example</a> shows.</p></div>
+</div></div><p>What this does is boot up the Spring ApplicationContext defined in the file MyRouteConfig class on the classpath. This is a regular Java file which has the Spring JavaConfig annotation to configure a <a shape="rect" href="camelcontext.html">CamelContext</a>.</p><div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div><p>In the method of setupCamelContext(CamelContext camelContext), we setup the JMS component's connection factory and register the component into the camelcontext. You can override this method if you want to setup the another connection factory or start up a JMS broker here.</p><p>You can write the route rule with Java <a shape="rect" href="dsl.html">DSL</a> in the route() method.</p><p>This approach, of using Java code to write the routes in the <a shape="rect" href="dsl.html">DSL</a> and Spring will help your configure the Camel context as the <a shape="rect" href="spri
 ng-java-config-example.html">Spring Java Config Example</a> shows.</p></div>
         </td>
         <td valign="top">
           <div class="navigation">

Modified: websites/production/camel/content/tutorial-jmsremoting.html
==============================================================================
--- websites/production/camel/content/tutorial-jmsremoting.html (original)
+++ websites/production/camel/content/tutorial-jmsremoting.html Sat Apr  9 21:26:44 2016
@@ -93,32 +93,32 @@
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 &lt;!-- required by both client and server --&gt;
 &lt;dependency&gt;
-    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
-    &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
+  &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
+  &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
-    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
-    &lt;artifactId&gt;camel-jms&lt;/artifactId&gt;
+  &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
+  &lt;artifactId&gt;camel-jms&lt;/artifactId&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
-    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
-    &lt;artifactId&gt;camel-spring&lt;/artifactId&gt;
+  &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
+  &lt;artifactId&gt;camel-spring&lt;/artifactId&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
-    &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
-    &lt;artifactId&gt;activemq-camel&lt;/artifactId&gt;
+  &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
+  &lt;artifactId&gt;activemq-camel&lt;/artifactId&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
-    &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
-    &lt;artifactId&gt;activemq-pool&lt;/artifactId&gt;
+  &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
+  &lt;artifactId&gt;activemq-pool&lt;/artifactId&gt;
 &lt;/dependency&gt;
 ]]></script>
 </div></div>As we use spring xml configuration for the ActiveMQ JMS broker we need this dependency:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 &lt;!-- xbean is required for ActiveMQ broker configuration in the spring xml file --&gt;
 &lt;dependency&gt;
-    &lt;groupId&gt;org.apache.xbean&lt;/groupId&gt;
-    &lt;artifactId&gt;xbean-spring&lt;/artifactId&gt;
+  &lt;groupId&gt;org.apache.xbean&lt;/groupId&gt;
+  &lt;artifactId&gt;xbean-spring&lt;/artifactId&gt;
 &lt;/dependency&gt;
 ]]></script>
 </div></div><h2 id="Tutorial-JmsRemoting-WritingtheServer">Writing the Server</h2><h3 id="Tutorial-JmsRemoting-CreatetheSpringService">Create the Spring Service</h3><p>For this example the Spring service (= our business service) on the server will be a simple multiplier which trebles in the received value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">

Modified: websites/production/camel/content/xml-reference.html
==============================================================================
--- websites/production/camel/content/xml-reference.html (original)
+++ websites/production/camel/content/xml-reference.html Sat Apr  9 21:26:44 2016
@@ -84,7 +84,7 @@
 	<tbody>
         <tr>
         <td valign="top" width="100%">

[... 6 lines stripped ...]