It would be good to add more examples implementations using kaoto. #1006
Replies: 17 comments 2 replies
-
Hi @FlightControl-User, thanks for raising this. How would you envision these sample implementations? As entries in the workshop list? Or similar to the Camel examples repository? |
Beta Was this translation helpful? Give feedback.
-
I would actually envision both of them, but first to add them in the camel examples repository. And then work out the example on the web page and put a link on the web page to the github example repository. I'm looking into kaoto and think it has great potential. However, when it comes to scripting or create concrete flows, I notice things aren't always so clear. I do have camel experience through coding using DSL, but when it comes to doing similar things with kaoto I struggle. Note that the example repo is today empty. Sven |
Beta Was this translation helpful? Give feedback.
-
Thanks for this piece of feedback, can we expand on this topic? Could you point out where the struggle comes from, so we could work through them? |
Beta Was this translation helpful? Give feedback.
-
Okay. Thanks.Verzonden vanaf Outlook voor AndroidVan: Ricardo M. ***@***.***>Verstuurd: vrijdag, april 12, 2024 4:11:02 p.m.Aan: KaotoIO/kaoto ***@***.***>CC: Sven Van de Velde ***@***.***>; Mention ***@***.***>Onderwerp: Re: [KaotoIO/kaoto] It would be good to add more examples implementations using kaoto. (Discussion #1006)
We could use this thread to expand on things that are no so clear.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
If you would like to contribute to the workshops on the webpage that would be very welcome. You can find the existing ones here: https://github.com/KaotoIO/kaoto.io/tree/main/content/workshop. If that is too much work you can also raise an issue in that repository with a specific workshop usecase and maybe already some working integration. We can then take care and create the workshop for it. |
Beta Was this translation helpful? Give feedback.
-
I see a lot of benefits demonstrating use cases that cover important integration patterns using simple open source adapters and format readers/writers. With simple file i/o and standard marshalling, one can easily demonstrate the key capabilities of Camel, and how to implement it using kaoto. I would really need some high-level guidance on how to implement a data transformation, based on unmarshalled data using an out-of-the-box adapter like SWIFT MX to an other format (like SWIFT MT) and marshal it again and write the output in a file. I'm struggling how to write a processor in kaoto and how to use the unmarshalled data contained in java objects to implement a mapping! It is totally unclear to me at this moment how this is working. Can somebody please clarify this mechanism and how to use the kaoto UI to realize this? (just in bullet points). Here i'm unmarshalling using the swiftmx adapter to a java object model; So if i now add a processor: where do I edit the code of the processor to map the exchange object onto the underlying java object models and to map it? |
Beta Was this translation helpful? Give feedback.
-
The parsing should be straight forward: - route:
id: route-2910
from:
id: from-2447
uri: timer:myTimer
parameters:
delay: 10000
steps:
- setBody:
id: setBody-2175
expression:
constant:
expression: |-
{1:F01TESTUS20AXXX0000000000}{2:I362GHUJBBXXXXXXN}{4:
:15A:
:20:444444-000001011
:22A:NEWT
:94A:AGNT
:22C:AAAAUSX001TEST20
:23A:FLOATFIXED/GROSS
:21N:444444
:30V:20090106
:30P:20100105
:82A:AAAAUSX0
:87A:AAAAUSX0
:15D:
:33F:USD5000000,
:30X:20090406
:37G:2,5
:37R:2,
:37M:4,5
:30F:20090706
:15E:
:18A:1
:30F:20090706
:32M:USD56875,
:57A:AAAAUSX0
AAAAUSX0
-}
- unmarshal:
id: unmarshal-4292
swiftMt:
writeInJson: true
- to:
id: to-1860
uri: log:ggg
parameters: {} The process you used above needs a bean reference. So you would actually need to create such a bean and depending on what you plan to do you probably have to write a Java class. That is atm a weak spot as we lack proper ootb support and assistance for that in Kaoto. |
Beta Was this translation helpful? Give feedback.
-
I had already succeeded myself to parse a PACS.008 SWIFT MX message by unmarshalling and then logging the output. That is the easy part, but then to develop a transformation it is a bit more tedious, correct? So how to start to write a transformer using a BEAN approach. Where do i start, I will have to edit the code using the VSCODE java editor I guess, correct? The "Ref" field in the process would need a "bean" procedure reference or something, correct? |
Beta Was this translation helpful? Give feedback.
-
Okay, I have more info. Looking into the tool called karavan, i found that when creating a process component step, when you give the reference (the name of the function that will process the incoming exchange object in java), you can click on a "+" button that generates the JAVA class for you in a file and adds this file to the camel repository! Such a feature is missing in kaoto! I'll add a feature request for that! It is a small thing, but it really helps novice users like me to understand what is going on, without having to search hundreds of web pages and youtube videos ... |
Beta Was this translation helpful? Give feedback.
-
Thank you, Sven. We will look at that. |
Beta Was this translation helpful? Give feedback.
-
So I've considered your request to help build some examples and documentation. Gradually, I will build nice examples while learning camel in more depth and also kaoto (and karavan). So I'm happy to accept a contribution status to the project. Suggest to approach this in two steps, to allow contributors like myself to add content:
A contributor guide on the kaoto github main page could also be written to guide potential future contributions to the process. Sven |
Beta Was this translation helpful? Give feedback.
-
I think we could use the https://github.com/KaotoIO/kaoto-examples repository for building an example collection. What do you think? |
Beta Was this translation helpful? Give feedback.
-
We started to fill the examples repository. |
Beta Was this translation helpful? Give feedback.
-
That sounds like a good plan. I'm happy to contribute on this repository. Great! |
Beta Was this translation helpful? Give feedback.
-
Currently building this: Jbang source:
The process has a processor camel java routine attached, with the following source code: import org.apache.camel.BindToRegistry;
import org.apache.camel.Configuration;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
@Configuration
@BindToRegistry("Convert")
public class Convert implements Processor {
public void process(Exchange exchange) throws Exception {
exchange.getIn().setBody("Hello World");
}
} But I get the following error when running it:
Any idea what could be the reason? Sven |
Beta Was this translation helpful? Give feedback.
-
Raised an enhancement request at KaotoIO/vscode-kaoto#556 |
Beta Was this translation helpful? Give feedback.
-
The current examples of using kaoto are too easy.
It would be great to have people contributing, building sample implementations illustrating:
...
Beta Was this translation helpful? Give feedback.
All reactions