camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r982477 [4/4] - in /websites/production/camel/content: ./ 2016/03/11/ cache/
Date Fri, 11 Mar 2016 14:27:32 GMT
Modified: websites/production/camel/content/tutorial-jmsremoting.html
==============================================================================
--- websites/production/camel/content/tutorial-jmsremoting.html (original)
+++ websites/production/camel/content/tutorial-jmsremoting.html Fri Mar 11 14:27:32 2016
@@ -217,7 +217,12 @@ public class ServerRoutes extends RouteB
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 &lt;!-- lets configure the Camel ActiveMQ to use the embedded ActiveMQ broker declared
above --&gt;
 &lt;bean id=&quot;jms&quot; class=&quot;org.apache.activemq.camel.component.ActiveMQComponent&quot;&gt;
-  &lt;property name=&quot;brokerURL&quot; value=&quot;vm://myBroker&quot;/&gt;
+  &lt;property name=&quot;connectionFactory&quot;&gt;
+    &lt;bean class=&quot;org.apache.activemq.spring.ActiveMQConnectionFactory&quot;&gt;
+      &lt;property name=&quot;brokerURL&quot; value=&quot;vm://myBroker&quot;/&gt;
+      &lt;property name=&quot;trustAllPackages&quot; value=&quot;true&quot;/&gt;
+    &lt;/bean&gt;
+  &lt;/property&gt;
 &lt;/bean&gt;
 ]]></script>
 </div></div><strong>Notice:</strong> The <a shape="rect" href="jms.html">JMS
component</a> is configured in standard Spring beans, but the gem is that the bean id
can be referenced from Camel routes - meaning we can do routing using the JMS Component by
just using <strong>jms:</strong> prefix in the route URI. What happens is that
Camel will find in the Spring Registry for a bean with the id="jms". Since the bean id can
have arbitrary name you could have named it id="jmsbroker" and then referenced to it in the
routing as <code>from="jmsbroker:queue:numbers).to("multiplier");</code><br
clear="none"> We use the vm protocol to connect to the ActiveMQ server as its embedded
in this application.<div class="table-wrap"><table class="confluenceTable"><tbody><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>component-scan</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Defines the package to be scanned
for Spring stereotype annotations, in this case, to load the "multiplie
 r" bean</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>camel-context</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Defines the package to be scanned
for Camel routes. Will find the <code>ServerRoutes</code> class and create the
routes contained within it</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p>jms bean</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Creates the Camel JMS component</p></td></tr></tbody></table></div><h3
id="Tutorial-JmsRemoting-RuntheServer">Run the Server</h3><p>The Server is
started using the <code>org.apache.camel.spring.Main</code> class that can start
camel-spring application out-of-the-box. The Server can be started in several flavors:</p><ul
class="alternate"><li>as a standard java main application - just start the <code>org.apache.camel.spring.Main</code>
class</li><li>using maven jave:exec</li><li>using <a shape="rect"
href="camel-run-maven-goal.html">camel:run</a></li></ul><p>In th
 is sample as there are two servers (with and without AOP) we have prepared some profiles
in maven to start the Server of your choice.<br clear="none"> The server is started
with:<br clear="none"> <code>mvn compile exec:java -PCamelServer</code></p><h2
id="Tutorial-JmsRemoting-WritingTheClients">Writing The Clients</h2><p>This
sample has three clients demonstrating different Camel techniques for communication</p><ul
class="alternate"><li>CamelClient using the <a shape="rect" href="producertemplate.html">ProducerTemplate</a>
for Spring template style coding</li><li>CamelRemoting using Spring Remoting</li><li>CamelEndpoint
using the Message Endpoint EIP pattern using a neutral Camel API</li></ul><h3
id="Tutorial-JmsRemoting-ClientUsingTheProducerTemplate">Client Using The ProducerTemplate</h3><p>We
will initially create a client by directly using <code>ProducerTemplate</code>.
We will later create a client which uses Spring remoting to hide the fact that messaging is
being used.</p><di
 v class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
@@ -241,7 +246,12 @@ public class ServerRoutes extends RouteB
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 &lt;!-- Camel JMSProducer to be able to send messages to a remote Active MQ server --&gt;
 &lt;bean id=&quot;jms&quot; class=&quot;org.apache.activemq.camel.component.ActiveMQComponent&quot;&gt;
-  &lt;property name=&quot;brokerURL&quot; value=&quot;tcp://localhost:${tcp.port}&quot;/&gt;
+  &lt;property name=&quot;connectionFactory&quot;&gt;
+    &lt;bean class=&quot;org.apache.activemq.spring.ActiveMQConnectionFactory&quot;&gt;
+      &lt;property name=&quot;brokerURL&quot; value=&quot;tcp://localhost:${tcp.port}&quot;/&gt;
+      &lt;property name=&quot;trustAllPackages&quot; value=&quot;true&quot;/&gt;
+    &lt;/bean&gt;
+  &lt;/property&gt;
 &lt;/bean&gt;
 ]]></script>
 </div></div>The client will not use the <a shape="rect" href="camel-maven-plugin.html">Camel
Maven Plugin</a> so the Spring XML has been placed in <em>src/main/resources</em>
to not conflict with the server configs.<div class="table-wrap"><table class="confluenceTable"><tbody><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>camelContext</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>The Camel context is defined but
does not contain any routes</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p>template</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The <code>ProducerTemplate</code> is used to
place messages onto the JMS queue</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p>jms bean</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>This initialises the Camel JMS component, allowing
us to place messages onto the queue</p></td></tr></tbody></table></div><p>And
the CamelClient source code:</p><div class="co
 de panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">

Modified: websites/production/camel/content/using-propertyplaceholder.html
==============================================================================
--- websites/production/camel/content/using-propertyplaceholder.html (original)
+++ websites/production/camel/content/using-propertyplaceholder.html Fri Mar 11 14:27:32 2016
@@ -306,7 +306,7 @@ from(&quot;direct:start&quot;)
            xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
            xmlns:cm=&quot;http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0&quot;
            xsi:schemaLocation=&quot;
-           http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd&quot;&gt;
+           http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd&quot;&gt;
 
     &lt;!-- OSGI blueprint property placeholder --&gt;
     &lt;cm:property-placeholder id=&quot;myblueprint.placeholder&quot; persistent-id=&quot;camel.blueprint&quot;&gt;
@@ -336,7 +336,7 @@ from(&quot;direct:start&quot;)
            xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
            xmlns:cm=&quot;http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0&quot;
            xsi:schemaLocation=&quot;
-           http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd&quot;&gt;
+           http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd&quot;&gt;
 
     &lt;!-- OSGI blueprint property placeholder --&gt;
     &lt;cm:property-placeholder id=&quot;myblueprint.placeholder&quot; persistent-id=&quot;camel.blueprint&quot;&gt;
@@ -443,7 +443,7 @@ greeting=Bye
            xmlns:cm=&quot;http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0&quot;
            xsi:schemaLocation=&quot;
              http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
-             http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd&quot;&gt;
+             http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd&quot;&gt;
 
   &lt;!-- blueprint property placeholders, that will use etc/stuff.cfg as the properties
file --&gt;
   &lt;cm:property-placeholder persistent-id=&quot;stuff&quot; update-strategy=&quot;reload&quot;&gt;



Mime
View raw message