You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by GitBox <gi...@apache.org> on 2018/11/08 14:26:20 UTC

[GitHub] MarcoLunar commented on issue #205: Provide example with custom processor

MarcoLunar commented on issue #205: Provide example with custom processor
URL: https://github.com/apache/camel-k/issues/205#issuecomment-437011238
 
 
   Yes, lambda works :)
   
   `[Camel (camel-1) thread #2 - timer://tick] info - Exchange[ExchangePattern: InOnly, BodyType: String, Body: HELLO]`
   
   This Java code works:
   
   `public class Sample extends RouteBuilder {
   
       @Override
       public void configure() throws Exception {
           from("timer:tick?period=10s")
                   .setBody(constant("Hello"))
                   .process(exchange -> {
                       String body = exchange.getIn().getBody(String.class);
                       body = body.toUpperCase();
                       exchange.getOut().setBody(body);
                   })
                   .to("log:info?skipBodyLineSeparator=false");
       }
   
   }
   `
   
   Thank you!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services