Camel K with Jolt transformer - apache-camel

I am using camel and use JOLT transformer to transform from JSON TO JSON and it works fine when deploying on spring boot or even when using camel as stand-alone. But when trying to switch to Camel-K I am facing some problems, I cant refer to the Jolt template transformation inside the camel route or even add it to the deployment. Anybody have the info on how can I attach the Jolt transformer template to camel K to be able to use it in the route.
Thanks.

you can use the --resource flag to add a resource to the camel-k classpath:
kamel run my-integration.groovy --resource=spec.json
and then use in in your integration
to('jolt:spec.json')
we are working on improving the support for resource handling: https://github.com/apache/camel-k/issues/2003

Related

SOLR - adding custom REST service

I am using SOLR 8.x. and I am trying to adding some custom functionality. Say like, triggering some server specific shell scripts. Adding custom code JARs to the lib folder and adding the jars in solrconfig.xml is not working.
Or how to set up new SOLR version in eclipse(most of the docs online are for older version where SOLR was still a .war)
Any pointers would be much appreciated.
I was able to achieve this by adding the custom jar(HTTPServlet based) to server/lib folder and by updating web.xml with servlet & servlet-mapping.

Is there a KairosDB component for Apache Camel?

I can't find a Camel component for KairosDB. Is there none?
Should I write a custom component or is there a smarter way?
Thanks
There is no official component for that. You can find the list of components at: https://github.com/apache/camel/tree/master/components#components
Yes you would need to write your own component, or just use regular Java code in a Java bean to integrate with KairosDB and then Camel can integrate with your Java bean. Or use a Camel Processor instead of a Java bean.
But writing a component is not so hard, and if you use KairosDB in more projects with Camel then it starts to make sense to build a Camel component for it. The Apache Camel project loves contributions: http://camel.apache.org/contributing

Validate Camel route programmatically

I'm working on a logging solution where Camel routes are defined at runtime with a Java DSL String. I wonder if there's a way to check programmatically some errors such as components not found in the route. The only option I was able to find is catching the org.apache.camel.ResolveEndpointFailedException and dig into the error message. Is there a better way to validate the route?
Just to give an example, it would be good to ascertain if a route syntax is completely wrong or if just a component wasn't found so that I can output a message e.g. "install ftp component".
You can use Fabric8 Camel Maven Plugin (http://fabric8.io/guide/camelMavenPlugin.html) for validating Camel endpoints in the source code.
Look at this article by Claus Ibsen to get more information : https://blog.fabric8.io/cheers-fabric8-camel-maven-plugin-to-validate-camel-endpoints-from-source-code-8768aff76b41#.wcji8hfdg

Solr: Load custom transformer jars at runtime using blob store API

I'm trying to use solr's upjars feature for loading custom transformers but it's not working, The upjars feature worked for custom ResponseWriters and QueryParsers but not for transformers.
Are transformers not included in the upjars feature?
Is writing a Custom dataimporthandler to load it with the transformers at runtime the only solution?

How to deploy Custom Dataformat in camel

I am running Camel inside Karaf.
I have created a custom dataformat by implementing DataFormat interface.
Now I have my custom class.
In order to make it visible to my camel route inside karaf where to copy this class file?
Please provide guidance.
I'd just add it to my Camel application source code and deploy it with that bundle. If you need to reuse it across several bundles, then you could package it as a separate bundle and export/import it appropriately I suppose...

Resources