简体   繁体   English

由于重复,Quickfixn自定义消息生成无法编译

[英]Quickfixn custom message generation cannot compile because of duplicates

I am new to the Fix protocol in general, when looking for Fix engines, I was recommened to try quickfix, I have researched some topics and finally managed to generate custom classes, but the project does to compile because some fields are duplicated, this occurs when the main message body defines a tag thats already present in a component, the dictionary that I am using is supplied somewhere and as such I do not have control over it. 我通常是Fix协议的新手,在寻找Fix引擎时,建议我尝试使用quickfix,我研究了一些主题并最终设法生成了自定义类,但是该项目确实可以编译,因为某些字段是重复的,所以会发生这种情况当主消息正文定义了某个组件中已经存在的标签时,我正在使用的字典会在某处提供,因此我无法对其进行控制。

<message name="SumMessage" msgtype="X" msgcat="app">
  <component name="SumComponent" required="Y" />
  <field name="DuplicateField" required="Y" />
</message>

<component name="SumComponent">
  <field name="DuplicatedField" required="Y" />
</component>

My question is, since the above has already been defined in the custom component, will it cause the code generation ruby code to create duplicates of the values when creating the message class? 我的问题是,由于以上已在自定义组件中定义,因此在创建消息类时,是否会导致代码生成红宝石代码创建值的重复项? If so, does this mean that the dictionary I am using is invalid and I should rather send it back as such?. 如果是这样,这是否表示我正在使用的字典无效,而应该将其发送回去?

That looks like invalid FIX to me 在我看来,这是无效的FIX

You can't have the same field twice in a message unless you have repeating groups defined, and I see no repeating groups in your spec. 除非定义了重复组,否则消息中不能有两次相同的字段,而且我在规范中看不到任何重复组。

Ask for some example messages to see what they actually want, and you can tweak the spec to match. 索取一些示例消息以查看其实际需求,然后可以调整规格以使其匹配。

Also, you don't necessarily need to regenerate and recompile, if you're willing to forgoe the nice setter and getter functions. 另外,如果您愿意放弃漂亮的setter和getter函数,则不必重新生成和重新编译。 For example, message type BN doesn't exist in FIX 4.2, but I have a counterparty that wanted me to send them that message. 例如,消息类型BN在FIX 4.2中不存在,但是我有一个交易对手要我向他们发送该消息。 So I pulled a subset of the definition from a FIX 4.4 spec, put it in my FIX 4.2 spec xml, and did this in code 所以我从FIX 4.4规范中提取了定义的子集,将其放入FIX 4.2规范xml中,并在代码中完成了此操作

QuickFix42.Message ack = new QuickFix42.Message(new MsgType("BN"));
ack.setField(new ExecID(execId));
ack.setField(new ExecAckStatus(QuickFix.ExecAckStatus.ACCEPTED));
Session.sendToTarget(ack, session);

And sent that. 并发送了。

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

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