camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r940565 - in /websites/production/camel/content: cache/main.pageCache eclipse-kura-component.html
Date Wed, 18 Feb 2015 09:18:12 GMT
Author: buildbot
Date: Wed Feb 18 09:18:12 2015
New Revision: 940565

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/eclipse-kura-component.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/eclipse-kura-component.html
==============================================================================
--- websites/production/camel/content/eclipse-kura-component.html (original)
+++ websites/production/camel/content/eclipse-kura-component.html Wed Feb 18 09:18:12 2015
@@ -95,40 +95,25 @@
     }
 
 }]]></script>
-</div></div><p>Kura router starts its own OSGi-aware <code>CamelContext</code>.
It means that for every class extending <code>KuraRouter</code>, there will be
a dedicated <code>CamelContext</code> instance. Ideally we recommend to deploy
one <code>KuraRouter</code> per OSGi bundle.</p><h3 id="EclipseKuracomponent-Camelproperties"><span
style="line-height: 1.5625;">Camel properties</span></h3><p>Spring Boot
auto-configuration automatically connect <a shape="rect" class="external-link" href="http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config"
rel="nofollow">Spring Boot external configuration</a>&#160;(like properties placeholders,
<span>OS environment variables or system properties) with the&#160;<a shape="rect"
href="properties.html">Camel properties support</a>.</span>&#160;It basically
means that any property defined in <code>application.properties</code> file: &#160;</p><div
class="code panel pdl" style="b
 order-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[route.from
= jms:invoices]]></script>
-</div></div><p>...or set via system property...</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[java
-Droute.to=jms:processed.invoices -jar mySpringApp.jar]]></script>
-</div></div><p>...can be used as placeholders in Camel route:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[@Component
-public class MyRouter extends RouteBuilder {
-
-  @Override
-  public void configure() throws Exception {
-    from(&quot;{{route.from}}&quot;).to(&quot;{{route.to}}&quot;);
-  }
-
-}]]></script>
-</div></div><p>&#160;</p><h3 id="EclipseKuracomponent-CustomCamelcontextconfiguration">Custom
Camel context configuration</h3><p>If you would like to perform some operations
on&#160;<code>CamelContext</code>&#160;bean created by Camel auto-configuration,
register&#160;<code>CamelContextConfiguration</code>&#160;instance in
your Spring context:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[@Configuration
-public class MyAppConfig {
-
-  ...
-
-  @Bean
-  CamelContextConfiguration contextConfiguration() {
-    return new CamelContextConfiguration() {
-      @Override
-      void beforeApplicationStart(CamelContext context) {
-        // your custom configuration goes here
-      }
-    };
-  }
-
-}]]></script>
-</div></div><p>Method <span>C<code>amelContextConfiguration#</code></span><code><span
style="line-height: 1.4285715;">beforeApplicationStart(CamelContext)</span></code><span
style="line-height: 1.4285715;">&#160;will be called just before the Spring context
is started, so the <span><code>CamelContext</code> instance passed to this
callback is fully</span>&#160;auto-configured. You can add many instances of C<code>amelContextConfiguration</code>&#160;into
your Spring context - all of them will be executed.</span></p><h3 id="EclipseKuracomponent-DisablingJMX">Disabling
JMX</h3><p>To disable JMX of the auto-configured <code>CamelContext</code>&#160;use
<code>camel.springboot.jmxEnabled</code> property (JMX is enabled by default).
For example you could add the following property to your <code>application.properties</code>
file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[camel.springboot.jmxEnabled
= false]]></script>
-</div></div><h3 id="EclipseKuracomponent-Auto-configuredconsumerandproducertemplates">Auto-configured
consumer and producer templates</h3><p>Camel auto-configuration provides a pre-configured
<code>ConsumerTemplate</code> and <code>ProducerTemplate</code> instances.
You can simply inject them into your Spring-managed beans:</p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Kura router starts its own OSGi-aware <code>CamelContext</code>.
It means that for every class extending <code>KuraRouter</code>, there will be
a dedicated <code>CamelContext</code> instance. Ideally we recommend to deploy
one <code>KuraRouter</code> per OSGi bundle.</p><h3 id="EclipseKuracomponent-DeployingKuraRouter">Deploying
KuraRouter</h3><p>Bundle containing your Kura router class should import the following
bundles in the OSGi manifest:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[Import-Package:
org.osgi.framework;version=&quot;1.3.0&quot;,
+org.slf4j;version=&quot;1.6.4&quot;,
+org.apache.camel,org.apache.camel.impl,org.apache.camel.core.osgi,org.apache.camel.builder,org.apache.camel.model,
+org.apache.camel.kura]]></script>
+</div></div><p>Keep in mind that you don't have to import every Camel component
bundle you plan to use in your routes, as Camel components are resolved as the services on
the runtime level.</p><p>Before you deploy your router bundle, be sure that you
have deployed (and started) the following Camel core bundles (using Kura GoGo shell)...</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[install
file:///home/user/.m2/repository/org/apache/camel/camel-core/2.15.0/camel-core-2.15.0.jar
+start &lt;camel-core-bundle-id&gt;
+install file:///home/user/.m2/repository/org/apache/camel/camel-core-osgi/2.15.0/camel-core-osgi-2.15.0.jar
+start &lt;camel-core-osgi-bundle-id&gt;
+install file:///home/user/.m2/repository/org/apache/camel/camel-kura/2.15.0/camel-kura-2.15.0.jar

+start &lt;camel-kura-bundle-id&gt;]]></script>
+</div></div><p>...and all the components you plan to use in your routes:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[install
file:///home/user/.m2/repository/org/apache/camel/camel-stream/2.15/camel-stream-2.15.jar
+start &lt;camel-kura-bundle-id&gt;]]></script>
+</div></div><p>Then finally deploy your router bundle:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[install
file:///home/user/.m2/repository/com/example/myrouter/1.0/myrouter-1.0.jar
+start &lt;your-bundle-id&gt;]]></script>
+</div></div><h3 id="EclipseKuracomponent-Auto-configuredconsumerandproducertemplates"><span
style="line-height: 1.5625;">Auto-configured consumer and producer templates</span></h3><p>Camel
auto-configuration provides a pre-configured <code>ConsumerTemplate</code> and
<code>ProducerTemplate</code> instances. You can simply inject them into your
Spring-managed beans:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[@Component
 public class InvoiceProcessor {
 



Mime
View raw message