You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by he...@apache.org on 2015/04/24 09:30:25 UTC
camel git commit: Spring Boot example is not the proper fat WAR.
Repository: camel
Updated Branches:
refs/heads/master dd1f69450 -> c86c2f11f
Spring Boot example is not the proper fat WAR.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c86c2f11
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c86c2f11
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c86c2f11
Branch: refs/heads/master
Commit: c86c2f11f090a54c4a721ac51c4c0fd401192e24
Parents: dd1f694
Author: Henryk Konsek <he...@gmail.com>
Authored: Fri Apr 24 09:30:20 2015 +0200
Committer: Henryk Konsek <he...@gmail.com>
Committed: Fri Apr 24 09:30:20 2015 +0200
----------------------------------------------------------------------
examples/camel-example-spring-boot/README.txt | 8 ++++++
.../boot/MySpringBootRouterWarInitializer.java | 29 ++++++++++++++++++++
2 files changed, 37 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/c86c2f11/examples/camel-example-spring-boot/README.txt
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot/README.txt b/examples/camel-example-spring-boot/README.txt
index 53ed3d5..468a898 100644
--- a/examples/camel-example-spring-boot/README.txt
+++ b/examples/camel-example-spring-boot/README.txt
@@ -10,12 +10,20 @@ This example exposes Jolokia API and Spring Boot actuators endpoints (like metri
this as the best practice - Spring Boot applications with these API exposed can be easily monitored and managed by the
3rd parties tools.
+We 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. Fat WAR approach gives you the deployment flexibility, so we highly
+recommend it.
+
You will need to compile this example first:
mvn install
To run the example type
mvn spring-boot:run
+You can also execute the fat WAR directly:
+
+ java -jar target/camel-example-spring-boot-2.x-SNAPSHOT.war
+
You will see the message printed to the console every second.
To stop the example hit ctrl + c
http://git-wip-us.apache.org/repos/asf/camel/blob/c86c2f11/examples/camel-example-spring-boot/src/main/java/org/apache/camel/example/spring/boot/MySpringBootRouterWarInitializer.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot/src/main/java/org/apache/camel/example/spring/boot/MySpringBootRouterWarInitializer.java b/examples/camel-example-spring-boot/src/main/java/org/apache/camel/example/spring/boot/MySpringBootRouterWarInitializer.java
new file mode 100644
index 0000000..e0640f8
--- /dev/null
+++ b/examples/camel-example-spring-boot/src/main/java/org/apache/camel/example/spring/boot/MySpringBootRouterWarInitializer.java
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.example.spring.boot;
+
+import org.apache.camel.spring.boot.FatJarRouter;
+import org.apache.camel.spring.boot.FatWarInitializer;
+
+public class MySpringBootRouterWarInitializer extends FatWarInitializer {
+
+ @Override
+ protected Class<? extends FatJarRouter> routerClass() {
+ return MySpringBootRouter.class;
+ }
+
+}