From alex at owal.co.uk Tue Dec 18 03:59:07 2007 From: alex at owal.co.uk (alex at owal.co.uk) Date: Tue, 18 Dec 2007 11:59:07 -0000 (UTC) Subject: [Banking-pm] Dead List Message-ID: <8922.193.134.170.35.1197979147.squirrel@www.sflink.net> I cant see how to kick start this list into a real community. I think that sometime soon I will ask the powers that be to kill this list and group. Any complaints? Alex From a.r.ferreira at gmail.com Tue Dec 18 04:22:31 2007 From: a.r.ferreira at gmail.com (Adriano Ferreira) Date: Tue, 18 Dec 2007 10:22:31 -0200 Subject: [Banking-pm] Dead List In-Reply-To: <8922.193.134.170.35.1197979147.squirrel@www.sflink.net> References: <8922.193.134.170.35.1197979147.squirrel@www.sflink.net> Message-ID: <73ddeb6c0712180422w19761c0cv35d8bc0bfa9f251a@mail.gmail.com> On Dec 18, 2007 9:59 AM, wrote: > I cant see how to kick start this list into a real community. I think that > sometime soon I will ask the powers that be to kill this list and group. To create a real community is quite hard. One with Perl developers working in banking environments where they barely breath may be even harder ;-) Any start will possibly do. Tell something, light at the start, so people can contribute without much thinking. And proceed from that. > Any complaints? > > Alex Regards, Adriano Ferreira From rodrick.brown at gmail.com Tue Dec 18 05:28:02 2007 From: rodrick.brown at gmail.com (Rodrick Brown) Date: Tue, 18 Dec 2007 08:28:02 -0500 Subject: [Banking-pm] Parsing FIX messages Message-ID: Does anyone know if a module is available for parsing FIX messages? I didnt see any on cpan just wondering if anyone here did one internally? -- Rodrick R. Brown http://www.rodrickbrown.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/banking-pm/attachments/20071218/4da03d0b/attachment.html From alex at owal.co.uk Wed Dec 19 01:14:54 2007 From: alex at owal.co.uk (alex at owal.co.uk) Date: Wed, 19 Dec 2007 09:14:54 -0000 (UTC) Subject: [Banking-pm] Parsing FIX messages In-Reply-To: References: Message-ID: <32759.193.134.170.35.1198055694.squirrel@www.sflink.net> > Does anyone know if a module is available for parsing FIX messages? I > didnt > see any on cpan just wondering if anyone here did one internally? Despite what the agencies seem to think I know nothing about the details of FIX. (Apparently my cv says I "fix" things - so they send me vacancies about FIX). Anyway: What I understand is that no one really implements the *whole* of FIX - they only implement the bits they need for the task they are doing. And since it is XML (right?) no one has seen a need to put it on CPAN. Shame really Alex From martin.bower at gmail.com Wed Dec 19 02:22:03 2007 From: martin.bower at gmail.com (Martin Bower) Date: Wed, 19 Dec 2007 10:22:03 +0000 Subject: [Banking-pm] Parsing FIX messages In-Reply-To: <32759.193.134.170.35.1198055694.squirrel@www.sflink.net> References: <32759.193.134.170.35.1198055694.squirrel@www.sflink.net> Message-ID: <7969e3b50712190222u3be58bdq91defa38baeddfd7@mail.gmail.com> On Dec 19, 2007 9:14 AM, wrote: > > Does anyone know if a module is available for parsing FIX messages? I > > didnt > > see any on cpan just wondering if anyone here did one internally? > > > Despite what the agencies seem to think I know nothing about the details > of FIX. > > (Apparently my cv says I "fix" things - so they send me vacancies about > FIX). > > Anyway: What I understand is that no one really implements the *whole* of > FIX - they only implement the bits they need for the task they are doing. > > And since it is XML (right?) no one has seen a need to put it on CPAN. > > Shame really > > Alex > > _______________________________________________ > Banking-pm mailing list > Banking-pm at pm.org > http://mail.pm.org/mailman/listinfo/banking-pm Hi, I've been trying to deal with this recently, as I've been doing a lot of work with Fix. I've written something which is usable but only just. I parse the original .xml files, then store this in a data structure for use later. The thing I haven't quite got my head around yet is the repeating groups, and how to implement those. My users want to be able to see Fix messages broken down by either Tag or value, and this doesn't really work when trying to sort repeating groups. If anyone has any docs which point out exactly how repeating groups works, I'd be happy to polish the package up and release it. (which engine are you using btw ?) Regards Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/banking-pm/attachments/20071219/f86841ca/attachment.html From rodrick.brown at gmail.com Wed Dec 19 05:03:04 2007 From: rodrick.brown at gmail.com (Rodrick Brown) Date: Wed, 19 Dec 2007 08:03:04 -0500 Subject: [Banking-pm] Parsing FIX messages In-Reply-To: <7969e3b50712190222u3be58bdq91defa38baeddfd7@mail.gmail.com> References: <32759.193.134.170.35.1198055694.squirrel@www.sflink.net> <7969e3b50712190222u3be58bdq91defa38baeddfd7@mail.gmail.com> Message-ID: On Dec 19, 2007 5:22 AM, Martin Bower wrote: > On Dec 19, 2007 9:14 AM, wrote: > > > > Does anyone know if a module is available for parsing FIX messages? > > I > > > didnt > > > see any on cpan just wondering if anyone here did one internally? > > > > > > Despite what the agencies seem to think I know nothing about the details > > > > of FIX. > > > > (Apparently my cv says I "fix" things - so they send me vacancies about > > FIX). > > > > Anyway: What I understand is that no one really implements the *whole* > > of > > FIX - they only implement the bits they need for the task they are > > doing. > > > > And since it is XML (right?) no one has seen a need to put it on CPAN. > > > > Shame really > > > > Alex > > > > _______________________________________________ > > Banking-pm mailing list > > Banking-pm at pm.org > > http://mail.pm.org/mailman/listinfo/banking-pm > > > Hi, > > I've been trying to deal with this recently, as I've been doing a lot of > work with Fix. > > I've written something which is usable but only just. I parse the > original .xml files, then store this in a data structure for use later. > > The thing I haven't quite got my head around yet is the repeating groups, > and how to implement those. My users want to be able to see Fix messages > broken down by either Tag or value, and this doesn't really work when trying > to sort repeating groups. > > If anyone has any docs which point out exactly how repeating groups works, > I'd be happy to polish the package up and release it. > This is exactly what has been driving me crazy repeating groups and also user defined tags, I have some code but its very ugly and only for the bits I need its actually just to parse FIX logs into Tibco format to publish to a down stream system via Tib. > > > (which engine are you using btw ?) > > Regards > > Martin > > > _______________________________________________ > Banking-pm mailing list > Banking-pm at pm.org > http://mail.pm.org/mailman/listinfo/banking-pm > > -- Rodrick R. Brown http://www.rodrickbrown.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/banking-pm/attachments/20071219/c6687462/attachment.html From BHolzman at ise.com Wed Dec 19 06:38:58 2007 From: BHolzman at ise.com (Holzman, Benjamin) Date: Wed, 19 Dec 2007 09:38:58 -0500 Subject: [Banking-pm] Parsing FIX messages In-Reply-To: References: Message-ID: <66B10B1DEBCE404CA35182C93F690E7A4DF011@CRPB-MB01-V.office.iseoptions.com> banking-pm-bounces+bholzman=iseoptions.com at pm.org wrote: > Does anyone know if a module is available for parsing FIX > messages? I didnt see any on cpan just wondering if anyone > here did one internally? Here's what I posted the last time this came up: > I would have assumed that FIX is so large that any generic > implementation of it is likely to be incomplete. Yes and no, I think. My experience with FIX has been that the application-level messages tend to be domain-specific, but the protocol-level is quite stable. I have built FIX interfaces to allow order entry and market data for our parimutuel matching engine. I did it using the quickfix open source FIX engine (actually C++ libraries) to handle the protocol and wrote a minimal C++ bridge that shuttles FIX application messages back and forth to a perl process over a socket. I then parse the FIX messages in perl with a custom FixMessage base class, run all of my application logic there, creating FixMessage objects as responses and then turn them back into a string to send back to the C++ bridge. I store the FIX messages as a hash mapping the fix tag number to the value. I then have accessor methods named after the mnemonic for each tag number. I actually just have a hash (%tagMapping) in my base class with the mapping and use an AUTOLOAD to create the accessors on demand. Parsing the FIX message is as simple as this code: sub fromString { my $string = shift; my($class, %tags); foreach my $field (split /\001/, $string) { my($tag, $value) = split /=/, $field, 2; if ($tag == $tagMapping{'MsgType'}) { $class = $msgType_2_class{$value}; next; } next if defined $isHeaderTag{$tag}; $tags{$tag} = $value; } return $class->new(\%tags); } I have sub-classes of FixMessage for each MsgType that I handle; the %msgType_2_class hash has the mapping. Actually, there's an additional complication to handle repeating groups; the value of a repeating group is an array ref with one element for each instance of the group; because tag order in repeating groups matters, each instance is represented with an array consisting of tag number/value pairs. Something like this: [ [ 42 => 'value', 165 => 'another value' ], [ 42 => 'value2', 165 => 'yet another' ], ... ]. So my actual fromString function has more logic to handle this. Anyway, converting an object back to a string isn't too hard; the only tricky parts are including the body length in the header and computing the checksum for the trailer. My code looks like this: sub toString { my $this = shift; my $header = "8=FIX.4.4\0019="; my $body = join("\001", "35=$class_2_msgType{ref $this}", map _toString($_, $this->{$_}), keys %$this) . "\001"; my $msg = $header . length($body) . "\001$body"; my $cksum = 0; $cksum += ord($_) for split //, $msg; $cksum = sprintf "%03d", $cksum %256; return $msg . "10=$cksum\001"; } sub _toString { my($key, $value) = @_; if (ref $value eq 'ARRAY') { return unless @$value; return join "\001", "$key=" . @$value, map { my $val = $_; my @data; for (my $i = 0; $i < $#$val; $i+=2) { push @data, "$tagMapping{$val->[$i]}=" . $val->[$i + 1]; } @data; } @$value; } elsif ($value ne '') { return "$key=$value"; } else { return; } } That's pretty much my whole FIX message base class. The constructor allows objects to be constructed from a string or from tag mnemonic => value pairs. I don't know if this helps you, but at least you see how simple it is to handle parsing and generation of FIX messages. Benjamin Holzman From BHolzman at ise.com Wed Dec 19 06:40:39 2007 From: BHolzman at ise.com (Holzman, Benjamin) Date: Wed, 19 Dec 2007 09:40:39 -0500 Subject: [Banking-pm] Parsing FIX messages In-Reply-To: <66B10B1DEBCE404CA35182C93F690E7A4DF011@CRPB-MB01-V.office.iseoptions.com> References: <66B10B1DEBCE404CA35182C93F690E7A4DF011@CRPB-MB01-V.office.iseoptions.com> Message-ID: <66B10B1DEBCE404CA35182C93F690E7A4DF012@CRPB-MB01-V.office.iseoptions.com> banking-pm-bounces+bholzman=ise.com at pm.org wrote: > banking-pm-bounces+bholzman=iseoptions.com at pm.org wrote: >> Does anyone know if a module is available for parsing FIX messages? I >> didnt see any on cpan just wondering if anyone here did one >> internally? > > Here's what I posted the last time this came up: I should also point out that this code is for the text-based FIX protocol, not the XML-based FIXML.