Re: [Quickfix-developers] Using custom defined dictionaries and classes
Brought to you by:
orenmnero
|
From: Joerg T. <Joe...@ma...> - 2005-08-11 14:25:58
|
Hi Michael,
> Hi, i have a question about using custom defined classes with Session
> initiators. I am trying to host multiple connections on one process for
> order entry and If i generate classes from an XML spec file it will only
> seem to want to use that at the session level if that class package is named
> quickfix.fix42 or quickfix.fix43 but it i name it quickfix.fix42.custom and
> try to cast a logon to a custom.logon i will get a classs cast exception, is
> there any way to tell the session which package to use or does it just go by
> what the begin string is called?
Actually, the XML generation is neither bullet-proof nor complete at the moment.
I guess you are using Java so you might give QuickFIX/J a try where the class
generation using XML is more complete.
If I understood you right, you want to tell QF that if it receives a string of the form
"BeginString=FIX.4.2|...|35=A|..."
then it should create an object with the class quickfix.fix42.custom.Logon instead of
quickfix.fix42.Logon. Here you could use a MessageFactory. Have a look at the code of the
DefaultMessageFactory for Java, and create your own one. If you setup the QF application,
you can specify your message factory.
On the other hand, if you need just one or two extra fields in the custom message, it may
be simpler to pull them out using message.getField(SomeField.FIELD), where SomeField could
a Field already defined by QF or a custom field.
Cheers, Jörg
--
Joerg Thoennes
http://macd.com
Tel.: +49 (0)241 44597-24 Macdonald Associates GmbH
Fax : +49 (0)241 44597-10 Lothringer Str. 52, D-52070 Aachen
|