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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

GitBox
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:
[hidden email]


With regards,
Apache Git Services