Author: hiranya
Date: Sat Aug 9 05:43:58 2008
New Revision: 684243
URL: http://svn.apache.org/viewvc?rev=684243&view=rev
Log:
Added sample 262 (CBR of FIX messages) to the set of samples. Added the file
synapse_sample_262.xml and updated the Synapse samples guide accordingly.
This commit is related to SYNAPSE-414 and the patch was provided by Asanka A.
Added:
synapse/trunk/java/repository/conf/sample/synapse_sample_262.xml
Modified:
synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
Added: synapse/trunk/java/repository/conf/sample/synapse_sample_262.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_262.xml?rev=684243&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_262.xml (added)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_262.xml Sat Aug 9
05:43:58 2008
@@ -0,0 +1,64 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<!-- CBR of FIX messages, using symbol (tag 55) -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <sequence name="CBR_SEQ">
+ <in>
+ <switch source="//message/body/[EMAIL PROTECTED]'55']">
+ <case regex="GOOG">
+ <send>
+ <endpoint>
+ <address
+
uri="fix://localhost:19876?BeginString=FIX.4.0&SenderCompID=SYNAPSE&TargetCompID=EXEC"
/>
+ </endpoint>
+ </send>
+ </case>
+ <case regex="MSFT">
+ <send>
+ <endpoint>
+ <address
+
uri="fix://localhost:19877?BeginString=FIX.4.1&SenderCompID=SYNAPSE&TargetCompID=EXEC"
/>
+ </endpoint>
+ </send>
+ </case>
+ <default></default>
+ </switch>
+ </in>
+ <out>
+ <send />
+ </out>
+ </sequence>
+ <proxy name="FIXProxy" transports="fix">
+ <target inSequence="CBR_SEQ" />
+ <parameter name="transport.fix.AcceptorConfigURL">
+ file:repository/conf/sample/resources/fix/fix-synapse.cfg
+ </parameter>
+ <parameter name="transport.fix.AcceptorMessageStore">
+ file
+ </parameter>
+ <parameter name="transport.fix.InitiatorConfigURL">
+ file:repository/conf/sample/resources/fix/synapse-sender.cfg
+ </parameter>
+ <parameter name="transport.fix.InitiatorMessageStore">
+ file
+ </parameter>
+ </proxy>
+</definitions>
+
Modified: synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml?rev=684243&r1=684242&r2=684243&view=diff
==============================================================================
--- synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml Sat Aug 9 05:43:58
2008
@@ -326,6 +326,14 @@
<a href="#Sample260">Sample 260: Switching from FIX to AMQP
</a>
</li>
+ <li>
+ <a href="#Sample261">Sample 261: Switch between FIX versions
+ </a>
+ </li>
+ <li>
+ <a href="#Sample262">Sample 262: CBR of FIX messages
+ </a>
+ </li>
</ul>
</li>
<li>
@@ -4110,7 +4118,110 @@
see <a href="Synapse_Samples_Setup.html#fixparameters">FIX
Transport Parameters
</a>.
</p>
- <h1>
+ <h2>
+ <a name="Sample262" id="Sample262">Sample 262: Switch between FIX
versions </a>
+ </h2>
+ <pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <sequence name="CBR_SEQ">
+ <in>
+ <switch source="//message/body/[EMAIL
PROTECTED]'55']">
+ <case regex="GOOG">
+ <send>
+ <endpoint>
+ <address
+
uri="fix://localhost:19876?BeginString=FIX.4.0&amp;SenderCompID=SYNAPSE&amp;TargetCompID=EXEC"
/>
+ </endpoint>
+ </send>
+ </case>
+ <case regex="MSFT">
+ <send>
+ <endpoint>
+ <address
+
uri="fix://localhost:19877?BeginString=FIX.4.1&amp;SenderCompID=SYNAPSE&amp;TargetCompID=EXEC"
/>
+ </endpoint>
+ </send>
+ </case>
+ <default></default>
+ </switch>
+ </in>
+ <out>
+ <send />
+ </out>
+ </sequence>
+ <proxy name="FIXProxy" transports="fix">
+ <target inSequence="CBR_SEQ" />
+ <parameter
name="transport.fix.AcceptorConfigURL">
+
file:repository/conf/sample/resources/fix/fix-synapse.cfg
+ </parameter>
+ <parameter
name="transport.fix.AcceptorMessageStore">
+ file
+ </parameter>
+ <parameter
name="transport.fix.InitiatorConfigURL">
+
file:repository/conf/sample/resources/fix/synapse-sender.cfg
+ </parameter>
+ <parameter
name="transport.fix.InitiatorMessageStore">
+ file
+ </parameter>
+ </proxy>
+ </definitions></pre>
+ <p>
+ <strong>Objective: Demonstrate the capability of CBR FIX
messages</strong>
+ </p>
+ <p>
+ <strong>Prerequisites:</strong><br/>
+ You will need the two sample FIX applications that come with
Quickfix/J
+ (Banzai and Executor). Configure the two applications to establish
+ sessions with Synapse. See <a
href="Synapse_Samples_Setup.html#fixsamplesconfig">
+ Configuring Sample FIX Applications</a>
+ </p>
+ <p>
+ Add the following lines to banzai.cfg.
+ </p>
+ <pre
xml:space="preserve">DataDictionary=~/etc/spec/FIX40-synapse.xml</pre>
+ <p>
+ Note: FIX40-synapse.xml can be found at
$SYNAPSE_HOME/repository/conf/samples/resources/fix.
+ This is a custom FIX data dictionary file that has added tag
150,151 to the
+ execution messages (35=8) of FIX4.0. Make sure the DataDictionary
property of the banzai.cfg points
+ to this data dictionary file.
+ </p>
+ <p>
+ Add the following lines to executor.cfg
+ </p>
+ <pre xml:space="preserve">[session]
+ BeginString=FIX.4.1
+ SocketAcceptPort=19877</pre>
+ <p>
+ Start Banzai and Executor using the custom config files.
+ </p>
+ <p>
+ Enable FIX transport in the Synapse axis2.xml. See <a
+ href="Synapse_Samples_Setup.html#fixtransport">Setting up FIX
transport
+ </a>
+ </p>
+ <p>
+ Configure Synapse for FIX samples. See <a
href="Synapse_Samples_Setup.html#fixsamples">
+ Configuring Synapse for FIX Samples</a>
+ </p>
+ <p>
+ Open up the
SYNAPSE_HOME/repository/conf/sample/synapse_sample_262.xml file
+ and make sure that transport.fix.AcceptorConfigURL property points
to the
+ fix-synapse.cfg file you created and
transport.fix.InitiatorConfigURL points
+ to the synapse-sender.cfg file you created. Once done you can start
the Synapse
+ configuration numbered 262: i.e. synapse -sample 262. Note that
Synapse creates
+ a new FIX session with Banzai at this point.
+ </p>
+ <p>
+ Send an order request from Banzai to Synapse. e.g. Buy GOOG 1000 @
MKT, Buy MSFT 3000 @ MKT, Buy SUNW 500 @ 100.20
+ </p>
+ <p>Synapse will forward the order requests with symbol 'GOOG' to FIX
endpoint FIX-4.0 @ localhost:19876.</p>
+ <p>Synapse will forward the order requests with symbol 'MSFT' to FIX
endpoint FIX-4.1 @ localhost:19877.</p>
+ <p>Synapse will not forward the orders with other symbols to any
endpoint. (default case has kept blank in the configuration)</p>
+ <p>
+ To get an idea about the various transport parameters being used in
this sample
+ see <a href="Synapse_Samples_Setup.html#fixparameters">FIX Transport
Parameters
+ </a>.
+ </p>
+ <h1>
<a name="Task" id="Task">Introduction to Synapse Tasks</a>
</h1>
<h2>