camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lburgazz...@apache.org
Subject [camel-k] 01/08: chore(runtime) : add a java rest example with restlet
Date Wed, 14 Nov 2018 10:52:12 GMT
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 <lburgazzoli@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


Mime
View raw message