简体   繁体   English

QuickFIX/J 未读取 FIX 消息中的所有重复组

[英]QuickFIX/J not reading all the repeating groups in FIX message

We are receiving fix messages from WebICE exchange in a text file and our application is reading and parsing them line by line using QuickFixJ.我们在文本文件中接收来自 WebICE 交换的修复消息,我们的应用程序正在使用 QuickFixJ 逐行读取和解析它们。 We noticed that in some messages the repeating group fields are not being parsed and upon validating with data dictionary getting error.我们注意到,在某些消息中,重复的组字段没有被解析,并且在使用数据字典进行验证时出现错误。

quickfix.FieldException: Out of order repeating group members, field=326

For example in the sample file data-test.csv the first 2 rows parsed successfully but third one fails with the above error message.例如,在示例文件data-test.csv中,前 2 行解析成功,但第三行解析失败并出现上述错误消息。

Upon investigation I found, in first 2 rows tag 326 comes after tag 9133 but in the third row it comes before that and hence fails in validation.经过调查,我发现,在前两行中,标签 326 在标签 9133 之后,但在第三行中,它在此之前,因此验证失败。 If I adjust data dictionary as per the third one it succeeds but ofcourse the first one starts failing.如果我根据第三个调整数据字典,它会成功,但当然第一个会开始失败。

This is happening only for few messages for most of the other fix messages are getting validated and parsed quite fine.这只发生在少数消息中,因为大多数其他修复消息都得到了验证和解析得很好。 This is part of the migration project from existing C# application using QuickFix/N to our scala application using QuickFix/J.这是从使用 QuickFix/N 的现有 C# 应用程序迁移到使用 QuickFix/J 的 scala 应用程序的迁移项目的一部分。 And its been working fine at the source end (with QuickFIx/N).它在源端运行良好(使用 QuickFIx/N)。 Is there any difference in both the libraries QuickFIx/J and QuickFIx/N in terms of dealing with group fields?在处理组字段方面,库 QuickFIx/J 和 QuickFIx/N 有什么区别吗?

To help recreate the issue, I have shared the data file having 3 fix messages as explained above.为了帮助重现问题,我已经共享了包含 3 条修复消息的数据文件,如上所述。

Data file: data-test.csv Data dictionary: ICE-FIX42.xml数据文件: data-test.csv数据字典: ICE-FIX42.xml

Here is the test code snippet这是测试代码片段

val dd: DataDictionary = new DataDictionary("ICE-FIX42.xml")
val mfile = new File("data-test.csv")
for (line <- Source.fromFile(mfile).getLines) {
    val message = new quickfix.Message(line,dd)
    dd.setCheckUnorderedGroupFields(true)
    dd.validate(message)
    val noOfunderlyings= message.getInt(711)
    println("Number of Underlyings "+noOfunderlyings)
    for(i <- 1 to noOfunderlyings ) {
      val FixGroup: Group = message.getGroup(i, 711)          
      println("UnderlyingSecurityID : " + FixGroup.getString(311))
    }
}

Request to fellow SO users, If you can help me with this.请求其他 SO 用户,如果你能帮助我。

Many Thanks非常感谢

You should use setCheckUnorderedGroupFields(false) to disable the validation of the ordering in repeating groups.您应该使用setCheckUnorderedGroupFields(false)禁用重复组中的排序验证。 However, this is only a workaround.但是,这只是一种解决方法。

I would suggest to approach your counterparty about this because especially in repeating groups the field order is required to follow the message definition, ie the order in the data dictionary.我建议就此与您的交易对手联系,因为特别是在重复组中,字段顺序需要遵循消息定义,即数据字典中的顺序。

FIX TagValue encoding spec FIX TagValue 编码规范

Field sequence within a repeating group重复组内的字段序列

... ...

Fields within repeating groups must be specified in the order that the fields are specified in the message definition.必须按照在消息定义中指定字段的顺序指定重复组中的字段。

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

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