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 2020/06/28 19:21:15 UTC
[GitHub] [camel-k] doru1004 opened a new issue #1581: Camel to Yaml transformation
doru1004 opened a new issue #1581:
URL: https://github.com/apache/camel-k/issues/1581
I have the following Camel code running with Camel K but I would like to transform this code into Yaml.
```
GsonDataFormat gson = new GsonDataFormat(MyClass.class);
from("timer:clock")
.setBody().header(Exchange.TIMER_COUNTER)
.setHeader("CamelHttpMethod", constant("GET"))
.to("http://some.address")
.unmarshal(gson)
.log("${body}")
```
If you can point me to an example that I may have missed or ideally some documentation that outlines the rules for Camel to Yaml transformation, I would be happy to look over them.
In the absence of that I'm afraid I cannot infer how the yaml code might look like so I would require some help to perform this transformation.
----------------------------------------------------------------
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] doru1004 closed issue #1581: Camel to Yaml transformation
Posted by GitBox <gi...@apache.org>.
doru1004 closed issue #1581:
URL: https://github.com/apache/camel-k/issues/1581
----------------------------------------------------------------
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 #1581: Camel to Yaml transformation
Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1581:
URL: https://github.com/apache/camel-k/issues/1581#issuecomment-652212621
Haven't tested but should be something like:
```yaml
- from
uri: "timer:clock"
steps:
- set-body:
header: "CamelTimerCounter"
- set-header:
name: "CamelHttpMethod"
constant: "GET"
- to:
uri: "http://some.address"
- unmarshal:
json:
library: "Gson"
unmarshal-type-name: MyClass
- log:
message: "${body}"
```
----------------------------------------------------------------
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] doru1004 commented on issue #1581: Camel to Yaml transformation
Posted by GitBox <gi...@apache.org>.
doru1004 commented on issue #1581:
URL: https://github.com/apache/camel-k/issues/1581#issuecomment-652637851
Thanks a lot for the answer! This was very useful to understand how to transform Camel into Yaml! I now have a working example! :)
----------------------------------------------------------------
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 edited a comment on issue #1581: Camel to Yaml transformation
Posted by GitBox <gi...@apache.org>.
lburgazzoli edited a comment on issue #1581:
URL: https://github.com/apache/camel-k/issues/1581#issuecomment-652212621
Haven't tested but should be something like:
```yaml
- from:
uri: "timer:clock"
steps:
- set-body:
header: "CamelTimerCounter"
- set-header:
name: "CamelHttpMethod"
constant: "GET"
- to:
uri: "http://some.address"
- unmarshal:
json:
library: "Gson"
unmarshal-type-name: MyClass
- log:
message: "${body}"
```
----------------------------------------------------------------
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