my $proto = Protocol::FIX->new('FIX44'); my $buffer = $proto->serialize_message( LogonMessage => [ SenderCompID => 'me', TargetCompID => 'you', MsgSeqNum => 1, SendingTime => '20090107-18:15:16', EncryptMethod => 'NONE', HeartBtInt => 21, ]); # successfull my ($message, $error) = $proto->parse_message(\$string); is $message->get('SenderCompID'), 'me'; is $message->get('TargetCompID'), 'me'; ok !$error; # no enought data my ($message, $error) = $proto->parse_message(\""); ok !$message; ok !$error; # error my ($message, $error) = $proto->parse_message(\"bla-bla"); ok !$message; ok $error; # die message
binary.com needs full-powered FIX 4.4. protocol. There are a few exising FIX implementations in CPA:
1) is not transport-layer neytral. I.e. it opens underlying socket connections etc. So, it is not suitable for server-side usage, e.g. in conjunction with Mojolicious.
2) Seems just and intention for implementation. It does nothing, as I can see.
3) Is another binary.com module, but it provides only encoding, i.e. without any knowledge about Fields, Groups etc.
The new module
Protocol::FIX will be constructed on fly from xml description of the protocol ( taken at http://www.quickfixengine.org/ , targeted at 4.4 version for nwo).