QuickFIX/J User Manual

Managing QFJ Applications with JMX

QuickFIX/J provides FIX engine monitoring and control using standard Java JMX MBeans. See the Java 6 Monitoring and Management information for more details about JMX. Java 5 also includes built-in support for JMX. External libraries must be used with JDK 1.4 applications. However, this is an option feature so no changes to existing JDK 1.4 application are required if JMX is not desired.

QFJ MBeans

The following MBeans are available:

Adding JMX support to a QFJ application

MX support is an optional feature. It is enabled for each initiator or acceptor by using the JmxExporter utility class.
acceptor = new SocketAcceptor
    (application, messageStoreFactory, settings, logFactory, messageFactory);

JmxExporter jmxExporter = new JmxExporter();
ObjectName connectorObjectName = jmxExporter.register(acceptor);

acceptor.start();

// Later... if you need to unregister the connector MBean
// This should only be needed if you destroying connectors in
// an application (not typical).
jmxExporter.getMBeanServer().unregisterMBean(connectorObjectName);
By default, the exporter will try to use the Java 5+ platform MBean server. You can also create an exporter for an MBeanServer created by the application.

Accessing JMX MBeans Remotely

To access JMX MBeans from a separate process (for example, a management console) a JMX connector must be used. The easiest way to expose the MBeans is to use Java 6 and the JConsole application included in the Java 6 JDK. Just start the JConsole application and you will be shown a dialog that allows you to connect to your QFJ JMX-enabled application.


QFJ Session Attributes in JConsole


QFJ Session Operations in JConsole

Use Java 5, you must add the -Dcom.sun.management.jmxremote system property when running your QFJ application. This will enable a connector included with Java 5 that will allow MBeans to be viewed in JConsole (only on the local machine).

Java 1.4 applications must use a separate library to expose the QFJ MBeans. One very popular option is to use the MX4J library. MX4J includes standard RMI connector and several other options for exposing MBeans (including HTTP). See the MX4J documentation for more details.

JMX Notifications

The QFJ JMX Sesson MBean provides notifications related to state change events. The JMX notification type is quickfix.Session. The event names are shown in the following table.

Event NameDescription
connect Socket connection associated with session
disconnect Socket connection disassociated from session
logon Session logged on
logout Session logged out
missedHeartBeat Missed heart beat (possible dead connection)
heartBeatTimeout Second heartbeat missed
refresh Session state refreshed from session store.
reset Session state reset

Related JMX Management Tools

JConsole is a convenient tools for accessing JMX MBeans, but there are also many other options. The following table lists a few examples.

ToolTypeDescription
VisualVM Part of the JDK
MX4J Open SourceIncludes an HTTP adapter that can be embedded in your QFJ process and then accessed through a browser.
MC4J Open SourceA management UI build on the NetBeans platform.
JManage Open SourceA web-based management console with alerting and monitoring capabilities. It also provides a command line interface.
WebJMX Open SourceJSP tag library
AdventNet CommercialSee product site.
HP OpenView CommercialSee product site.