Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-314

JMXExporter should escape the values of targetCompId and other session params

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.2
    • Component/s: Engine
    • Labels:
      None

      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(','); }

      sb.append(name).append('=').append(value);
      }
      }

      public ObjectName createName() throws MalformedObjectNameException

      { return ObjectName.getInstance("org.quickfixj:" + sb); }

      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dumitriu Dan Mihai Dumitriu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: