[英]How to retrieve tag value from quickfixj FIX.4.2 executionreport
I want to persist a fix4.2 message to database by retrieving the value of each tag. 我想通过检索每个标签的值将fix4.2消息持久保存到数据库。 I am having the ExecutionReport object of the fix message. 我有修复消息的ExecutionReport对象。 I am retrieving the tag value of account using exec.getString(1) and this tag value is not present in the message so it is throwing FieldNotFound exception. 我正在使用exec.getString(1)检索account的标记值,并且消息中不存在该标记值,因此它抛出FieldNotFound异常。 In Fiximate I found that account is not a mandatory field. 在Fiximate中,我发现该帐户不是必填字段。
I also tried with exec.getAccount().getValue() but got same exception. 我也尝试使用exec.getAccount()。getValue(),但遇到了同样的异常。 I found that every all these method throws FieldNotFound exception. 我发现所有这些方法都会引发FieldNotFound异常。
Is there any way to retrieve the tag value as null if that non-mandatory field is not present in the fix message. 如果修复消息中没有该非强制性字段,则有任何方法可以将标记值检索为null 。
Any help will be highly appreciated. 任何帮助将不胜感激。
Thanks in advance. 提前致谢。
Regards, Shadab 问候,Shadab
You didn't say which QuickFIX port you are using (eg the original QF for C++, QF/J for Java, QF/n for C#). 您没有说要使用哪个QuickFIX端口(例如,用于C ++的原始QF,用于Java的QF / J,用于C#的QF / n)。
If a field is not required, you simply need to test for its presence first. 如果不需要字段,则只需要首先测试其存在。
C++: exec.isSetField(1)
or exec.isSetField(field)
C ++: exec.isSetField(1)
或exec.isSetField(field)
(there might also be a exec.isSetAccount()
, not sure) (也可能是exec.isSetAccount()
,不确定)
Java: exec.isSetField(1)
or exec.isSetAccount()
or exec.isSetField(field)
Java: exec.isSetField(1)
或exec.isSetAccount()
或exec.isSetField(field)
C#: exec.IsSet(1)
or exec.IsSetAccount()
or exec.IsSetField(field)
C#: exec.IsSet(1)
或exec.IsSetAccount()
或exec.IsSetField(field)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.