Add Apache Camel to the list of applications
See original GitHub issueApache Camel 2.17 ships with spring-boot support, and is able to work with the initializer project, so it can be listed in the choices.
There is some more details here https://github.com/spring-projects/spring-boot/pull/5426#issuecomment-197341210
And from the Camel website at http://camel.apache.org/spring-boot
What Camel 2.17 brings to the table is a camel-spring-boot-starter module that is similar to the other starter modules. So end users can just add this dependency and have Apache Camel enabled.
Then Camel routes can be created and automatic started by Camel such as adding java code as follows:
package com.example;
import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;
@Component
public class MyRoutes extends RouteBuilder {
@Override
public void configure() throws Exception {
from("timer:foo")
.setBody().constant("Hello Spring")
.to("log:foo");
}
}
Which when you run mvn spring-boot:run
is starting Camel with the route:
...
2016-03-28 09:21:13.947 INFO 59024 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-03-28 09:21:14.000 INFO 59024 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-03-28 09:21:14.323 INFO 59024 --- [ main] o.a.c.i.converter.DefaultTypeConverter : Loaded 183 type converters
2016-03-28 09:21:14.536 INFO 59024 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-03-28 09:21:14.619 INFO 59024 --- [ main] o.a.camel.spring.boot.RoutesCollector : Loading additional Camel XML routes from: classpath:camel/*.xml
2016-03-28 09:21:14.619 INFO 59024 --- [ main] o.a.camel.spring.boot.RoutesCollector : Loading additional Camel XML rests from: classpath:camel-rest/*.xml
2016-03-28 09:21:14.620 INFO 59024 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.17.0 (CamelContext: camel-1) is starting
2016-03-28 09:21:14.621 INFO 59024 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled
2016-03-28 09:21:14.763 INFO 59024 --- [ main] o.a.c.i.DefaultRuntimeEndpointRegistry : Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
2016-03-28 09:21:14.884 INFO 59024 --- [ main] o.a.camel.spring.SpringCamelContext : AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
2016-03-28 09:21:14.884 INFO 59024 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2016-03-28 09:21:14.944 INFO 59024 --- [ main] o.a.camel.spring.SpringCamelContext : Route: route1 started and consuming from: Endpoint[timer://foo]
2016-03-28 09:21:14.947 INFO 59024 --- [ main] o.a.camel.spring.SpringCamelContext : Total 1 routes, of which 1 are started.
2016-03-28 09:21:14.949 INFO 59024 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.17.0 (CamelContext: camel-1) started in 0.327 seconds
2016-03-28 09:21:15.030 INFO 59024 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-03-28 09:21:15.036 INFO 59024 --- [ main] com.example.DemoApplication : Started DemoApplication in 4.44 seconds (JVM running for 8.042)
2016-03-28 09:21:15.965 INFO 59024 --- [0 - timer://foo] foo : Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Spring]
Issue Analytics
- State:
- Created 7 years ago
- Reactions:155
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Getting Started - Apache Camel
Camel uses JBang for the Camel CLI. You can easily get up and running in a few steps. Step 1. Open your favorite...
Read more >Streamline Software Integration: An Apache Camel Tutorial
Work around the challenges of integrating software at scale with Apache Camel without compromising the overall architecture.
Read more >Chapter 6. Running Apache Camel application in Spring Boot
The Camel Spring Boot component auto-detects and embeds the Camel Rest-DSL XML routes that are added in the classpath under the camel-rest directory....
Read more >Camel deployment with multiple applications and routes
You should use Apache Karaf for this purpose. Apache Karaf is an OSGI container that has integration with Apache Camel and allows you...
Read more >Saddle up: A Camel tutorial for beginners | Tom Donohue
In other words, Camel is like glue for Java, that connects different applications together. The Apache Camel toolkit Riding with the Camel.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Screenshot of Apache Camel added
I apologize again for continuing my comment. This is what happens when engineers got together without politics. 😃
It’s refreshing to see that Apache Camel is there along with Spring Integration in the choices. It just feels good. Back in the FuseSource days this would’ve been cool so now with Camel being a Red Hat project it’s even more awesome to see this happening (I also very much appreciate that Spring Boot has Undertow starter). Thanks @davsclaus for working on such an excellent software and making it easier and more accessible to Spring Boot projects and thanks @snicoll for making such collaboration possible. 👍