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/11/28 22:18:42 UTC
svn commit: r1001789 - in /websites/production/camel/content:
cache/main.pageCache spring-boot-example.html spring-boot.html
Author: buildbot
Date: Mon Nov 28 22:18:42 2016
New Revision: 1001789
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/spring-boot-example.html
websites/production/camel/content/spring-boot.html
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/camel/content/spring-boot-example.html
==============================================================================
--- websites/production/camel/content/spring-boot-example.html (original)
+++ websites/production/camel/content/spring-boot-example.html Mon Nov 28 22:18:42 2016
@@ -84,13 +84,13 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="SpringBootExample-SpringBootExample">Spring Boot Example</h2><p>The <a shape="rect" class="external-link" href="https://github.com/apache/camel/tree/master/examples/camel-example-spring-boot" rel="nofollow">Spring Boot example</a> shows how to work with the simple Camel application based on <a shape="rect" href="spring-boot.html">Spring Boot</a>.</p><p>The example generates messages using timer trigger, writes them to standard output and the mock endpoint (for testing purposes).</p><p>This example exposes Jolokia API and Spring Boot actuators endpoints (like metrics) via the webmvc endpoint. We consider this as best practice - Spring Boot applications with these APIs exposed can be easily monitored and managed by 3rd party tools. We also recommend to package your application as a fat WAR. Fat WARs can be executed just as regular fat jars, but you can also deploy them to the servlet containers like Tomcat. The "Fat WAR approach" offers yo
u deployment flexibility, so we highly recommend it.</p><p>You will need to compile this example first:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><h2 id="SpringBootExample-SpringBootExample">Spring Boot Example</h2><p>The <a shape="rect" class="external-link" href="https://github.com/apache/camel/tree/master/examples/camel-example-spring-boot" rel="nofollow">Spring Boot example</a> shows how to work with the simple Camel application based on <a shape="rect" href="spring-boot.html">Spring Boot</a>.</p><p>The example generates messages using timer trigger, writes them to standard output and the mock endpoint (for testing purposes).</p><p>This example exposes Jolokia API and Spring Boot actuators endpoints (like metrics) via the webmvc endpoint. We consider this as best practice - Spring Boot applications with these APIs exposed can be easily monitored and managed by 3rd party tools. We also recommend to package your application as a fat WAR. Fat WARs can be executed just as regular fat jars, but you can also deploy them to the servlet containers like Tomcat. The "<em>Fat WAR approach</em>"
offers you deployment flexibility, so we highly recommend it.</p><p>You will need to compile this example first:</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[ mvn install]]></script>
</div></div><p>To run the example type:</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[mvn spring-boot:run]]></script>
</div></div><p>You can also execute the fat WAR directly:</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[java -jar target/camel-example-spring-boot.war]]></script>
-</div></div><p>You will see the message printed to the console every second. To stop the example hit <code>ctrl + c</code>.</p><p>From <strong>Camel 2.17</strong> the example ships with remote shell enabled which includes the Camel commands as well, so you can SSH into the running Camel application and use the camel commands to list / stop routes etc.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>You will see the message printed to the console every second. To stop the example hit <strong><code>Ctrl + C</code></strong>.</p><p>From <strong>Camel 2.17</strong> the example ships with remote shell enabled which includes the Camel commands as well, so you can SSH into the running Camel application and use the camel commands to list / stop routes etc.</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[ssh -p 2000 user@localhost
# use the password that spring-boot logs when it startup
Modified: websites/production/camel/content/spring-boot.html
==============================================================================
--- websites/production/camel/content/spring-boot.html (original)
+++ websites/production/camel/content/spring-boot.html Mon Nov 28 22:18:42 2016
@@ -85,14 +85,14 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="SpringBoot-SpringBoot">Spring Boot</h2><p><strong>Available as of Camel 2.15</strong></p><p><span style="line-height: 1.4285715;">Spring Boot component provides auto-configuration for Apache Camel. Our opinionated auto-configuration of the Camel context auto-detects Camel routes available in the Spring context and registers the key Camel utilities (like producer template, consumer template and the type converter) as beans.</span></p><p><span style="line-height: 1.4285715;">Maven users will need to add the following dependency to their </span><code style="line-height: 1.4285715;">pom.xml</code><span style="line-height: 1.4285715;"> in order to use this component:</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><h2 id="SpringBoot-SpringBoot">Spring Boot</h2><p><strong>Available as of Camel 2.15</strong></p><p><span style="line-height: 1.4285715;">Spring Boot component provides auto-configuration for Apache Camel. Our opinionated auto-configuration of the Camel context auto-detects Camel routes available in the Spring context and registers the key Camel utilities (like producer template, consumer template and the type converter) as beans.</span></p><p><span style="line-height: 1.4285715;">Maven users will need to add the following dependency to their </span><strong><code style="line-height: 1.4285715;">pom.xml</code></strong><span style="line-height: 1.4285715;"> in order to use this component:</span></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[<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot</artifactId>
<version>${camel.version}</version> <!-- use the same version as your Camel core version -->
</dependency>
]]></script>
-</div></div><p><code>camel-spring-boot</code> jar comes with the <code>spring.factories</code> file, so as soon as you add that dependency into your classpath, Spring Boot will automatically auto-configure Camel for you.</p><h3 id="SpringBoot-CamelSpringBootStarter">Camel Spring Boot Starter</h3><p><strong>Available as of Camel 2.17</strong></p><p>Apache Camel ships a <a shape="rect" class="external-link" href="https://github.com/spring-projects/spring-boot/tree/master/spring-boot-starters" rel="nofollow">Spring Boot Starter</a> module that allows you to develop Spring Boot applications using starters. There is a <a shape="rect" class="external-link" href="https://github.com/apache/camel/tree/master/examples/camel-example-spring-boot-starter" rel="nofollow">sample application</a> in the source code also.</p><p>To use the starter, add the following to your spring boot pom.xml file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelC
ontent pdl">
+</div></div><p><strong><code>camel-spring-boot</code></strong> jar comes with the <strong><code>spring.factories</code></strong> file, so as soon as you add that dependency into your classpath, Spring Boot will automatically auto-configure Camel for you.</p><h3 id="SpringBoot-CamelSpringBootStarter">Camel Spring Boot Starter</h3><p><strong>Available as of Camel 2.17</strong></p><p>Apache Camel ships a <a shape="rect" class="external-link" href="https://github.com/spring-projects/spring-boot/tree/master/spring-boot-starters" rel="nofollow">Spring Boot Starter</a> module that allows you to develop Spring Boot applications using starters. There is a <a shape="rect" class="external-link" href="https://github.com/apache/camel/tree/master/examples/camel-example-spring-boot-starter" rel="nofollow">sample application</a> in the source code also.</p><p>To use the starter, add the following to your spring boot <strong><code>pom.xml</code></strong> file:</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[<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
@@ -109,10 +109,11 @@ public class MyRoute extends RouteBuilde
@Override
public void configure() throws Exception {
- from("timer:foo").to("log:bar");
+ from("timer:foo")
+ .to("log:bar");
}
}]]></script>
-</div></div><p>Then these routes will be started automatically. To keep the main thread blocked so that Camel stays up, either include the <em>spring-boot-starter-web</em> dependency, or add camel.springboot.main-run-controller=true to your <code>application.properties</code> or <code>application.yml</code> file. </p><p>You can further customize the Camel application in the <code>application.properties</code> or <code>application.yml</code> file with <em>camel.springboot.* properties.</em></p><h3 id="SpringBoot-Auto-configuredCamelcontext"><span style="line-height: 1.5625;">Auto-configured Camel context</span></h3><p>The most important piece of functionality provided by the Camel auto-configuration is <code>CamelContext</code> instance. Camel auto-configuration creates a <code>SpringCamelContext</code> for you and takes care of the proper initialization and shutdown of that context. The created Camel context is also registe
red in the Spring application context (under <code>camelContext</code> bean name), so you can access it just as  any other Spring bean.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Then these routes will be started automatically. To keep the main thread blocked so that Camel stays up, either include the <strong><code>spring-boot-starter-web</code></strong> dependency, or add <strong><code>camel.springboot.main-run-controller=true</code></strong> to your <strong><code>application.properties</code></strong> or <strong><code>application.yml</code></strong> file. </p><p>You can further customize the Camel application in the <strong><code>application.properties</code></strong> or <strong><code>application.yml</code></strong> file with <em><strong><code>camel.springboot.* properties</code></strong>.</em></p><h3 id="SpringBoot-Auto-ConfiguredCamelContext"><span style="line-height: 1.5625;">Auto-Configured Camel Context</span></h3><p>The most important piece of functionality provided by the Camel auto-configuration is <strong><code>CamelContext</code></strong> instance. Camel auto-configuration creates a
 <strong><code>SpringCamelContext</code></strong> for you and takes care of the proper initialization and shutdown of that context. The created Camel context is also registered in the Spring application context (under <strong><code>camelContext</code></strong> bean name), so you can access it just as  any other Spring bean.</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[@Configuration
public class MyAppConfig {
@@ -123,9 +124,8 @@ public class MyAppConfig {
MyService myService() {
return new DefaultMyService(camelContext);
}
-
}]]></script>
-</div></div><h3 id="SpringBoot-Auto-detectingCamelroutes">Auto-detecting Camel routes</h3><p>Camel auto-configuration collects all the <code>RouteBuilder</code> instances from the Spring context and automatically injects them into the provided <code>CamelContext</code>. That means that creating new Camel route with the Spring Boot starter is as simple as adding the <code>@Component</code> annotated class to your classpath:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringBoot-Auto-DetectingCamelRoutes">Auto-Detecting Camel Routes</h3><p>Camel auto-configuration collects all the <strong><code>RouteBuilder</code></strong> instances from the Spring context and automatically injects them into the provided <strong><code>CamelContext</code></strong>. That means that creating new Camel route with the Spring Boot starter is as simple as adding the <strong><code>@Component</code></strong> annotated class to your classpath:</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[@Component
public class MyRouter extends RouteBuilder {
@@ -133,9 +133,8 @@ public class MyRouter extends RouteBuild
public void configure() throws Exception {
from("jms:invoices").to("file:/invoices");
}
-
}]]></script>
-</div></div><p><br clear="none">...or creating a new route <code>RouteBuilder</code> bean in your <code>@Configuration</code> class:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p><br clear="none">...or creating a new route <strong><code>RouteBuilder</code></strong> bean in your <strong><code>@Configuration</code></strong> class:</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[@Configuration
public class MyRouterConfiguration {
@@ -145,14 +144,13 @@ public class MyRouterConfiguration {
@Override
public void configure() throws Exception {
- from("jms:invoices").to("file:/invoices");
+ from("jms:invoices")
+ .to("file:/invoices");
}
-
};
- }
-
+ }
}]]></script>
-</div></div><h3 id="SpringBoot-Camelproperties">Camel properties</h3><p>Spring Boot auto-configuration automatically connects to <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> (like properties placeholders, <span>OS environment variables or system properties) with the <a shape="rect" href="properties.html">Camel properties support</a>.</span> It basically means that any property defined in <code>application.properties</code> file:  </p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringBoot-Camelproperties">Camel properties</h3><p>Spring Boot auto-configuration automatically connects to <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> (like properties placeholders, <span>OS environment variables or system properties) with the <a shape="rect" href="properties.html">Camel properties support</a>.</span> It basically means that any property defined in <strong><code>application.properties</code></strong> file:  </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[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="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[java -Droute.to=jms:processed.invoices -jar mySpringApp.jar]]></script>
@@ -162,11 +160,11 @@ public class MyRouter extends RouteBuild
@Override
public void configure() throws Exception {
- from("{{route.from}}").to("{{route.to}}");
+ from("{{route.from}}")
+ .to("{{route.to}}");
}
-
}]]></script>
-</div></div><h3 id="SpringBoot-CustomCamelcontextconfiguration">Custom Camel context configuration</h3><p>If you would like to perform some operations on <code>CamelContext</code> bean created by Camel auto-configuration, register <code>CamelContextConfiguration</code> instance in your Spring context:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringBoot-CustomCamelContextConfiguration">Custom Camel Context Configuration</h3><p>If you would like to perform some operations on <strong><code>CamelContext</code></strong> bean created by Camel auto-configuration, register <strong><code>CamelContextConfiguration</code></strong> instance in your Spring context:</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[@Configuration
public class MyAppConfig {
@@ -181,11 +179,10 @@ public class MyAppConfig {
}
};
}
-
}]]></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;"> will be called just before the Spring context is started, so the <span><code>CamelContext</code> instance passed to this callback is fully</span> auto-configured. You can add many instances of C<code>amelContextConfiguration</code> into your Spring context - all of them will be executed.</span></p><h3 id="SpringBoot-DisablingJMX">Disabling JMX</h3><p>To disable JMX of the auto-configured <code>CamelContext</code> 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">
+</div></div><p>Method <strong>C<code>amelContextConfiguration#</code><code><span style="line-height: 1.42857;">beforeApplicationStart(CamelContext)</span></code></strong><span style="line-height: 1.4285715;"> will be called just before the Spring context is started, so the <span><strong><code>CamelContext</code></strong> instance passed to this callback is fully</span> auto-configured. You can add many instances of <strong><code>CamelContextConfiguration</code></strong> into your Spring context - all of them will be executed.</span></p><h3 id="SpringBoot-DisablingJMX">Disabling JMX</h3><p>To disable JMX of the auto-configured <strong><code>CamelContext</code></strong> use <strong><code>camel.springboot.jmxEnabled</code></strong> property (JMX is enabled by default). For example you could add the following property to your <strong><code>application.properties</code></strong> file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent pa
nelContent pdl">
<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[camel.springboot.jmxEnabled = false]]></script>
-</div></div><h3 id="SpringBoot-Auto-configuredconsumerandproducertemplates">Auto-configured consumer and producer templates</h3><p>Camel auto-configuration provides 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><h3 id="SpringBoot-Auto-ConfiguredConsumerandProducerTemplates">Auto-Configured Consumer and Producer Templates</h3><p>Camel auto-configuration provides pre-configured <strong><code>ConsumerTemplate</code></strong> and <strong><code>ProducerTemplate</code></strong> 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="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[@Component
public class InvoiceProcessor {
@@ -199,12 +196,11 @@ public class InvoiceProcessor {
...
producerTemplate.sendBody("netty-http:http://invoicing.com/received/" + invoice.id());
}
-
}]]></script>
-</div></div><p>By default consumer templates and producer templates come with the endpoint cache sizes set to 1000. You can change those values via the following Spring properties:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>By default consumer templates and producer templates come with the endpoint cache sizes set to <strong><code>1000</code></strong>. You can change those values via the following Spring properties:</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[camel.springboot.consumerTemplateCacheSize = 100
camel.springboot.producerTemplateCacheSize = 200]]></script>
-</div></div><h3 id="SpringBoot-Auto-configuredTypeConverter">Auto-configured TypeConverter</h3><p>Camel auto-configuration registers a <code>TypeConverter</code> instance named <code>typeConverter</code> in the Spring context.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringBoot-Auto-ConfiguredTypeConverter">Auto-Configured TypeConverter</h3><p>Camel auto-configuration registers a <strong><code>TypeConverter</code></strong> instance named <strong><code>typeConverter</code></strong> in the Spring context.</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[@Component
public class InvoiceProcessor {
@@ -215,9 +211,8 @@ public class InvoiceProcessor {
String invoiceValue = invoice.grossValue();
return typeConverter.convertTo(Long.class, invoiceValue);
}
-
}]]></script>
-</div></div><h3 id="SpringBoot-SpringtypeconversionAPIbridge">Spring type conversion API bridge</h3><p>Spring comes with the powerful <a shape="rect" class="external-link" href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#core-convert" rel="nofollow">type conversion API</a>. Spring API happens to be very similar to the Camel <a shape="rect" href="type-converter.html">type converter API</a>. As those APIs are so similar, Camel Spring Boot automatically registers a bridge converter (<code>SpringTypeConverter</code>) that delegates to the Spring conversion API.That means that out-of-the-box Camel will treat Spring Converters like Camel ones. With this approach you can enjoy both Camel and Spring converters accessed via Camel <code>TypeConverter</code> API:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringBoot-SpringTypeConversionAPIBridge">Spring Type Conversion API Bridge</h3><p>Spring comes with the powerful <a shape="rect" class="external-link" href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#core-convert" rel="nofollow">type conversion API</a>. Spring API happens to be very similar to the Camel <a shape="rect" href="type-converter.html">type converter API</a>. As those APIs are so similar, Camel Spring Boot automatically registers a bridge converter (<strong><code>SpringTypeConverter</code></strong>) that delegates to the Spring conversion API.That means that out-of-the-box Camel will treat Spring Converters like Camel ones. With this approach you can enjoy both Camel and Spring converters accessed via Camel <strong><code>TypeConverter</code></strong> API:</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[@Component
public class InvoiceProcessor {
@@ -228,11 +223,10 @@ public class InvoiceProcessor {
// Using Spring's StringToUUIDConverter
UUID id = invoice.typeConverter.convertTo(UUID.class, invoice.getId());
}
-
}]]></script>
-</div></div><p> </p><p>Under the hood Camel Spring Boot delegates conversion to the Spring's <code><a shape="rect" class="external-link" href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/convert/ConversionService.html" rel="nofollow">ConversionService</a></code> instances available in the application context. If no <code>ConversionService</code> instance is available, Camel Spring Boot auto-configuration will create one for you.</p><h3 id="SpringBoot-Disablingtypeconversionsfeatures">Disabling type conversions features</h3><p>If you don't want Camel Spring Boot to register type-conversions related features (like <code>TypeConverter</code> instance or Spring bridge) set the <code>camel.springboot.typeConversion</code> property to <code>false</code>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p> </p><p>Under the hood Camel Spring Boot delegates conversion to the Spring's <code><a shape="rect" class="external-link" href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/convert/ConversionService.html" rel="nofollow">ConversionService</a></code> instances available in the application context. If no <strong><code>ConversionService</code></strong> instance is available, Camel Spring Boot auto-configuration will create one for you.</p><h3 id="SpringBoot-DisablingTypeConversionsFeatures">Disabling Type Conversions Features</h3><p>If you don't want Camel Spring Boot to register type-conversions related features (like <strong><code>TypeConverter</code></strong> instance or Spring bridge) set the <strong><code>camel.springboot.typeConversion</code></strong> property to <strong><code>false</code></strong>.</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[camel.springboot.typeConversion = false]]></script>
-</div></div><h3 id="SpringBoot-Fatjarsandfatwars">Fat jars and fat wars</h3><p>The easiest way to create a Camel-aware Spring Boot fat jar/war is to extend the <code><span style="line-height: 1.4285715;">org</span><span style="line-height: 1.4285715;">.apache.camel.spring.boot.F</span><code style="line-height: 1.4285715;">atJarRouter</code></code><span style="line-height: 1.4285715;"> class...</span></p><p> </p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringBoot-FatJarsandFatWars">Fat Jars and Fat Wars</h3><p>The easiest way to create a Camel-aware Spring Boot fat jar/war is to extend the <strong><code><span style="line-height: 1.42857;">org</span><span style="line-height: 1.42857;">.apache.camel.spring.boot.F</span><code style="line-height: 1.4285715;">atJarRouter</code></code></strong><span style="line-height: 1.4285715;"> class:</span></p><p> </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[package com.example;
... // imports
@@ -250,9 +244,8 @@ public class MyFatJarRouter extends FatJ
String helloWorld() {
return "helloWorld";
}
-
}]]></script>
-</div></div><p> </p><p>...and add the following property to your <code>application.properties</code> file:</p><p> </p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p> </p><p>...and add the following property to your <strong><code>application.properties</code></strong> file:</p><p> </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[spring.main.sources = com.example.MyFatJarRouter]]></script>
</div></div><p>It is also recommended to define your main class explicitly in the Spring Boot Maven plugin configuration: </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[ <plugin>
@@ -270,28 +263,26 @@ public class MyFatJarRouter extends FatJ
</execution>
</executions>
</plugin>]]></script>
-</div></div><p>In order to turn your fat jar into fat war, add the following class extending  <code><span>org</span><span>.apache.camel.spring.boot.F</span><code>atWarInitializer</code></code><span> </span>to your project:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>In order to turn your fat jar into fat war, add the following class extending  <strong><code>org.apache.camel.spring.boot.F<code>atWarInitializer</code></code></strong><span> </span>to your project:</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[package com.example;
... // imports
public class MyFatJarRouterWarInitializer extends FatWarInitializer {
-
@Override
protected Class<? extends FatJarRouter> routerClass() {
return MyFatJarRouter.class;
}
-
}]]></script>
-</div></div><h3 id="SpringBoot-Blockingmainthread">Blocking main thread</h3><p>This feature is available starting from Camel <strong>2.15.2</strong>. Camel applications extending FatJarRouter by default block the main thread of the application. It means that after you start your fat jar, your application waits for Ctrl+C signal and does not exit immediately. If you would like to achieve similar behavior for non-<code>FatJarRouter</code> applications, retrieve <code><span style="line-height: 1.4285715;">CamelSpringBootApplicationController </span></code><span style="line-height: 1.4285715;">bean from your <code>ApplicationContext</code> and use the former to block the main thread of your application using <span><code>CamelSpringBootApplicationController#blockMainThread()</code> method</span>.</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringBoot-BlockingMainThread">Blocking Main Thread</h3><p>This feature is available starting from Camel <strong>2.15.2</strong>. Camel applications extending FatJarRouter by default block the main thread of the application. It means that after you start your fat jar, your application waits for <strong><code>Ctrl+C</code></strong> signal and does not exit immediately. If you would like to achieve similar behavior for non-<strong><code>FatJarRouter</code></strong> applications, retrieve <strong><code><span style="line-height: 1.42857;">CamelSpringBootApplicationController </span></code></strong><span style="line-height: 1.4285715;">bean from your <strong><code>ApplicationContext</code></strong> and use the former to block the main thread of your application using <span><strong><code>CamelSpringBootApplicationController#blockMainThread()</code></strong> method</span>.</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeCo
ntent panelContent pdl">
<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public static void main(String... args) {
ApplicationContext applicationContext = new SpringApplication(MyCamelApplication.class).run(args);
CamelSpringBootApplicationController applicationController =
applicationContext.getBean(CamelSpringBootApplicationController.class);
applicationController.blockMainThread();
}]]></script>
-</div></div><h3 id="SpringBoot-AddingXMLroutes">Adding XML routes</h3><p>By default you can put Camel XML routes in the classpath under the directory camel, which camel-spring-boot will auto detect and include. From <strong>Camel 2.17</strong> onwards you can configure the directory name or turn this off using the configuration option</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringBoot-AddingXMLRoutes">Adding XML Routes</h3><p>By default you can put Camel XML routes in the classpath under the directory camel, which camel-spring-boot will auto detect and include. From <strong>Camel 2.17</strong>: you can configure the directory name or turn this off using the configuration option:</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[// turn off
camel.springboot.xmlRoutes = false
// scan in the com/foo/routes classpath
@@ -306,7 +297,7 @@ camel.springboot.xmlRoutes = classpath:c
<to uri="log:out"/>
</route>
</routes>]]></script>
-</div></div><h3 id="SpringBoot-Addingrest-dsl">Adding rest-dsl</h3><p><strong>Available since Camel 2.18</strong></p><p>By default you can put Camel Rest-DSL XML routes in the classpath under the directory camel-rest, which camel-spring-boot will auto detect and include.<br clear="none">You can configure the directory name or turn this off using the configuration option</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="SpringBoot-AddingRest-DSL">Adding Rest-DSL</h3><p><strong>Available since Camel 2.18</strong></p><p>By default you can put Camel Rest-DSL XML routes in the classpath under the directory <strong><code>camel-rest</code></strong>, which <strong><code>camel-spring-boot</code></strong> will auto detect and include.</p><p> </p><p>You can configure the directory name or turn this off using the configuration option:<code> <br clear="none"></code></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[// turn off
camel.springboot.xmlRests = false
// scan in the com/foo/routes classpath