|
From: Naresh B. <NB...@sa...> - 2007-03-29 01:46:14
|
Maybe I need to give some more context. The requirement I have is to be
able to change the message metadata dynamically. For example, if a
custom field tag value is wrong in a running system, then I should be
able to correct it without bouncing the system. Hence message creation
and parsing should be completely metadata driven (no hard coding is
allowed in code). I think message parsing can be completely driven by
the DataDictionary, but I am not sure if message creation can be driven
by the same metadata, especially due to issue #1. What I need is a
simple method on the DataDictionary that returns a msgType given the
message name. For example,
String getMsgType(String msgName);
Thus dd.getMsgType("NewOrderSingle") will return "D".
I think the DataDictionary has this information, I just don't see a
method to get it out of there.
Naresh
-----Original Message-----
From: qui...@li...
[mailto:qui...@li...] On Behalf Of Toli
Kuznets
Sent: Wednesday, March 28, 2007 8:47 PM
To: qui...@li...
Subject: Re: [Quickfixj-users] Can DataDictionary be used to create
messages?
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/
Naresh,
Maybe i'm not understanding what you ultimately want to do.
> 1) Given a message name (e.g. "NewOrderSingle"), how can I get the
msgType
> (e.g. "D") using the DataDictionary? I do not readily see an method to
do
> this.
The usual pattern is to use a MessageFactory to create a message:
factory.create(MsgType.ORDER_SINGLE)
> 2) Is it safe to create fields using code like new ClOrdID("321")? I
see
> that the constructor of ClOrdID hard codes the field tag to "11". Are
these
> tags values same across all FIX versions? I am thinking of this
alternate
> approach to pick up the tag value from the data dictionary - does it
make
> sense or is it needlessly complicated?
The ClOrdID.FIELD value is the same across all FIX versions. the
quickfix.field.xxx objects are auto-generated from the FIX4x.xml data
dictionary files so the values should be constant.
> new StringField(dd.getFieldTag("ClOrdID"), "321")
so this may be better written as: new ClOrdID("321") or new
StringField(ClOrdID.FIELD, "321") if you don't want to be specific.
If you are adding your own custom fields to the FIX4x.xml file, then
go ahead and create the objects for them - that's what we did, you can
see the example at
http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/m
ain/java/org/marketcetera/quickfix/customfields/NoMarketDataSnapshots.ja
va
hope this helps.
--=20
Toli Kuznets
http://www.marketcetera.com: Open-Source Trading Platform
download.run.trade.
------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDE
V
_______________________________________________
Quickfixj-users mailing list
Qui...@li...
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
|