Is Log4j2 configuration with properties case sensitive? - log4j2

Knowing that Configuration with XML is not case sensitive.Just curious to know about properties type.

Related

Can struts2-json-plugin accept upper camel case parameters?

I'm using struts2(struts2-json-plugin) to handle Content-Type=application/json request,
everything is fine where params style is lower camel case,like {"region":"China","version":"v4"}.
But it can't work when params is upper camel case,like {"Region":"China","Version":"v4"}.
I've already read struts docs(https://struts.apache.org/plugins/json/),and still not find the way to solve.
this is part of my struts.xml:
It can't work with case insensitive json objects because names are translated into Java class variables of the action class that are case sensitive.
The json plugin contains the interceptor named json which you should configure to the action to deserialize json content from the request. This answer points to some classes responsible for serialization/deserialization and populating Java objects.
If you don't want to populate the action then you should not use this interceptor. Instead manually parse the request with this or any other third party library to get the JSONObject. Or you could rewrite the interceptor and comment that code that is using JSONPopulator but deserialize the object with JSONUtil.
If you want to transform json objects with lower case names to camel case then you should override one of these classes before the population process to correspond to Java class variables names.

Valid values for Apache Flume Source, channel and Sink type

In Apache Flume we need to specify configuration details of Source, channel and Sink.
For each we must specify type and other properties depending on type.
Is there a reference page which enlists all types of Source, channel and Sink each. And then corresponding other properties based on type.
And when to use which type.
Can someone please point me to correct documentation ?
There is excellent documentation of all components on the official website: https://flume.apache.org/FlumeUserGuide.html

Can I directly store a type in an ADOJobStore in Quartz.Net

I would like to execute a job that requires that I save a type in the JobDataMap. This will later be used along with the ID of an entity to rehydrate the entity so the job can use it.
I know I could get the AssemblyQualifiedName of the type and store that, then use GetType() in the job, but before I go down that path, I thought I'd see if quartz just does this for me.
If I put a type in the JobDataMap, will it serialize and deserialize when I access the property later?
Sure it will. You can use the JobDataMap indexer to store arbitrary data. Type instances are quite safe, but you need to be extra careful about versions (using only assembly qualified name removes this problem), namespaces and public keys.
If there were a slight possibility that the type might change after persisting I would recommended using a 'meta name' like 'BackupJobHelperType' that you would then resolve to the actual type. Generelly always prefer simple serialization safe types over own types, if possible set quartz.jobStore.useProperties to true which will enforce string key and values.
You can save the info when building the job and it will be available when the job starts.

config.groovy meare with .property file in grails

In my config.groovy i have set ..
emailTo="admin#xzyz.com"
emailForm="notification#oabc.com"
but i want some flexibility in this. Can I change this while my project is running form property file ? Please help
Yes, you can use .property file as well, by default Grails looks for properties at:
in calss path ${appName}-config.properties
and global config ~/.grails/${appName}-config.properties
path passed as a system vaiable named ${appName}.config.location
Just take a look at first few lines of your Config.groovy, you can put there any other path to your own .properties
See also http://grails.org/doc/2.1.0/guide/conf.html#configExternalized
I believe there is a plugin to support dynamic reloading of external config files whenever they change, but conceptually if this is data that is supposed to be modifiable at runtime then maybe it would be better to represent it as a domain object and store it in the database.
I use this method on a number of projects, defining a domain class
class AppConfiguration {
String adminEmail
String appTitle
// etc
}
and ensuring there is always exactly one instance in the database, creating an initial instance in BootStrap if it is not already present. Now anywhere in the app that requires this config data I just do AppConfiguration.list()[0]
I just use dynamic scaffolding for the edit pages, which are restricted to be accessible only to admin users through Spring Security.

Ant task for generating XSD from POJOs

Is there an ant task for generating an XSD from POJOs?
I'm presuming that you want to serialize a Java POJO object and then use XSD to validate the serialised XML data, or author new object instances which can instantiated via your de-serialization process.
Thing is Java XML serialization comes in two favours (Examples follow):
Xstream XML is dynamically generated from fixed object class description
XMLBeans Java classes dynamically generated from fixed XML Schema
Now perhaps you're using something else that combines both approaches?
What I'd recommend is create (or generate) an XSD based on the XML your object creates when serialized. Relatively speaking Java objects don't change that often and when they do a far great challenge is supporting multiple versions (Reading data encoded for the older version of your object). To address this challenge I'd recommend reading the following article for one possible solution:
http://java.dzone.com/articles/migrate-serialized-java

Resources