2012-10-17 73 views
2

我們似乎無法使用QuickFix處理某些組消息。在Quickfix C++中重複組消息

我想使用QuickFix(C++)建立與ICE交換的連接。我創建了一個自定義數據字典來處理ICE的非標準消息。要處理的第一條消息是SecurityDefinition。該消息包含大約13000個條目,分成100個塊。我在下面附加了消息(爲清楚起見,添加了前兩個帶有CR/LF的條目)。

我的問題是在數據字典中,我將組定義爲條目的一部分,並指定了組中指定的所有字段。然而,這條消息在它作爲無效標籤到達黑客之前被拒絕(標籤= 305)。

消息2拒絕:標記該消息類型沒有定義:305

這是否字典項看起來是正確的。有沒有關於如何處理羣組消息的任何文檔?

字典條目

<message name='SecurityDefinition' msgcat='app' msgtype='d'> 
    <field name='SecurityResponseID' required='Y' /> 
    <field name='SecurityResponseType' required='Y' /> 
    <field name='SecurityReqID' required='Y' /> 
    <field name='TotNoRelatedSym' required='N' /> 
    <field name='NoRpts' required='N' /> 
    <field name='ListSeqNo' required='N' /> 
    <group name='NoUnderlyings' required='N'> 
     <field name='UnderlyingSymbol' required='N' /> 
     <field name='UnderlyingSecurityID' required='N' /> 
     <field name='UnderlyingSecurityIDSource' required='N' /> 
     <field name='UnderlyingCFICode' required='N' /> 
     <field name='UnderlyingSecurityDesc' required='N' /> 
     <field name='UnderlyingMaturityDate' required='N' /> 
     <field name='UnderlyingContractMultiplier' required='N' /> 
     <field name='IncrementPrice' required='N' /> 
     <field name='IncrementQty' required='N' /> 
     <field name='LotSize' required='N' /> 
     <field name='NumofCycles' required='N' /> 
     <field name='LotSizeMultiplier' required='N' /> 
     <field name='Clearable' required='N' /> 
     <field name='StripId' required='N' /> 
     <field name='StripType' required='N' /> 
     <field name='StripName' required='N' /> 
     <field name='HubId' required='N' /> 
     <field name='HubName' required='N' /> 
     <field name='HubAlias' required='N' /> 
     <field name='UnderlyingUnitOfMeasure' required='N' /> 
     <field name='PriceDenomination' required='N' /> 
     <field name='PriceUnit' required='N' /> 
     <field name='Granularity' required='N' /> 
     <field name='NumOfDecimalPrice' required='N' /> 
     <field name='NumOfDecimalQty' required='N' /> 
     <field name='ProductId' required='N' /> 
     <field name='ProductName' required='N' /> 
     <field name='ProductDescription' required='N' /> 
     <field name='TickValue' required='N' /> 
     <field name='ImpliedType' required='N' /> 
     <field name='PrimaryLegSymbol' required='N' /> 
     <field name='SecondaryLegSymbol' required='N' /> 
     <field name='IncrementStrike' required='N' /> 
     <field name='MinStrike' required='N' /> 
     <field name='MaxStrike' required='N' /> 
    </group> 
</message> 

實際消息是

8 = FIX.4.49 = 5004335 = D49 = ICE34 = 252 = 20121017-00:39:41.38556 = 600357 = 23322 = 3924323 = 4320 = 1393 = 1310382 = 13267 = 1711 = 100 311 = 1705282309 = TEB SMG0013-TFL SMG0013305 = 8463 = FXXXXX307 = NG基期貨Spr -TETCO-ELA/TGP-500L - Feb13542 = 20130131436 = 1.09013 = 0.00059014 = 2500.09017 = 25009022 = 289024 = 19025 = Y916 = 20130201917 = 201302289201 = 11969200 = 129202 = Feb139300 = 60589301 =德克薩斯東部傳輸公司 - 東路易斯安那州區域/田納西州天然氣管道公司 - L區,500腿池9302 = TETCO-ELA/TGP-5 00L998 = MMBtus9100 = USD9101 = USD/MMBtu9085 =每日9083 = 49084 = 09061 = 4909062 = NG基準期貨Spr9063 =天然氣基準期貨價差9032 = 1.259004 = 17051939005 = 1353778 311 = 1714677309 = PGE SQF0014.H0014-SCB SQF0014.H0014305 = 8463 = FXXXXX307 = NG Basis期貨Spr - PG & E-Citygate/Socal-Citygate-Q1 14542 = 20131231436 = 1.09013 = 0.00059014 = 2500.09017 = 25009022 = 909024 = 19025 = Y916 = 20140101917 = 201403319201 = 12339200 = 159202 = Q1 149300 = 59979301 = E - Citygate/Socal - Citygate9302 = PG & E-Citygate/Socal-Citygate998 = MMBtus9100 = USD9101 = USD/MMBtu9085 = daily9083 = 49084 = 09061 = 4909062 = NG基準期貨Spr9063 =天然氣基準期貨價差9032 = 1.259004 = 13430529005 = 1344660

回答

1

如果這些標籤不在您的配置文件中,請將它們添加到它。我假設你的數據字典沒有被讀取。

UseDataDictionary=Y 

ValidateFieldsOutOfOrder=N /* This caused a lot of grief for me, 
because of the underlying data structure used in QuickFix, 
hence I always put it to N to save me the pain */ 

但我檢查了規格爲FIX4.4,這個消息確實存在的版本,那麼你爲什麼要加入呢?這應該在QuickFix提供的默認xml配置文件中。

您的第一組正在被正確讀取,但第二組(兩個305標籤)正在導致錯誤。 Quickfix無法弄清楚有多少組以及哪些組。而且你不必要地複製信息。你在消息中使用這樣的一個組。而Quickfix無法正確解析您的消息定義。這就是QuickFix的工作方式,所以你無法做任何事情。

<group name="NoUnderlyings" required="N"> 
    <component name="UnderlyingInstrument" required="N" /> 
</group> 

否則你將需要複製UnderlyingInstrument在多個位置,如果是在多個消息中使用,它會增加你的XML大小沒有任何好處。 This is how it is done in the default Quickfix config file,嘗試遵循它,它會爲你節省很多的痛苦。

+0

我有數據字典條目,我將嘗試ValidateFieldsOutOfOrder標誌。我曾嘗試修改底層的樂器組件,但結果相同。非常感謝您的關注。 –

+0

@Mark Jackson - 不要混淆你的XML字典,不要添加已經存在的東西,除非它是一個新的消息或組件。它只會讓你花費數小時來找出你的問題。 – DumbCoder

1

我們得到了解決此通過創建名爲SecDefICE自定義組件與所有的自定義字段和自定義數據字典重新定義SecurityDefinition消息。

我們現在可以讀取組信息。唯一的缺點是我們不得不使用泛型組和按數字獲取字段,而不是以類型安全的方式進行。當我有時間時,我將創建一個新的命名空間(FIXICE或類似的),它將具有正確的頭文件(消息,字段,自定義餅乾等)

下面列出的是我們的字典中的定義。

新組件

<component name='SecDefICE' required='N'> 
    <field name='UnderlyingSymbol' required='N' /> 
    <field name='UnderlyingSecurityID' required='N' /> 
    <field name='UnderlyingSecurityIDSource' required='N' /> 
    <field name='UnderlyingCFICode' required='N' /> 
    <field name='UnderlyingSecurityDesc' required='N' /> 
    <field name='UnderlyingMaturityDate' required='N' /> 
    <field name='UnderlyingContractMultiplier' required='N' /> 
    <field name='IncrementPrice' required='N' /> 
    <field name='IncrementQty' required='N' /> 
    <field name='LotSize' required='N' /> 
    <field name='NumofCycles' required='N' /> 
    <field name='LotSizeMultiplier' required='N' /> 
    <field name='Clearable' required='N' /> 
    <field name='StartDate' required='N' /> 
    <field name='EndDate' required='N' /> 
    <field name='StripId' required='N' /> 
    <field name='StripType' required='N' /> 
    <field name='StripName' required='N' /> 
    <field name='HubId' required='N' /> 
    <field name='HubName' required='N' /> 
    <field name='HubAlias' required='N' /> 
    <field name='UnderlyingUnitOfMeasure' required='N' /> 
    <field name='PriceDenomination' required='N' /> 
    <field name='PriceUnit' required='N' /> 
    <field name='Granularity' required='N' /> 
    <field name='NumOfDecimalPrice' required='N' /> 
    <field name='NumOfDecimalQty' required='N' /> 
    <field name='ProductId' required='N' /> 
    <field name='ProductName' required='N' /> 
    <field name='ProductDescription' required='N' /> 
    <field name='TickValue' required='N' /> 
    <field name='ImpliedType' required='N' /> 
    <field name='PrimaryLegSymbol' required='N' /> 
    <field name='SecondaryLegSymbol' required='N' /> 
    <field name='IncrementStrike' required='N' /> 
    <field name='MinStrike' required='N' /> 
    <field name='MaxStrike' required='N' /> 
    </component> 

新的消息定義

<message name='SecurityDefinition' msgcat='app' msgtype='d'> 
    <field name='SecurityResponseID' required='Y' /> 
    <field name='SecurityResponseType' required='Y' /> 
    <field name='SecurityReqID' required='Y' /> 
    <field name='TotNoRelatedSym' required='N' /> 
    <field name='NoRpts' required='N' /> 
    <field name='ListSeqNo' required ='N' /> 
    <group name='NoUnderlyings' required='N'> 
    <component name='SecDefICE' required='N' /> 
    </group> 
    <field name='Text' required='N' /> 
    <!-- these are the original fields in 4.4 spec --> 
    <!-- group name='NoUnderlyings' required='N' --> 
    <!-- component name='UnderlyingInst' required='N' --> 
    <!-- /group --> 
    <!-- component name='Instrument' required='N' --> 
    <!-- component name='InstrumentExtension' required='N' --> 
    <!-- field name='Currency' required='N' --> 
    <!-- field name='TradingSessionID' required='N' --> 
    <!-- field name='TradingSessionSubID' required='N' --> 
    <!-- field name='EncodedTextLen' required='N' --> 
    <!-- field name='EncodedText' required='N' --> 
    <!-- group name='NoLegs' required='N' --> 
    <!-- component name='InstrumentLeg' required='N' --> 
    <!-- /group --> 
    <!-- field name='ExpirationCycle' required='N' --> 
    <!-- field name='RoundLot' required='N' --> 
    <!-- field name='MinTradeVol' required='N' --> 
    </message>