如何在 QuickFIX/J 中对外发邮件中的字段进行排序

How to order fields in outgoing messages in QuickFIX/J

有没有什么方法可以在不重建的情况下对外发消息中的字段进行排序 QuickFIX/J?或者任何可用的配置标志,它根据我们可能使用某些路径标志设置的任何验证文件对消息进行排序?

参见 QuickFIX/J User FAQ,主题 "I altered my data dictionary. Should I regenerate/rebuild QF/J?"。具体如下摘录:

If your DD changes aren't very extensive, maybe just a few field changes, then you don't really need to. If you added a whole new custom message type, then you probably should. If you changed field orders inside of repeating groups, then I recommend that you do, especially if those group changes are in outgoing messages.

OUTGOING MSGS: The DD xml file is irrelevant when you construct outgoing messages. You can pretty much add whatever fields you want to messages using the generic field setters (setString, setInt, etc) and QF will let you. The only trouble is with repeating groups. QF will write repeating group element ordering according to the DD that was used for code generation. If you altered any groups that are part of outgoing messages, you DEFINITELY need to rebuild.

根据我从这个 FAQ 条目中收集到的信息,除非重新排序是在重复组中,否则你不应该为外发消息重建。如果您更改重复组中的字段顺序,您应该重建。

在任何情况下,通过在字典中的消息中打乱字段来测试很容易,在您的配置中引用自定义字典,然后记录由 QuikFIX/J 引擎生成的消息。