You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Marc Hodgins <mj...@hodginsmedia.com> on 2009/05/25 20:58:07 UTC
FIX transport repeating groups?
I am attempting to use Synapse to act as an HTTP to FIX proxy much like
sample 258. I am using the latest Synapse snapshot. Updated all
libraries with maven and built successfully.
The issue I'm having is that it does not seem to be handling FIX
repeating groups properly (or, I'm missing something important to make
that happen). I am submitting the following (POX) to the service as
content-type application/xml :
<message>
<header>
<field id="35">V</field>
</header>
<body>
<field id="262">12345</field>
<field id="263">0</field>
<field id="264">1</field>
<field id="265">0</field>
<field id="267">1</field>
<field id="269">0</field>
<field id="146">1</field>
<field id="55">USD/CAD</field>
</body>
<trailer />
</message>
According to the console, Synapse is wrapping it into a SOAP envelope as
expected:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<message>
<header>
<field id="35">V</field>
</header>
<body>
<field id="262">12345</field>
<field id="263">0</field>
<field id="264">1</field>
<field id="265">0</field>
<field id="267">1</field>
<field id="269">0</field>
<field id="146">1</field>
<field id="55">USD/CAD</field>
</body>
<trailer />
</message>
</soapenv:Body>
</soapenv:Envelope>
The FIX session is set to use FIX.4.2 (actually, a customized data
dictionary based on FIX 4.2 ... but I see this same problem whether I
use the stock FIX42.xml data dictionary or my own custom dictionay).
So far so good. Synapse opens the FIX connection to the FIX acceptor,
logs in and transmits the message. However, the problem lies here. The
message fields have been reordered. Field 146 is a repeating group and
field 55 is a field within that group. The FIX protocol spec states that
these fields must be transmitted in order -- i.e. field 146 followed by
field 55. But this is not what is occurring. Here is the outgoing message:
<20090525-04:41:12, FIX.4.2:ESB->FIXSERVER, outgoing>
(8=FIX.4.2^9=143^35=V^34=2^49=ESB^52=20090525-04:41:12.167^56=FIXSERVER^*55=USD/CAD^146=1*^262=12345^263=0^264=1^265=0^267=1^269=0^10=045^)
**** Note how the 55 and 146 fields are in the wrong order in the
outgoing message. 146 must come immediately before 55 according to the
FIX spec. ****
The response received is:
<20090525-04:41:12, FIX.4.2:ESB->FIXSERVER, incoming>
(8=FIX.4.2^9=127^35=3^34=2^49=FIXSERVER^52=20090525-04:41:13.389^56=ESB^45=2^58=Tag
not defined for this message type^371=55^372=V^373=2^10=240^)
The FIX acceptor is rejecting the message, correctly, because the fields
are out of order and therefore tag 55 is not defined for that message
type (unless within a repeating goup).
Am I missing something, or is this a bug? How does the Synapse FIX
transport know about repeating groups, to know to pass these in the
right order? Thanks.
Marc
Re: FIX transport repeating groups?
Posted by Marc Hodgins <mj...@hodginsmedia.com>.
Thank you Asanka and Hiranya for the assistance - this works perfectly
On 5/26/2009 2:35 AM, Asanka Abeysinghe wrote:
> Hi Marc,
> As Hiranya mentioned in the previous post you have to use <groups
> id={id}> with <group> element to represent FIX repeating groups in FIX
> message comes on XML format. Following message will explain you the
> format in detail. I'm using a FIX-4.4 session with Parties (tag 453)
> as the repeating group.
> - Asanka
>
> <message inSession="FIX.4.4:SYNAPSE->BANZAI" counter="1">
> <header>
> <field id="8"><![CDATA[FIX.4.4]]></field>
> <field id="9"><![CDATA[179]]></field>
> <field id="34"><![CDATA[11]]></field>
> <field id="35"><![CDATA[D]]></field>
> <field id="49"><![CDATA[BANZAI]]></field>
> <field id="52"><![CDATA[20090526-06:50:26.661]]></field>
> <field id="56"><![CDATA[SYNAPSE]]></field>
> </header>
> <body>
> <field id="11"><![CDATA[1243320626599]]></field>
> <field id="21"><![CDATA[1]]></field>
> <field id="38"><![CDATA[10000]]></field>
> <field id="40"><![CDATA[1]]></field>
> <field id="54"><![CDATA[1]]></field>
> <field id="55"><![CDATA[GOOG]]></field>
> <field id="59"><![CDATA[0]]></field>
> <field id="60"><![CDATA[20090526-06:50:26.657]]></field>
> <field id="453"><![CDATA[1]]></field>
> <groups id="453">
> <group>
> <field id="448"><![CDATA[1]]></field>
> <field id="447"><![CDATA[D]]></field>
> <field id="452"><![CDATA[7]]></field>
> <field id="802"><![CDATA[1]]></field>
> <groups id="802">
> <group>
> <field id="523"><![CDATA[1]]></field>
> <field id="803"><![CDATA[25]]></field>
> </group>
> </groups>
> </group>
> </groups>
> </body>
> <trailer>
> <field id="10"><![CDATA[186]]></field>
> </trailer>
> </message>
Re: FIX transport repeating groups?
Posted by Asanka Abeysinghe <as...@wso2.com>.
Hi Marc,
As Hiranya mentioned in the previous post you have to use <groups
id={id}> with <group> element to represent FIX repeating groups in FIX
message comes on XML format. Following message will explain you the
format in detail. I'm using a FIX-4.4 session with Parties (tag 453) as
the repeating group.
- Asanka
<message inSession="FIX.4.4:SYNAPSE->BANZAI" counter="1">
<header>
<field id="8"><![CDATA[FIX.4.4]]></field>
<field id="9"><![CDATA[179]]></field>
<field id="34"><![CDATA[11]]></field>
<field id="35"><![CDATA[D]]></field>
<field id="49"><![CDATA[BANZAI]]></field>
<field id="52"><![CDATA[20090526-06:50:26.661]]></field>
<field id="56"><![CDATA[SYNAPSE]]></field>
</header>
<body>
<field id="11"><![CDATA[1243320626599]]></field>
<field id="21"><![CDATA[1]]></field>
<field id="38"><![CDATA[10000]]></field>
<field id="40"><![CDATA[1]]></field>
<field id="54"><![CDATA[1]]></field>
<field id="55"><![CDATA[GOOG]]></field>
<field id="59"><![CDATA[0]]></field>
<field id="60"><![CDATA[20090526-06:50:26.657]]></field>
<field id="453"><![CDATA[1]]></field>
<groups id="453">
<group>
<field id="448"><![CDATA[1]]></field>
<field id="447"><![CDATA[D]]></field>
<field id="452"><![CDATA[7]]></field>
<field id="802"><![CDATA[1]]></field>
<groups id="802">
<group>
<field id="523"><![CDATA[1]]></field>
<field id="803"><![CDATA[25]]></field>
</group>
</groups>
</group>
</groups>
</body>
<trailer>
<field id="10"><![CDATA[186]]></field>
</trailer>
</message>
Re: FIX transport repeating groups?
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi Marc,
We didn't support FIX repeating groups sometime back but now that issue is
fixed (See [1] for details). If you want to use FIX repeating groups you
will have to put some additional XML elements in your input message. Using
only <field> elements in your message will cause them to be treated as
ordinary FIX message fields. IIRC you need to use <groups> and <group>
elements to distinguish between ordinary FIX message fields and FIX
repeating groups.
Asanka was the one who implemented FIX repeating groups support and he will
soon post the necessary information to use FIX repeating groups in Synapse.
Thanks,
Hiranya
[1] - http://issues.apache.org/jira/browse/SYNAPSE-420
On Tue, May 26, 2009 at 12:28 AM, Marc Hodgins <mj...@hodginsmedia.com> wrote:
> I am attempting to use Synapse to act as an HTTP to FIX proxy much like
> sample 258. I am using the latest Synapse snapshot. Updated all libraries
> with maven and built successfully.
>
> The issue I'm having is that it does not seem to be handling FIX repeating
> groups properly (or, I'm missing something important to make that happen). I
> am submitting the following (POX) to the service as content-type
> application/xml :
>
> <message>
> <header>
> <field id="35">V</field>
> </header>
> <body>
> <field id="262">12345</field>
> <field id="263">0</field>
> <field id="264">1</field>
> <field id="265">0</field>
> <field id="267">1</field>
> <field id="269">0</field>
> <field id="146">1</field>
> <field id="55">USD/CAD</field>
> </body>
> <trailer />
> </message>
>
> According to the console, Synapse is wrapping it into a SOAP envelope as
> expected:
>
> <?xml version='1.0' encoding='utf-8'?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> ">
> <soapenv:Body>
> <message>
> <header>
> <field id="35">V</field>
> </header>
> <body>
> <field id="262">12345</field>
> <field id="263">0</field>
> <field id="264">1</field>
> <field id="265">0</field>
> <field id="267">1</field>
> <field id="269">0</field>
> <field id="146">1</field>
> <field id="55">USD/CAD</field>
> </body>
> <trailer />
> </message>
> </soapenv:Body>
> </soapenv:Envelope>
>
> The FIX session is set to use FIX.4.2 (actually, a customized data
> dictionary based on FIX 4.2 ... but I see this same problem whether I use
> the stock FIX42.xml data dictionary or my own custom dictionay).
>
> So far so good. Synapse opens the FIX connection to the FIX acceptor, logs
> in and transmits the message. However, the problem lies here. The message
> fields have been reordered. Field 146 is a repeating group and field 55 is a
> field within that group. The FIX protocol spec states that these fields must
> be transmitted in order -- i.e. field 146 followed by field 55. But this is
> not what is occurring. Here is the outgoing message:
>
> <20090525-04:41:12, FIX.4.2:ESB->FIXSERVER, outgoing>
> (8=FIX.4.2^9=143^35=V^34=2^49=ESB^52=20090525-04:41:12.167^56=FIXSERVER^*55=USD/CAD^146=1*^262=12345^263=0^264=1^265=0^267=1^269=0^10=045^)
>
> **** Note how the 55 and 146 fields are in the wrong order in the outgoing
> message. 146 must come immediately before 55 according to the FIX spec.
> ****
>
> The response received is:
>
> <20090525-04:41:12, FIX.4.2:ESB->FIXSERVER, incoming>
> (8=FIX.4.2^9=127^35=3^34=2^49=FIXSERVER^52=20090525-04:41:13.389^56=ESB^45=2^58=Tag
> not defined for this message type^371=55^372=V^373=2^10=240^)
>
> The FIX acceptor is rejecting the message, correctly, because the fields
> are out of order and therefore tag 55 is not defined for that message type
> (unless within a repeating goup).
>
> Am I missing something, or is this a bug? How does the Synapse FIX
> transport know about repeating groups, to know to pass these in the right
> order? Thanks.
>
> Marc
>
--
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com