<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
  ~  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.
  -->

<document>
    <properties>
        <title>Apache Synapse - Sample 261</title>
    </properties>
    <body>
        <section name="Sample 261: Switch Between Different FIX Versions">
            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;

    &lt;proxy name="OrderProcesserProxy41" transports="fix"&gt;
        &lt;target&gt;
            &lt;endpoint&gt;
                &lt;address
                        uri="fix://localhost:19877?BeginString=FIX.4.1&amp;SenderCompID=SYNAPSE&amp;TargetCompID=EXEC"/&gt;
            &lt;/endpoint&gt;
            &lt;inSequence&gt;
                &lt;log level="full"/&gt;
            &lt;/inSequence&gt;
            &lt;outSequence&gt;
                &lt;log level="full"/&gt;
                &lt;send/&gt;
            &lt;/outSequence&gt;
        &lt;/target&gt;
        &lt;parameter name="transport.fix.AcceptorConfigURL"&gt;
            file:repository/conf/sample/resources/fix/fix-synapse-m40.cfg
        &lt;/parameter&gt;
        &lt;parameter name="transport.fix.AcceptorMessageStore"&gt;file&lt;/parameter&gt;
        &lt;parameter name="transport.fix.InitiatorConfigURL"&gt;
            file:repository/conf/sample/resources/fix/synapse-sender-m.cfg
        &lt;/parameter&gt;
        &lt;parameter name="transport.fix.InitiatorMessageStore"&gt;file&lt;/parameter&gt;
    &lt;/proxy&gt;

&lt;/definitions&gt;</div>
            <subsection name="Objective">
                <p>
                    Demonstrate the ability of Synapse to switch between FIX versions (eg: FIX 4.0
                    to FIX 4.1)
                </p>
            </subsection>
            <subsection name="Pre-requisites">
                <p>
                    <ul>
                        <li>
                            You need a <a href="http://www.quickfixj.org">Quickfix/J</a> installation
                            to try out FIX samples. Please download and extract a Quickfix/J distribution
                            into your local machine.
                        </li>
                        <li>
                            Enable the FIX transport listener and sender for Synapse (refer
                            <a href="setup/fix.html#synapse">FIX setup guide</a> for details).
                        </li>
                        <li>
                            Configure the Executor sample FIX application (shipped with Quickfix/J)
                            to receive messages from Synapse and start it (refer <a href="setup/fix.html#exec">FIX setup guide</a>
                            for more details). In previous samples we only had a FIX 4.0 session configured
                            for Executor. For this sample we should configure a FIX 4.1 session for
                            Executor. Therefore before starting it add the following entries to the
                            configuration file of Executor (executor.cfg).
                            <div class="consoleOutput">[session]
BeginString=FIX.4.1
SocketAcceptPort=19877</div>
                        </li>
                        <li>
                            Start Synapse using the configuration numbered 261 (repository/conf/sample/synapse_sample_261.xml)
                            <div class="command">
                                Unix/Linux: sh synapse.sh -sample 261<br/>
                                Windows: synapse.bat -sample 261
                            </div>
                            If Executor is properly configured, Synapse should establish a FIX 4.1 session
                            with the Executor upon startup. You should see some log entries confirming
                            the session logon event on Synapse console as well as Executor console.
                        </li>
                        <li>
                            Configure Banzai sample FIX application (shipped with Quickfix/J) to send
                            messages to Synapse and start it (refer <a href="setup/fix.html#banzai">FIX setup guide</a>
                            for more details). You should also add the following entry to the Banzai
                            configuration file before starting it (replace $SYNAPSE_HOME with the
                            actual path to Synapse home).
                            <div class="consoleOutput">DataDictionary=$SYNAPSE_HOME/repository/conf/sample/resources/fix/FIX40-synapse.xml</div>
                            If Banzai was properly configured, it should establish a FIX 4.0 session with
                            Synapse upon startup. You should see some session logon messages on Synapse
                            console and Banzai console.
                        </li>
                    </ul>
                </p>
            </subsection>
            <subsection name="Executing the Client">
                <p>
                    Send some FIX messages from Banzai to Synapse. Synapse will forward all requests
                    to Executor and get them processes. Responses from Executor will be routed back
                    to Banzai.
                </p>
                <p>
                    Note that the session between Banzai and Synapse is a FIX 4.0 session whereas
                    the session between Synapse and Execurot is a FIX 4.1 session. Synapse receives
                    FIX 4.0 messages and simply forwards them to the FIX 4.1 endpoint.
                </p>                
            </subsection>
        </section>
        <p><a href="../samples.html">Back to Catalog</a></p>        
    </body>
</document>