One Star

Where to put flatpack config file ?

Hi,
I have to use a flatpack for a fixed-sized file ; according to camel and talend flatpack documentation (https://help.talend.com/search/all?query=Flatpack+Component&content-lang=en) I have to create a config file to define columns.
In the Studio, where do I put the config file, and how do I reference it in flatpack URI ?
Best regards,
Christophe
3 REPLIES
Employee

Re: Where to put flatpack config file ?

Hi Christophe,
In the 'Mediation' Perspective (Route Builder):
1) add your config file to to 'Resource' node (right mouse click on the resources allows you to import it)
2) add this resource to your route (use also right mouse click on you route to do this)
3) use classpath:// {your resource name} to refer this resource.
Haven't really tried it but this is the way it works for nearly all components as long as they support to get the resource from the classpath at runtime (which is the case for all / most camel components.
When you export or publish your route the flatpack config file will automatically added by our studio to export (kar/jar files) and is accecible for the component by this using the classpath:// (instead of an external file file:// )
HTH,
Dietmar
One Star

Re: Where to put flatpack config file ?

Thanks for your response.
I can not find how to do point 2.
When I export in .kar archive file, the resource is not present in classpath.
Is there a best-practice way to give name to resources ?
My URI is
"flatpack:fixed:classpath://sicta-flatpack-config?splitRows=true"
Best regards,
Christophe
One Star

Re: Where to put flatpack config file ?

Ok, I've solved everything, it now works perfectly.
Thanks a lot,
Christop?e