camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Quickfix
Date Tue, 30 Nov 2010 12:56:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/Quickfix">Quickfix</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~svc-apache@stevebate.net">Steve
Bate</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h3. Spring Configuration <br>
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*Camel
2.6+* <br> <br></td></tr>
            <tr><td class="diff-unchanged" >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.  <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="Quickfix-QuickFIX%2FJComponent"></a>QuickFIX/J Component</h2>

<p><b>Available as of Camel 2.0</b></p>

<p>The <b>quickfix</b> component adapts the <a href="http://www.quickfixj.org/"
class="external-link" rel="nofollow">QuickFIX/J</a> FIX engine for using in Camel
. This component uses the standard <a href="http://www.fixprotocol.org/" class="external-link"
rel="nofollow">Financial Interchange (FIX) protocol</a> for message transport.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Previous
Versions</b><br />The <b>quickfix</b> component was rewritten for
Camel 2.5. For information about using the <b>quickfix</b> component prior to
2.5 see the documentation section below.</td></tr></table></div>

<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt>
for this component:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;dependency&gt;</span>
    <span class="code-tag">&lt;groupId&gt;</span>org.apache.camel<span
class="code-tag">&lt;/groupId&gt;</span>
    <span class="code-tag">&lt;artifactId&gt;</span>camel-quickfix<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>x.x.x<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- use the same
version as your Camel core version --&gt;</span></span>
<span class="code-tag">&lt;/dependency&gt;</span>
</pre>
</div></div>

<h3><a name="Quickfix-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
quickfix:configFile[?sessionID=sessionID]
</pre>
</div></div>

<p>The <b>configFile</b> is the name of the QuickFIX/J configuration to
use for the FIX engine (located as a resource found in your classpath). The optional sessionID
identifies a specific FIX session. The format of the sessionID is:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
(BeginString):(SenderCompID)[/(SenderSubID)[/(SenderLocationID)]]-&gt;(TargetCompID)[/(TargetSubID)[/(TargetLocationID)]]
</pre>
</div></div>

<p>Example URIs:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
quickfix:config.cfg

quickfix:config.cfg?sessionID=FIX.4.2:MyTradingCompany-&gt;SomeExchange
</pre>
</div></div>

<h2><a name="Quickfix-Endpoints"></a>Endpoints</h2>

<p>FIX sessions are endpoints for the <b>quickfix</b> component. An endpoint
URI may specify a single session or all sessions managed by a specific QuickFIX/J engine.
Typical applications will use only one FIX engine but advanced users may create multiple FIX
engines by referencing different configuration files in <b>quickfix</b> component
endpoint URIs.</p>

<p>When a consumer does not include a session ID in the endpoint URI, it will receive
exchanges for all sessions managed by the FIX engine associated with the configuration file
specified in the URI. If a producer does not specify a session in the endpoint URI then it
must include the session-related fields in the FIX message being sent. If a session is specified
in the URI then the component will automatically inject the session-related fields into the
FIX message.</p>

<h3><a name="Quickfix-ExchangeFormat"></a>Exchange Format</h3>

<p>The exchange headers include information to help with exchange filtering, routing
and other processing. The following headers are available:</p>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header Name </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> EventCategory </td>
<td class='confluenceTd'> One of <tt>AppMessageReceived</tt>, <tt>AppMessageSent</tt>,
<tt>AdminMessageReceived</tt>, <tt>AdminMessageSent</tt>, <tt>SessionCreated</tt>,
<tt>SessionLogon</tt>, <tt>SessionLogoff</tt>. See the <tt>QuickfixjEventCategory</tt>
enum. </td>
</tr>
<tr>
<td class='confluenceTd'> SessionID </td>
<td class='confluenceTd'> The FIX message SessionID </td>
</tr>
<tr>
<td class='confluenceTd'> MessageType </td>
<td class='confluenceTd'> The FIX MsgType tag value </td>
</tr>
<tr>
<td class='confluenceTd'> DataDictionary </td>
<td class='confluenceTd'> 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 </td>
</tr>
</tbody></table>
</div>
</div>

<p>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.</p>

<h3><a name="Quickfix-QuickFIX%2FJConfigurationExtensions"></a>QuickFIX/J
Configuration Extensions</h3>

<p>When using QuickFIX/J directly, one typically writes code to create instances of
logging adapters, message stores and communication connectors. The <b>quickfix</b>
component will automatically create instances of these classes based on information in the
configuration file. It also provides defaults for many of the common required settings and
adds additional capabilities (like the ability to activate JMX support).</p>

<p>The following sections describe how the <b>quickfix</b> component processes
the QuickFIX/J configuration. For comprehensive information about QuickFIX/J configuration,
see the <a href="http://www.quickfixj.org/quickfixj/usermanual/usage/configuration.html"
class="external-link" rel="nofollow">QFJ user manual</a>.</p>

<h4><a name="Quickfix-CommunicationConnectors"></a>Communication Connectors</h4>

<p>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.</p>

<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Session Setting </th>
<th class='confluenceTh'> Component Action </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>ConnectionType=initiator</tt> </td>
<td class='confluenceTd'> Create an initiator connector </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ConnectionType=acceptor</tt> </td>
<td class='confluenceTd'> Create an acceptor connector </td>
</tr>
</tbody></table>
</div>
</div>

<p>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.</p>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Default/Global Setting </th>
<th class='confluenceTh'> Component Action </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>ThreadModel=ThreadPerConnector</tt> </td>
<td class='confluenceTd'> Use <tt>SocketInitiator</tt> or <tt>SocketAcceptor</tt>
(default) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ThreadModel=ThreadPerSession</tt> </td>
<td class='confluenceTd'> Use <tt>ThreadedSocketInitiator</tt> or <tt>ThreadedSocketAcceptor</tt>
</td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="Quickfix-Logging"></a>Logging</h4>

<p>The QuickFIX/J logger implementation can be specified by including the following
settings in the default section of the configuration file. The <tt>ScreenLog</tt>
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. The log factory implementation
can also be set directly on the Quickfix component. This will override any related values
in the QuickFIX/J settings file.</p>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Default/Global Setting </th>
<th class='confluenceTh'> Component Action </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>ScreenLogShowEvents</tt> </td>
<td class='confluenceTd'> Use a <tt>ScreenLog</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ScreenLogShowIncoming</tt> </td>
<td class='confluenceTd'> Use a <tt>ScreenLog</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ScreenLogShowOutgoing</tt> </td>
<td class='confluenceTd'> Use a <tt>ScreenLog</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>SLF4J*</tt> </td>
<td class='confluenceTd'> <b>Camel 2.6+</b>. Use a <tt>SLF4JLog</tt>.
Any of the SLF4J settings will cause this log to be used. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>FileLogPath</tt> </td>
<td class='confluenceTd'> Use a <tt>FileLog</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>JdbcDriver</tt> </td>
<td class='confluenceTd'> Use a <tt>JdbcLog</tt> </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="Quickfix-MessageStore"></a>Message Store</h4>

<p>The QuickFIX/J message store implementation can be specified by including the following
settings in the default section of the configuration file. The <tt>MemoryStore</tt>
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 message store implementation. The message
store factory implementation can also be set directly on the Quickfix component. This will
override any related values in the QuickFIX/J settings file.</p>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Default/Global Setting </th>
<th class='confluenceTh'> Component Action </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>JdbcDriver</tt> </td>
<td class='confluenceTd'> Use a <tt>JdbcStore</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>FileStorePath</tt> </td>
<td class='confluenceTd'> Use a <tt>FileStore</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>SleepycatDatabaseDir</tt> </td>
<td class='confluenceTd'> Use a <tt>SleepcatStore</tt> </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="Quickfix-MessageFactory"></a>Message Factory</h4>

<p>A message factory is used to construct domain objects from raw FIX messages. The
default message factory is <tt>DefaultMessageFactory</tt>. However, advanced applications
may require a custom message factory. This can be set on the QuickFIX/J component.</p>

<h4><a name="Quickfix-JMX"></a>JMX</h4>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Default/Global Setting </th>
<th class='confluenceTh'> Component Action </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>UseJmx</tt> </td>
<td class='confluenceTd'> if <tt>Y</tt>, then enable QuickFIX/J JMX </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="Quickfix-OtherDefaults"></a>Other Defaults</h4>

<p>The component provides some default settings for what are normally required settings
in QuickFIX/J configuration files. <tt>SessionStartTime</tt> and <tt>SessionEndTime</tt>
default to "00:00:00", meaning the session will not be automatically started and stopped.
The <tt>HeartBtInt</tt> (heartbeat interval) defaults to 30 seconds.</p>

<h4><a name="Quickfix-MinimalInitiatorConfigurationExample"></a>Minimal
Initiator Configuration Example</h4>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
[SESSION]
ConnectionType=initiator
BeginString=FIX.4.4
SenderCompID=YOUR_SENDER
TargetCompID=YOUR_TARGET
</pre>
</div></div>

<h3><a name="Quickfix-SpringConfiguration"></a>Spring Configuration</h3>

<p><b>Camel 2.6+</b></p>

<p>The QuickFIX/J component includes a Spring <tt>FactoryBean</tt> 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. </p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag"><span class="code-comment">&lt;!--
camel route --&gt;</span></span>
<span class="code-tag">&lt;camelContext id=<span class="code-quote">"quickfixjContext"</span>
xmlns=<span class="code-quote">"http://camel.apache.org/schema/spring"</span>&gt;</span>
    <span class="code-tag">&lt;route&gt;</span>
        <span class="code-tag">&lt;from uri=<span class="code-quote">"quickfix:example"</span>/&gt;</span>
        <span class="code-tag">&lt;filter&gt;</span>
            <span class="code-tag">&lt;simple&gt;</span>${in.header.EventCategory}
== 'AppMessageReceived'<span class="code-tag">&lt;/simple&gt;</span>
            <span class="code-tag">&lt;to uri=<span class="code-quote">"log:test"</span>/&gt;</span>
        <span class="code-tag">&lt;/filter&gt;</span>
    <span class="code-tag">&lt;/route&gt;</span>
<span class="code-tag">&lt;/camelContext&gt;</span>

<span class="code-tag"><span class="code-comment">&lt;!-- quickfix component
--&gt;</span></span>
<span class="code-tag">&lt;bean id=<span class="code-quote">"quickfix"</span>
class=<span class="code-quote">"org.apache.camel.component.quickfixj.QuickfixjComponent"</span>&gt;</span>
    <span class="code-tag">&lt;property name=<span class="code-quote">"engineSettings"</span>&gt;</span>
        <span class="code-tag">&lt;util:map&gt;</span>
            <span class="code-tag">&lt;entry key=<span class="code-quote">"quickfix:example"</span>
value-ref=<span class="code-quote">"quickfixjSettings"</span>/&gt;</span>
        <span class="code-tag">&lt;/util:map&gt;</span>
    <span class="code-tag">&lt;/property&gt;</span>
    <span class="code-tag">&lt;property name=<span class="code-quote">"messageFactory"</span>&gt;</span>
        <span class="code-tag">&lt;bean class=<span class="code-quote">"org.apache.camel.component.quickfixj.QuickfixjSpringTest.CustomMessageFactory"</span>/&gt;</span>
    <span class="code-tag">&lt;/property&gt;</span>
<span class="code-tag">&lt;/bean&gt;</span>

<span class="code-tag"><span class="code-comment">&lt;!-- quickfix settings
--&gt;</span></span>
&lt;bean id=<span class="code-quote">"quickfixjSettings"</span>
      class=<span class="code-quote">"org.apache.camel.component.quickfixj.QuickfixjSettingsFactory"</span>&gt;
    <span class="code-tag">&lt;property name=<span class="code-quote">"defaultSettings"</span>&gt;</span>
        <span class="code-tag">&lt;util:map&gt;</span>
            <span class="code-tag">&lt;entry key=<span class="code-quote">"SocketConnectProtocol"</span>
value=<span class="code-quote">"VM_PIPE"</span>/&gt;</span>
            <span class="code-tag">&lt;entry key=<span class="code-quote">"SocketAcceptProtocol"</span>
value=<span class="code-quote">"VM_PIPE"</span>/&gt;</span>
            <span class="code-tag">&lt;entry key=<span class="code-quote">"UseDataDictionary"</span>
value=<span class="code-quote">"N"</span>/&gt;</span>
        <span class="code-tag">&lt;/util:map&gt;</span>
    <span class="code-tag">&lt;/property&gt;</span>
    <span class="code-tag">&lt;property name=<span class="code-quote">"sessionSettings"</span>&gt;</span>
        <span class="code-tag">&lt;util:map&gt;</span>
            <span class="code-tag">&lt;entry key=<span class="code-quote">"FIX.4.2:INITIATOR-&gt;</span>ACCEPTOR"</span>&gt;
                <span class="code-tag">&lt;util:map&gt;</span>
                    <span class="code-tag">&lt;entry key=<span class="code-quote">"ConnectionType"</span>
value=<span class="code-quote">"initiator"</span>/&gt;</span>
                    <span class="code-tag">&lt;entry key=<span class="code-quote">"SocketConnectHost"</span>
value=<span class="code-quote">"localhost"</span>/&gt;</span>
                    <span class="code-tag">&lt;entry key=<span class="code-quote">"SocketConnectPort"</span>
value=<span class="code-quote">"5000"</span>/&gt;</span>
                <span class="code-tag">&lt;/util:map&gt;</span>
            <span class="code-tag">&lt;/entry&gt;</span>
            <span class="code-tag">&lt;entry key=<span class="code-quote">"FIX.4.2:ACCEPTOR-&gt;</span>INITIATOR"</span>&gt;
                <span class="code-tag">&lt;util:map&gt;</span>
                    <span class="code-tag">&lt;entry key=<span class="code-quote">"ConnectionType"</span>
value=<span class="code-quote">"acceptor"</span>/&gt;</span>
                    <span class="code-tag">&lt;entry key=<span class="code-quote">"SocketAcceptPort"</span>
value=<span class="code-quote">"5000"</span>/&gt;</span>
                <span class="code-tag">&lt;/util:map&gt;</span>
            <span class="code-tag">&lt;/entry&gt;</span>
        <span class="code-tag">&lt;/util:map&gt;</span>
    <span class="code-tag">&lt;/property&gt;</span>
<span class="code-tag">&lt;/bean&gt;</span>
</pre>
</div></div>

<h3><a name="Quickfix-Exceptionhandling"></a>Exception handling</h3>

<p>QuickFIX/J behavior can be modified if certain exceptions are thrown during processing
of a message. If a <tt>RejectLogon</tt> exception is thrown while processing an
incoming logon administrative message, then the logon will be rejected.</p>

<p>Normally, QuickFIX/J handles the logon process automatically. However, sometimes
an outgoing logon message must be modified to include credentials required by a FIX counterparty.
If the FIX logon message body is modified when sending a logon message (EventCategory=<tt>AdminMessageSent</tt>
the modified message will be sent to the counterparty. It is important that the outgoing logon
message is being processed <em>synchronously</em>. If it is processed asynchronously
(on another thread), the FIX engine will immediately send the unmodified outgoing message
when it's callback method returns.</p>

<h3><a name="Quickfix-FIXSequenceNumberManagement"></a>FIX Sequence Number
Management</h3>

<p>If an application exception is thrown during <em>synchronous</em> exchange
processing, this will cause QuickFIX/J to not increment incoming FIX message sequence numbers
and will cause a resend of the counterparty message. This FIX protocol behavior is primarily
intended to handle <em>transport</em> errors rather than application errors. There
are risks associated with using this mechanism to handle application errors. The primary risk
is that the message will repeatedly cause application errors each time it's re-received. A
better solution is to persist the incoming message (database, JMS queue) immediately before
processing it. This also allows the application to process messages asynchronously without
losing messages when errors occur.</p>

<p>Although it's possible to send messages to a FIX session before it's logged on (the
messages will be sent at logon time), it is usually a better practice to wait until the session
is logged on. This eliminates the required sequence number resynchronization steps at logon.
Waiting for session logon can be done by setting up a route that processes the <tt>SessionLogon</tt>
event category and signals the application to start sending messages.</p>

<p>See the FIX protocol specifications and the QuickFIX/J documentation for more details
about FIX sequence number management.</p>

<h3><a name="Quickfix-RouteExamples"></a>Route Examples</h3>

<p>Several examples are included in the QuickFIX/J component source code (test subdirectories).
One of these examples implements a trival trade excecution simulation. The example defines
an application component that uses the URI scheme "trade-executor".</p>

<p>The following route receives messages for the trade executor session and passes application
messages to the trade executor component.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET-&gt;TRADER"</span>).
    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived)).
    to(<span class="code-quote">"trade-executor:market"</span>);
</pre>
</div></div>

<p>The trade executor component generates messages that are routed back to the trade
session. The session ID must be set in the FIX message itself since no session ID is specified
in the endpoint URI.</p>


<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"trade-executor:market"</span>).to(<span class="code-quote">"quickfix:examples/inprocess.cfg"</span>);
</pre>
</div></div>

<p>The trader session consumes execution report messages from the market and processes
them.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:TRADER-&gt;MARKET"</span>).
    filter(header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.EXECUTION_REPORT)).
    bean(<span class="code-keyword">new</span> MyTradeExecutionProcessor());
</pre>
</div></div>

<h2><a name="Quickfix-QuickFIX%2FJComponentPriortoCamel2.5"></a>QuickFIX/J
Component Prior to Camel 2.5</h2>

<p><b>Available since Camel 2.0</b></p>

<p>The <b>quickfix</b> component is an implementation of the <a href="http://www.quickfixj.org/"
class="external-link" rel="nofollow">QuickFIX/J</a> engine for Java . This engine
allows to connect to a FIX server which is used to exchange financial messages according to
<a href="http://www.fixprotocol.org/" class="external-link" rel="nofollow">FIX protocol</a>
standard.</p>

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

<h3><a name="Quickfix-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
quickfix-server:config file
quickfix-client:config file
</pre>
</div></div>

<p>Where <b>config file</b> is the location (in your classpath) of the quickfix
configuration file used to configure the engine at the startup.</p>

<p><b>Note:</b> Information about parameters available for quickfix can
be found on <a href="http://www.quickfixj.org/quickfixj/usermanual/usage/configuration.html"
class="external-link" rel="nofollow">QuickFIX/J</a> web site.</p>

<p>The quickfix-server endpoint must be used to receive from FIX server FIX messages
and quickfix-client endpoint in the case that you want to send messages to a FIX gateway.</p>

<h3><a name="Quickfix-Exchangedataformat"></a>Exchange data format</h3>

<p>The QuickFIX/J engine is like CXF component a messaging bus using MINA as protocol
layer to create the socket connection with the FIX engine gateway.</p>

<p>When QuickFIX/J engine receives a message, then it create a QuickFix.Message instance
which is next received by the camel endpoint. This object is a 'mapping object' created from
a FIX message formatted initially as a collection of key value pairs data. You can use this
object or you can use the method 'toString' to retrieve the original FIX message.</p>

<p><b>Note:</b> Alternatively, you can use <a href="/confluence/display/CAMEL/Bindy"
title="Bindy">camel bindy dataformat</a> to transform the FIX message into your own
java POJO</p>

<p>When a message must be send to QuickFix, then you must create a QuickFix.Message
instance.</p>

<h3><a name="Quickfix-Samples"></a>Samples</h3>

<p>Direction : to FIX gateway</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;route&gt;</span>
  <span class="code-tag">&lt;from uri=<span class="code-quote">"activemq:queue:fix"</span>/&gt;</span>
  <span class="code-tag">&lt;bean ref=<span class="code-quote">"fixService"</span>
method=<span class="code-quote">"createFixMessage"</span>/&gt;</span>
// bean method in charge to transform message into a QuickFix.Message
  <span class="code-tag">&lt;to uri=<span class="code-quote">"quickfix-client:META-INF/quickfix/client.cfg"</span>/&gt;</span>
// Quickfix engine who will send the FIX messages to the gateway
<span class="code-tag">&lt;/route&gt;</span>
</pre>
</div></div>

<p>Direction : from FIX gateway</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;route&gt;</span>
  <span class="code-tag">&lt;from uri=<span class="code-quote">"quickfix-server:META-INF/quickfix/server.cfg"</span>/&gt;</span>
// QuickFix engine who will receive the message from FIX gateway
  <span class="code-tag">&lt;bean ref=<span class="code-quote">"fixService"</span>
method=<span class="code-quote">"parseFixMessage"</span>/&gt;</span>
// bean method parsing the QuickFix.Message
  <span class="code-tag">&lt;to uri=<span class="code-quote">"uri="</span>activemq:queue:fix<span
class="code-quote">"/&gt;</span>"</span>
<span class="code-tag">&lt;/route&gt;</span>
</pre>
</div></div>

<h3><a name="Quickfix-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Quickfix">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=5966095&revisedVersion=13&originalVersion=12">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Quickfix?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message