You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/05/27 23:36:43 UTC

[GitHub] [camel-k] bzdgn opened a new issue #2341: Json marshalling is needed for Rest route and uncommented code seems to be executed

bzdgn opened a new issue #2341:
URL: https://github.com/apache/camel-k/issues/2341


   I've applied the camel [rest dsl example here](https://camel.apache.org/manual/latest/rest-dsl.html#_rest_dsl_with_java) for the Camel K, the simple integration file is as follows, which fails;
   
   ```java
   import org.apache.camel.builder.RouteBuilder;
   
   public class RestRoute extends RouteBuilder {
   
       @Override
       public void configure() throws Exception {
           
           // rest endpoints
           rest("/status")
               .get("/hello").to("direct:hello");
           
           // routes
           from("direct:hello")
               .transform().constant("Hello World");
           
       }
   
   }
   ```
   
   However, if I add ```marshal().json()``` line to the route, it works;
   
   ```java
   import org.apache.camel.builder.RouteBuilder;
   
   public class RestRoute extends RouteBuilder {
   
       @Override
       public void configure() throws Exception {
           
           // rest endpoints
           rest("/status")
               .get("/hello").to("direct:hello");
           
           // routes
           from("direct:hello")
               .transform().constant("Hello World")
               .marshal().json();
           
       }
   
   }
   ```
   
   And even if I comment out the ```marshal().json()``` line, it continues to work;
   
   ```java
   import org.apache.camel.builder.RouteBuilder;
   
   public class RestRoute extends RouteBuilder {
   
       @Override
       public void configure() throws Exception {
           
           // rest endpoints
           rest("/status")
               .get("/hello").to("direct:hello");
           
           // routes
           from("direct:hello")
               .transform().constant("Hello World")
               .marshal().json();
           
       }
   
   }
   ```
   
   Is there a problem with this example, or the code I've shared, or is this a bug?
   
   I've also asked this on stackoverflow but I suspect that it may be a bug;
   
   https://stackoverflow.com/questions/67731034/camel-k-rest-route-needs-json-marshalling-and-commented-code-executed


-- 
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.

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



[GitHub] [camel-k] lburgazzoli commented on issue #2341: Json marshalling is needed for Rest route and uncommented code seems to be executed

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #2341:
URL: https://github.com/apache/camel-k/issues/2341#issuecomment-853774817


   I tried to run the same example but it is working for me. 
   I suspect there is an issue with pulling the base image for the kit, can you try to delete all the kits ?
   
       kubectl delete integrationkits --all
   


-- 
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.

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



[GitHub] [camel-k] lburgazzoli commented on issue #2341: Json marshalling is needed for Rest route and uncommented code seems to be executed

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #2341:
URL: https://github.com/apache/camel-k/issues/2341#issuecomment-853774817


   I tried to run the same example but it is working for me. 
   I suspect there is an issue with pulling the base image for the kit, can you try to delete all the kits ?
   
       kubectl delete integrationkits --all
   


-- 
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.

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



[GitHub] [camel-k] bzdgn commented on issue #2341: Json marshalling is needed for Rest route and uncommented code seems to be executed

Posted by GitBox <gi...@apache.org>.
bzdgn commented on issue #2341:
URL: https://github.com/apache/camel-k/issues/2341#issuecomment-850205329


   I'm attaching the terminal output and the operator logs here.
   
   **Terminal output** that includes the output of the kamel ```--dev``` mode;
   
   [Terminal Output](https://github.com/apache/camel-k/files/6558999/camel-k-terminal-on-dev-mode.txt)
   
   **Camel K Operator logs** taken from the MiniKube;
   
   [Camel K Operator logs](https://github.com/apache/camel-k/files/6559002/logs-from-camel-k-operator-in-camel-k-operator-784d84fdc9-vnq96.txt)
   
   
   


-- 
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.

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



[GitHub] [camel-k] github-actions[bot] closed issue #2341: Json marshalling is needed for Rest route and uncommented code seems to be executed

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #2341:
URL: https://github.com/apache/camel-k/issues/2341


   


-- 
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



[GitHub] [camel-k] github-actions[bot] commented on issue #2341: Json marshalling is needed for Rest route and uncommented code seems to be executed

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #2341:
URL: https://github.com/apache/camel-k/issues/2341#issuecomment-1011566874


   This issue has been automatically marked as stale due to 90 days of inactivity. 
   It will be closed if no further activity occurs within 15 days.
   If you think that’s incorrect or the issue should never stale, please simply write any comment.
   Thanks for your contributions!


-- 
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



[GitHub] [camel-k] lburgazzoli commented on issue #2341: Json marshalling is needed for Rest route and uncommented code seems to be executed

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #2341:
URL: https://github.com/apache/camel-k/issues/2341#issuecomment-943099893


   @bzdgn any update on this ?


-- 
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