error when get value from marketdataincremental refresh

fuad trix :

I got an error in my quickfixj Application. First, I got an error like this:

Out of order repeating group members

After that, I added this text into my initiator.config:

ValidateUserDefinedFields=N
ValidateIncomingMessage=N

But now I got another error in my application:

quickfix.FieldNotFound: Field was not found in message, field=55
        at quickfix.FieldMap.getField(FieldMap.java:223)
        at quickfix.FieldMap.getString(FieldMap.java:237)
        at com.dxtr.fastmatch.marketdatarequestapps.TestMarketdataRequest.fromApp(TestMarketdataRequest.java:38)
        at quickfix.Session.fromCallback(Session.java:1847)
        at quickfix.Session.verify(Session.java:1791)
        at quickfix.Session.verify(Session.java:1862)
        at quickfix.Session.next(Session.java:1047)
        at quickfix.Session.next(Session.java:1204)
        at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:163)
        at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:113)
        at quickfix.mina.SingleThreadedEventHandlingStrategy.lambda$blockInThread$1(SingleThreadedEventHandlingStrategy.java:145)
        at quickfix.mina.SingleThreadedEventHandlingStrategy$ThreadAdapter$RunnableWrapper.run(SingleThreadedEventHandlingStrategy.java:267)
        at java.lang.Thread.run(Thread.java:748)

My code for get value of symbols is :

public void fromApp(quickfix.Message message, SessionID sessionID)
            throws FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType {
         try {
                String symbol = message.getString(Symbol.FIELD);
                    System.out.println(" FromApp " + message);
                    message.getString(TransactTime.FIELD);
//                  String seqNo = message.getString(MsgSeqNum.FIELD);
                    double bid = message.getDouble(MDEntryPx.FIELD);
                    double ask = message.getDouble(MDEntryPx.FIELD);


//                  System.out.println(seqNo + " " + message);


            } catch (FieldNotFound fieldNotFound) {
                fieldNotFound.printStackTrace();
            }
        }

I have also using this code

    public void onMessage (MarketDataIncrementalRefresh message, SessionID sessionID) throws FieldNotFound{
     try
       {
           MDReqID mdreqid = new MDReqID();
           SendingTime sendingtime = new SendingTime();
           NoMDEntries nomdentries = new NoMDEntries();
           quickfix.fix42.MarketDataIncrementalRefresh.NoMDEntries group
               = new quickfix.fix42.MarketDataIncrementalRefresh.NoMDEntries();
           MDUpdateAction mdupdateaction = new MDUpdateAction();
           DeleteReason deletereason = new DeleteReason();
           MDEntryType mdentrytype = new MDEntryType();
           MDEntryID mdentryid = new MDEntryID();
           Symbol symbol = new Symbol();
           MDEntryOriginator mdentryoriginator = new MDEntryOriginator();
           MDEntryPx mdentrypx = new MDEntryPx();
           Currency currency = new Currency();
           MDEntrySize mdentrysize = new MDEntrySize();
           ExpireDate expiredate = new ExpireDate();
           ExpireTime expiretime = new ExpireTime();
           NumberOfOrders numberoforders = new NumberOfOrders();
           MDEntryPositionNo mdentrypositionno = new MDEntryPositionNo();

           message.getField(nomdentries);
           message.getField(sendingtime);

           message.getGroup(1, group);

           int list = nomdentries.getValue();
           for (int i = 0; i < list; i++)
           {
               message.getGroup(i + 1, group);
               group.get(mdupdateaction);
               if (mdupdateaction.getValue() == '2')
                System.out.println("Enter");
               group.get(deletereason);
               group.get(mdentrytype);
               group.get(mdentryid);
               group.get(symbol);
               group.get(mdentryoriginator);
               if (mdupdateaction.getValue() == '0')
                   group.get(mdentrypx);
               group.get(currency);
               if (mdupdateaction.getValue() == '0')
                   group.get(mdentrysize);
           }

           System.out.printf("Got Symbol {0} Price {1}", 
       symbol.getValue(), mdentrypx.getValue());

}catch (Exception ex)
       {
    System.out.println("error" + ex);

}

but i also get error like this

quickfix.FieldNotFound: Field was not found in message, field=55
        at quickfix.FieldMap.getField(FieldMap.java:223)
        at quickfix.FieldMap.getString(FieldMap.java:237)
        at com.dxtr.fastmatch.marketdatarequestapps.TestMarketdataRequest.fromApp(TestMarketdataRequest.java:39)
        at quickfix.Session.fromCallback(Session.java:1847)
        at quickfix.Session.verify(Session.java:1791)
        at quickfix.Session.verify(Session.java:1862)
        at quickfix.Session.next(Session.java:1047)
        at quickfix.Session.next(Session.java:1204)
        at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:163)
        at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:113)
        at quickfix.mina.SingleThreadedEventHandlingStrategy.lambda$blockInpacket_write_wait: Connection to 3.13.235.241 port 22: Broken pipe

and here the value i check in my message.log 8=FIX.4.2^A9=0217^A35=X^A34=7291^A49=Fastmatch1^A52=20200401-10:47:59.833^A56=MDValueTrade2UAT1^A262=VT_020^A268=02^A279=2^A55=GBP/CHF^A269=0^A278=1140851192^A270=1.19503^A271=02000000^A279=0^A55=GBP/CHF^A269=0^A278=1140851194^A270=1.19502^A271=06000000^A10=114^A my broker have send to me the price and etc My question is: how to fix my problem from this code ?

Grant Birchmeier :

First, I got an error like this:

Out of order repeating group members

Your data dictionary doesn't match your counterparty's. Fix that and this will go away.

After that, I added this text into my initiator.config:

ValidateUserDefinedFields=N
ValidateIncomingMessage=N

This did not fix anything -- it HIDES your actual problem and has you looking at a new fake problem.

What you need to do:

Your configuration has this, right?

UseDataDictionary=Y
DataDictionary=path/to/FIXnn.xml
# or if FIX5:
AppDataDictionary=path/to/FIX5n.xml
TransportDataDictionary=path/to/FIXT.xml

Find your counterparty's documentation, and make sure your xml file's messages and fields match what they say they're going to send you. Make sure all repeating groups have the same fields in the same order.

Here is some documentation about how the Data Dictionary xml file is structured. It's pretty easy.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=388097&siteId=1