简体   繁体   English

标签多次出现QuickFix

[英]Tag appears more than once QuickFix

I am sending a message MarketDataSnapshotFullRefresh to a client application, but I am getting "Tag appears more than once" in the toAdmin method. 我正在向客户端应用程序发送MarketDataSnapshotFullRefresh消息,但在toAdmin方法中却收到“标签出现多次”的消息。 The raw message string I am getting is 我得到的原始消息字符串是

8=FIX.4.2|9=111|35=3|34=222|49=CLIENT1|52=20120217-18:57:44.233|56
=FixServer|45=189|58=Tag appears more than once|371=37|372=W|10=234|

Does anybody have an idea? 有人有主意吗?

  QuickFix42.MarketDataSnapshotFullRefresh message =
       new QuickFix42.MarketDataSnapshotFullRefresh(new Symbol("QF"));

  QuickFix42.MarketDataSnapshotFullRefresh.NoMDEntries group =
          new QuickFix42.MarketDataSnapshotFullRefresh.NoMDEntries();

        group.set(new MDEntryType('0'));
        group.set(new MDEntryPx(12.32));
        group.set(new MDEntrySize(100));
        group.set(new OrderID("ORDERID"));
        message.addGroup(group);

        group.set(new MDEntryType('1'));
        group.set(new MDEntryPx(12.32));
        group.set(new MDEntrySize(100));
        group.set(new OrderID("ORDERID"));
        message.addGroup(group);

        Session.sendToTarget(message, session);

This looks like a repeating group issue. 这看起来像是重复的小组问题。 Your client is treating Snapshot message as a flat no-groups message, and then rejecting it because of the repeated tags. 您的客户将Snapshot消息视为无分组消息,然后由于重复的标签而将其拒绝。 (Your message construction code appears correct.) (您的消息构造代码似乎正确。)

When a client does not recognize groups, then that usually means the DataDictionary is misconfigured. 如果客户端无法识别组,则通常意味着DataDictionary配置错误。

Make sure the following is set in your configuration, and I suspect that this particular problem will go away: 确保在您的配置中设置了以下内容,并且我怀疑这个特定问题会消失:

UseDataDictionary=Y
DataDictionary=path/to/your/DD.xml

Your problem lies in your data dictionary - your FIX42.xml file should have the correct definition for MarketDataSnapshotFullRefresh, with the component block defined for the MDEntries repeating group.Also make sure your config file has "UseDataDictionary=Y" and that the path to your custom FIX42.xml is defined. 您的问题出在数据字典中-您的FIX42.xml文件应具有正确的MarketDataSnapshotFullRefresh定义,并为MDEntries重复组定义了组件块。还请确保您的配置文件具有“ UseDataDictionary = Y”,并且该文件的路径自定义FIX42.xml已定义。

It is also possible that the order of the fields defined in your .xml file is not the same as your counterparty's spec. .xml文件中定义的字段顺序也可能与交易对手的规范不同。 Make sure they are in the same order as well. 确保它们的顺序也相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM