You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2019/11/23 10:52:33 UTC

[camel-k] branch master updated: add wrapper for processor functions

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

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


The following commit(s) were added to refs/heads/master by this push:
     new dc5e659  add wrapper for processor functions
dc5e659 is described below

commit dc5e6596967828d61dcd2ba1fc69dbaa05b94b42
Author: Hugo Guerrero <10...@users.noreply.github.com>
AuthorDate: Wed Nov 20 11:50:23 2019 -0500

    add wrapper for processor functions
---
 examples/routes.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/routes.js b/examples/routes.js
index 9339257..c9243ab 100644
--- a/examples/routes.js
+++ b/examples/routes.js
@@ -19,6 +19,8 @@
 //
 //     kamel run examples/routes.js
 //
+const org_apache_camel_Processor = Java.type("org.apache.camel.Processor");
+const Processor = Java.extend(org_apache_camel_Processor);
 
 l = components.get('log');
 l.setExchangeFormatter(e => {
@@ -29,7 +31,7 @@ from('timer:js?period=1s')
     .routeId('js')
     .setBody()
         .simple('Hello Camel K')
-    .process(e => {
+    .process(new Processor(e => {
         e.getIn().setHeader('RandomValue', Math.floor((Math.random() * 100) + 1))
-    })
+    }))
     .to('log:info');
\ No newline at end of file