You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/11/22 20:09:44 UTC

[camel-k] branch master updated (ba196b2 -> ac324c1)

This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git.


    from ba196b2  Added unit tests for the deployment trait #255
     new 0e3babc  Add example that show how to split integration among multiple files
     new ac324c1  Fix rest example as camel-restlet has been removed

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../{RestWithRestlet.java => RestWithUndertow.java}     |  6 +++---
 examples/{Sample.java => polyglot/JavaRoute.java}       | 17 +++++++++++------
 examples/polyglot/README.adoc                           |  8 ++++++++
 .../{knative/printer.groovy => polyglot/beans.groovy}   |  8 +++++---
 examples/{hello.xml => polyglot/routes.xml}             |  9 ++++-----
 5 files changed, 31 insertions(+), 17 deletions(-)
 rename examples/{RestWithRestlet.java => RestWithUndertow.java} (84%)
 copy examples/{Sample.java => polyglot/JavaRoute.java} (71%)
 create mode 100644 examples/polyglot/README.adoc
 copy examples/{knative/printer.groovy => polyglot/beans.groovy} (88%)
 copy examples/{hello.xml => polyglot/routes.xml} (87%)


[camel-k] 02/02: Fix rest example as camel-restlet has been removed

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit ac324c133a64b5f52f0b1a4b17e6ca04df969a5e
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Fri Nov 22 17:02:38 2019 +0100

    Fix rest example as camel-restlet has been removed
---
 examples/{RestWithRestlet.java => RestWithUndertow.java} | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/RestWithRestlet.java b/examples/RestWithUndertow.java
similarity index 84%
rename from examples/RestWithRestlet.java
rename to examples/RestWithUndertow.java
index 188d8ad..63090a6 100644
--- a/examples/RestWithRestlet.java
+++ b/examples/RestWithUndertow.java
@@ -18,15 +18,15 @@
 //
 // To run this integrations use:
 //
-//     kamel run --name=rest-with-restlet --dependency=camel-rest --dependency=camel-restlet examples/RestWithRestlet.java
+//     kamel run --name=rest-with-undertow --dependency=camel-rest --dependency=camel-undertow examples/RestWithUndertow.java
 //
 import org.apache.camel.Exchange;
 
-public class RestWithRestlet extends org.apache.camel.builder.RouteBuilder {
+public class RestWithUndertow extends org.apache.camel.builder.RouteBuilder {
     @Override
     public void configure() throws Exception {
         restConfiguration()
-            .component("restlet")
+            .component("undertow")
             .host("0.0.0.0")
             .port("8080");
 


[camel-k] 01/02: Add example that show how to split integration among multiple files

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 0e3babc7d62dff883188227dc86c44394c255d0d
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Fri Nov 22 17:02:06 2019 +0100

    Add example that show how to split integration among multiple files
---
 examples/polyglot/JavaRoute.java | 31 +++++++++++++++++++++++++++++++
 examples/polyglot/README.adoc    |  8 ++++++++
 examples/polyglot/beans.groovy   | 23 +++++++++++++++++++++++
 examples/polyglot/routes.xml     | 29 +++++++++++++++++++++++++++++
 4 files changed, 91 insertions(+)

diff --git a/examples/polyglot/JavaRoute.java b/examples/polyglot/JavaRoute.java
new file mode 100644
index 0000000..2522b34
--- /dev/null
+++ b/examples/polyglot/JavaRoute.java
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.Processor;
+
+public class JavaRoute extends RouteBuilder {
+    @Override
+    public void configure() throws Exception {
+    }
+
+    @BindToRegistry
+    public static Processor javaProcessor() {
+        return e -> e.getMessage().setHeader("MyHeader", "HelloFromJava");
+    }
+}
\ No newline at end of file
diff --git a/examples/polyglot/README.adoc b/examples/polyglot/README.adoc
new file mode 100644
index 0000000..76f29bc
--- /dev/null
+++ b/examples/polyglot/README.adoc
@@ -0,0 +1,8 @@
+= Example of route built using multiple DSl
+
+To run it:
+
+[source,shell]
+----
+$ kamel run --name polyglot routes.xml beans.groovy JavaRoute.java
+----
\ No newline at end of file
diff --git a/examples/polyglot/beans.groovy b/examples/polyglot/beans.groovy
new file mode 100644
index 0000000..cdfaf01
--- /dev/null
+++ b/examples/polyglot/beans.groovy
@@ -0,0 +1,23 @@
+// camel-k: language=groovy
+/*
+ * 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.
+ */
+
+beans {
+    groovyProcessor = {
+        it.in.body = 'Hello from Groovy'
+    } as org.apache.camel.Processor
+}
\ No newline at end of file
diff --git a/examples/polyglot/routes.xml b/examples/polyglot/routes.xml
new file mode 100644
index 0000000..e7d2bc7
--- /dev/null
+++ b/examples/polyglot/routes.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns="http://camel.apache.org/schema/spring"
+        xsi:schemaLocation="
+            http://camel.apache.org/schema/spring
+            http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+    <route id="polyglot">
+        <from uri="timer:hello?period=3s"/>
+        <process ref="javaProcessor"/>
+        <process ref="groovyProcessor"/>
+        <to uri="log:info?showAll=true&amp;multiline=true"/>
+    </route>
+
+</routes>