Details
Description
The problem is that sometimes the SenderSubID contains the ':' character, and that totally messes up the JMX ObjectName. For instance, if the SessionSubID=ABC:ABC, the JMXExporter will create a name that violates the JMX naming spec.
The culprit code is below, which basically creates an ObjectName of the form "org.quickfixj:key1=value1,key2=value2,key3=value3". If any key or value has a ':' or a '=' or a ',' in it, it will be messed up. These characters should be escaped, like with '_'.
public class ObjectNameFactory {
private StringBuffer sb = new StringBuffer();
public void addProperty(String name, String value) {
if (value != null && value.length() > 0) {
if (sb.length() > 0)
sb.append(name).append('=').append(value);
}
}
public ObjectName createName() throws MalformedObjectNameException
{ return ObjectName.getInstance("org.quickfixj:" + sb); }}