gpt4 book ai didi

java - 修复协议(protocol)错误 : Field [5232] was not found in message

转载 作者:行者123 更新时间:2023-11-29 09:02:32 25 4
gpt4 key购买 nike

我正在使用 Quickfix 和 stunnel 通过 RSA 私钥连接到服务器。

当我发送市场数据请求 (MsgType=V) 时,出现以下错误

8=FIX.4.49=14735=Y34=55349=ABCD52=20130513-03:23:23.24356=ABCDEFGHI58=Field [5232] was not found in message.262=85ee75f8-ab5d-4aff-b87d-108b74d3281=010=53

我从 this 搜索并找到了链接 5232 是 Currency 字段

所以我将 Currency 值传递给 5232,如下所示

Message message = new Message();
................
message.setField(5232, new quickfix.field.Currency("EUR"));
................
Session.sendToTarget(message, sessId);

但是当我检查外发消息的代码时,我发现字段 5232 被自动转换为'15=EUR',并且它再次报错'Field [5232] was not found in message'

谁能指出我在这里遗漏了什么?

最佳答案

我对字段编号有点困惑,但无论您犯的错误是请求必须有一个组并且货币字段必须在该组中。

这是一个例子:

    MarketDataRequest marketDataRequest = new MarketDataRequest();
String reqID = symbol+new Date().getTime(); //unique ID
marketDataRequest.setString(MDReqID.FIELD,reqID); // set ID
char requestType = SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES;

marketDataRequest.setChar(SubscriptionRequestType.FIELD,requestType); // set update type
marketDataRequest.setInt(MarketDepth.FIELD, 0);
marketDataRequest.setInt(MDUpdateType.FIELD, 0);

MarketDataRequest.NoMDEntryTypes entryTypes = new MarketDataRequest.NoMDEntryTypes(); // create group to request both bid and offers
entryTypes.set(new MDEntryType(MDEntryType.BID));
marketDataRequest.addGroup(entryTypes);
entryTypes.set(new MDEntryType(MDEntryType.OFFER));
marketDataRequest.addGroup(entryTypes);

MarketDataRequest.NoRelatedSym noRelatedSym = new MarketDataRequest.NoRelatedSym(); // create group to add list of symbols
noRelatedSym.set(new Symbol(getSymbol(symbol)));
marketDataRequest.addGroup(noRelatedSym);

如您所见,必须先将某些字段输入到组中,然后再输入到消息中。应该有一个名为 FIX44.xml 的字典定义,它将向您显示消息的结构。它在 quickfix/etc/ 目录中。

关于java - 修复协议(protocol)错误 : Field [5232] was not found in message,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16514541/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com