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 2018/11/14 10:52:12 UTC

[camel-k] 01/08: chore(runtime) : add a java rest example with restlet

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 98675df75a98a41c0fb942120098c7ceb1b29f47
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed Nov 14 11:10:41 2018 +0100

    chore(runtime) : add a java rest example with restlet
---
 runtime/examples/RestWithRestlet.java | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/runtime/examples/RestWithRestlet.java b/runtime/examples/RestWithRestlet.java
new file mode 100644
index 0000000..16c77c7
--- /dev/null
+++ b/runtime/examples/RestWithRestlet.java
@@ -0,0 +1,21 @@
+//
+// To run this integrations use:
+//
+//     kamel run --name=rest-with-restlet --dependency=camel-restlet runtime/examples/RestWithRestlet.java
+//
+public class RestWithRestlet extends org.apache.camel.builder.RouteBuilder {
+    @Override
+    public void configure() throws Exception {
+        restConfiguration()
+            .component("restlet")
+            .host("localhost")
+            .port("8080");
+
+        rest()
+            .get("/hello")
+            .to("direct:hello");
+
+        from("direct:hello")
+            .transform().simple("Hello World");
+    }
+}
\ No newline at end of file