LibraryToggle FramesPrintFeedback

Available as of Camel 2.0

The quickfix component adapts the QuickFIX/J FIX engine for using in Camel . This component uses the standard Financial Interchange (FIX) protocol for message transport.

[Important]Previous Versions

The quickfix component was rewritten for Camel 2.5. For information about using the quickfix component prior to 2.5 see the documentation section below.

Maven users will need to add the following dependency to their pom.xml for this component:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-quickfix</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>

The exchange headers include information to help with exchange filtering, routing and other processing. The following headers are available:

Header Name Description
EventCategory One of AppMessageReceived, AppMessageSent, AdminMessageReceived, AdminMessageSent, SessionCreated, SessionLogon, SessionLogoff. See the QuickfixjEventCategory enum.
SessionID The FIX message SessionID
MessageType The FIX MsgType tag value
DataDictionary Specifies a data dictionary to used for parsing an incoming message. Can be an instance of a data dictionary or a resource path for a QuickFIX/J data dictionary file

The DataDictionary header is useful if string messages are being received and need to be parsed in a route. QuickFIX/J requires a data dictionary to parse certain types of messages (with repeating groups, for example). By injecting a DataDictionary header in the route after receiving a message string, the FIX engine can properly parse the data.

When the component detects an initiator or acceptor session setting in the QuickFIX/J configuration file it will automatically create the corresponding initiator and/or acceptor connector. These settings can be in the default or in a specific session section of the configuration file.

Session Setting Component Action
ConnectionType=initiator Create an initiator connector
ConnectionType=acceptor Create an acceptor connector

The threading model for the QuickFIX/J session connectors can also be specified. These settings affect all sessions in the configuration file and must be placed in the settings default section.

Default/Global Setting Component Action
ThreadModel=ThreadPerConnector Use SocketInitiator or SocketAcceptor (default)
ThreadModel=ThreadPerSession Use ThreadedSocketInitiator or ThreadedSocketAcceptor

The QuickFIX/J logger implementation can be specified by including the following settings in the default section of the configuration file. The ScreenLog is the default if none of the following settings are present in the configuration. It's an error to include settings that imply more than one log implementation.

Default/Global Setting Component Action
ScreenLogShowEvents Use a ScreenLog
ScreenLogShowIncoming Use a ScreenLog
ScreenLogShowOutgoing Use a ScreenLog
SLF4J* Camel 2.6+. Use a SLF4JLog. Any of the SLF4J settings will cause this log to be used.
FileLogPath Use a FileLog
JdbcDriver Use a JdbcLog
Default/Global Setting Component Action
UseJmx if Y, then enable QuickFIX/J JMX

Camel 2.6+

The QuickFIX/J component includes a Spring FactoryBean for configuring the session settings within a Spring context. A type converter for QuickFIX/J session ID strings is also included. The following example shows a simple configuration of an acceptor and initiator session with default settings for both sessions.

<!-- camel route -->
      <camelContext id="quickfixjContext" xmlns="http://camel.apache.org/schema/spring">
      <route>
      <from uri="quickfix:example"/>
      <filter>
      <simple>${in.header.EventCategory} == 'AppMessageReceived'</simple>
      <to uri="log:test"/>
      </filter>
      </route>
      </camelContext>
      
      <!-- quickfix component -->
      <bean id="quickfix" class="org.apache.camel.component.quickfixj.QuickfixjComponent">
      <property name="engineSettings">
      <util:map>
      <entry key="quickfix:example" value-ref="quickfixjSettings"/>
      </util:map>
      </property>
      <property name="messageFactory">
      <bean class="org.apache.camel.component.quickfixj.QuickfixjSpringTest.CustomMessageFactory"/>
      </property>
      </bean>
      
      <!-- quickfix settings -->
      <bean id="quickfixjSettings"
      class="org.apache.camel.component.quickfixj.QuickfixjSettingsFactory">
      <property name="defaultSettings">
      <util:map>
      <entry key="SocketConnectProtocol" value="VM_PIPE"/>
      <entry key="SocketAcceptProtocol" value="VM_PIPE"/>
      <entry key="UseDataDictionary" value="N"/>
      </util:map>
      </property>
      <property name="sessionSettings">
      <util:map>
      <entry key="FIX.4.2:INITIATOR->ACCEPTOR">
      <util:map>
      <entry key="ConnectionType" value="initiator"/>
      <entry key="SocketConnectHost" value="localhost"/>
      <entry key="SocketConnectPort" value="5000"/>
      </util:map>
      </entry>
      <entry key="FIX.4.2:ACCEPTOR->INITIATOR">
      <util:map>
      <entry key="ConnectionType" value="acceptor"/>
      <entry key="SocketAcceptPort" value="5000"/>
      </util:map>
      </entry>
      </util:map>
      </property>
      </bean>
    

Available since Camel 2.0

The quickfix component is an implementation of the QuickFIX/J engine for Java . This engine allows to connect to a FIX server which is used to exchange financial messages according to FIX protocol standard.

Note: The component can be used to send/receives messages to a FIX server.

Comments powered by Disqus