You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "milank78git (via GitHub)" <gi...@apache.org> on 2023/06/14 10:23:16 UTC

[GitHub] [camel-k] milank78git commented on issue #4484: pod-template with knative in rest integration

milank78git commented on issue #4484:
URL: https://github.com/apache/camel-k/issues/4484#issuecomment-1590922963

   @squakez 
   Thanks your answer .
   I'm sorry, but I don't understand at all. If I use this integration, it will lead to deployment. 
   
   ```
   > from('file:///var/log')
   >  .convertBodyTo(String.class)
   >  .setBody().simple('${body}:  {{TEST_VARIABLE}} ')
   >  .log('${body}')
   > 
   ```
   
   However, if I add a route for the REST, it will result in the mentioned error. If I only want REST, the same applies
   
   ```
   > 
   > import org.apache.camel.CamelContext;
   > import org.apache.camel.Exchange;
   > import org.apache.camel.Processor;
   > 
   > public class RestDSL extends org.apache.camel.builder.RouteBuilder {
   >     @Override
   >     public void configure() throws Exception {
   >         from("file:///var/log")
   >             .convertBodyTo(String.class)
   >             .setBody().simple("${body}: {{TEST_VARIABLE}} ")
   >             .log("${body}");
   > 
   >         rest()
   >             .get("/hello")
   >             .to("direct:hello");
   > 
   >         from("direct:hello")
   >             .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
   >             .log("Hello World 2")
   >             .log(String.valueOf(simple("headers:${headers}")))
   >             .process(new Processor(){
   >                 @Override
   >                 public void process(Exchange exchange) throws Exception {
   >                     CamelContext ctx = exchange.getContext();
   >                     System.out.println("can be breakpoint on this line :" + ctx.getName());
   >                 }
   >             })
   >             .transform().simple("Hello World");
   >     }
   > }
   > 
   ```
   pod-template is the same
   
   ```
   > template.yaml
   > containers:
   >   - name: integration
   >     env:
   >       - name: TEST_VARIABLE
   >         value: "hello from the template"
   >     volumeMounts:
   >       - name: var-logs
   >         mountPath: /var/log
   >   - name: sidecar
   >     image: busybox
   >     command: [ "/bin/sh" , "-c", "while true; do echo $(date -u) 'Content from the sidecar container' > /var/log/file.txt; sleep 1;done" ]
   >     volumeMounts:
   >       - name: var-logs
   >         mountPath: /var/log
   > volumes:
   >   - name: var-logs
   >     emptyDir: { }
   ```
   
   Why does adding or change REST integration result in a path error?
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org