Is there a way to tell Camel to use the Saxon library by default, so I would not need to specify it in every XLST transformation? E.g.:
.to("xslt:my-file.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl")
Specifying it in every endpoint makes code less readable.
I've seen suggestions (though in some other contexts) on setting environment property:
javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
Would this somehow be possible to be set within single camel context?
P.S. I am using Camel 2.10, so the saxon parameter suggestion is unfortunately not an option yet...
According to the documentation you can use:
.to("xslt:my-file.xsl?saxon=true")
which is much more readable
The system property setting is working for the whole JVM, it is not good way for the container setting.
You can extend the XsltComponent to set the transformerFactoryClass for you as camel-2.11.x does or you can just add an constant which hold the option of transformerFactoryClass.
Related
I Am working with flink 1.15.2, should i use Row or GenericRowData that inherit RowData for my own data type?, i mostly use streaming api.
Thanks.
Sig.
In general the DataStream API is very flexible when it comes to record types. POJO types might be the most convenient ones. Basically any Java class can be used but you need to check which TypeInformation is extracted via reflection. Sometimes it is necessary to manually overwrite it.
For Row you will always have to provide the types manually as reflection cannot do much based on class signatures.
GenericRowData should be avoided, it is rather an internal class with many caveats (strings must be StringData and array handling is not straightforward). Also GenericRowData becomes BinaryRowData after deserialization. TLDR This type is meant for the SQL engine.
The docs are actually helpful here, I was confused too.
The section at the top titled "All Known Implementing Classes" lists all the implementations. RowData and GenericRowData are described as internal data structures. If you can use a POJO, then great. But if you need something that implements RowData, take a look at BinaryRowData, BoxedWrapperRowData, ColumnarRowData, NestedRowData, or any of the implementations there that aren't listed as internal.
I'm personally using NestedRowData to map a DataStream[Row] into a DataStream[RowData] and I'm not at all sure that's a good idea :) Especially since I can't seem to add a string attribute
I'm asking myself if I can change the .mustache templates to use my own html in my Gollum-wiki. If so it doesn't seem to documented (or am I just blind?).
I mean this: https://github.com/gollum/gollum/blob/master/lib/gollum/templates/layout.mustache
Can I override it or is the only way to have a different markup to use a different wiki software?
It is possible, you can simply:
Make your changes to the templates you need and put them on a directory of your choice
Also copy any other (probably unmodified) templates that Gollum requires (this is a bit clunky, see Gollum's issue #1221) to that directory
Specify the template-dir option when launching Gollum
That will make Gollum to search for templates only in that location. At the time of writing, there is no fallback template location, or a way to override single templates. In any case, just copying all templates to template-dir will do exactly what you need.
Is there a way to set a property at the level of a Route, rather than an Exchange.
As a simplified example, if I wanted to have something like invocation-count or last-invoked-time and check/update it each time the route was triggered, how would I implement it?
You could implement that a number of ways.. using a simple Java class as a processor right after the "from", or as an interceptor (use interceptFrom): http://camel.apache.org/intercept.html.
Curiously though.. you should consider using the out-of-the-box Camel metrics. You should be covered by the defaults.
I didn't have this problem before 4.x upgrade. The problem is that I have a field whose omitTermFreqAndPositions attribute is set to true for various reasons. When a user performs phrase query explicitly or implicitly, it failed silently in Solr 3.5 or 3.6 but not in 4.x.
What would be a way to avoid this? One obvious way to reset omitTermFreqAndPositions to false but that's something I would like to avoid. I heard about implementing some kind of custom similarity class for this particular field but I would like to understand it better (so any explanation about it would be great whether it can be a solution for my problem).
You can create your own requestHandler, where there you will catch this exception and ignore it silently. See here
I want to write TokenFilter which behaves differently depending on other InputSolrDocument fields.
I've tried to accomplish this via ThreadLocal and InputProcessor but they run in different threads...
No, you cannot do that, see for instance the discussion here. You could try using an UpdateProcessor