Search code examples
javafix-protocolquickfixj

Recived different fix message in fromApp method and message file in filStorePath


I am trying to capture MarketDataIncrementalRefresh messages. It got a group noMDEntries, I am trying to parse over it.

I have two problems:

1st - I have printed the message that is coming in the fromApp method which is different from what I am getting in my file created through FileStorePath. How is this possible? Then I am cracking through message cracker but even after cracking it is the same message as received in fromApp

Message from fromApp:

8=FIX.4.29=7535=X34=3649=XXXXXXXX52=2019011605:09:51.00056=XXXXXXXX262=1268=110=223

Message received in file :

8=FIX.4.29=0019435=X49=XXXXXXXX56=XXXXXXXX34=3652=20190116-05:09:51.000262=1268=1279=1269=055=ES167=FUT200=201903541=20190315205=1518211=M207=CME100=XCME461=F15=USD270=249375271=20290=110=123

2nd - While iterating through the group I am getting an error as :

quickfix.FieldNotFound: 268, index=1
    at quickfix.FieldMap.getGroup(FieldMap.java:633)

but as you can see field 268 is set, also I have checked it again through message.isSetField(268) which results in true, just after it tried :

MarketDataIncrementalRefresh.NoMDEntries mdEntriesGroup = new MarketDataIncrementalRefresh.NoMDEntries();
message.getGroup(1, mdEntriesGroup);

it gives the above error.

FIX42.xml looks like which has same order of fields as in my message received.:

 <message name='MarketDataIncrementalRefresh' msgtype='X' msgcat='app'>
        <field name='MDReqID' required='Y' />
        <field name='PriceFeedStatus' required='N' />
        <group name='NoMDEntries' required='Y'>
            <field name='MDUpdateAction' required='Y' />
            <field name='MDEntryType' required='Y' />
            <field name='Symbol' required='N' />
            <field name='SecurityType' required='N' />
            <field name='SecuritySubType' required='N' />
            <field name='MaturityMonthYear' required='N' />
            <field name='MaturityDate' required='N' />
            <field name='MaturityDay' required='N' />
            <field name='PutOrCall' required='N' />
            <field name='StrikePrice' required='N' />
            <field name='OptAttribute' required='N' />
            <field name='DeliveryTerm' required='N' />
            <field name='DeliveryDate' required='N' />
            <field name='SecurityID' required='N' />
            <field name='SecurityExchange' required='N' />
            <field name='ExDestination' required='N' />
            <field name='CFICode' required='N' />
            <field name='Currency' required='N' />
            <field name='MDEntryPx' required='N' />
            <field name='MDEntrySize' required='N' />
            <field name='MDEntryDate' required='N' />
            <field name='MDEntryTime' required='N' />
            <field name='MDEntryPositionNo' required='N' />
            <field name='SecondaryOrderID' required='N' />
            <field name='NumberOfOrders' required='N' />
        </group>
        <field name='ExchangeSendingTime' required='N' />
        <field name='ExchangeTransactTime' required='N' />
        <field name='ExchangeSeqNum' required='N' />
    </message>

Solution

  • Always trust the message log over FromApp() and FromAdmin(). The log is recorded before the engine attempts to parse the message; the callbacks happen after. If an error happens in parsing (like in your case), what you see in the callback will be wrong (which you are seeing).

    I've seen your issue before. What is probably happening is that your configuration has a mistake, or your configured DD xml file does not accurately match your counterparty's specification.

    First, your config file should have these lines:

    UseDataDictionary=Y
    
    # for FIX4
    DataDictionary=path/to/your/dd.xml
    
    # for FIX5+
    AppDataDictionary=path/to/your/FIX5whatever.xml
    TransportDataDictionary=path/to/your/FIXT1.1.xml
    

    Second, check your message against the DD file that's in your config. Probably something in the repeating group definition is not correct. For instance, a field could be missing from the group definition and the parser is exiting the group early when it hits it. Make sure your config points to the correct xml file.

    (If you fix your message paste above to include visible field separators, I'll come back and help take a look.)