简体   繁体   English

如何解决拒绝无效消息的问题:quickfix.IncorrectDataFormat

[英]How to fix rejecting invalid message: quickfix.IncorrectDataFormat

I have a QuickFIX initiator getting 1.23E-6 in tag 270 from market data. 我有一个QuickFIX启动器,它从市场数据中获取标签270中的1.23E-6。 Then I saw QuickFIX/J throw the following error: 然后我看到QuickFIX / J抛出以下错误:

Rejecting invalid message: quickfix.IncorrectDataFormat: Incorrect data format for value, field=270 拒绝无效消息:quickfix.IncorrectDataFormat:值的错误数据格式,字段= 270

Any idea how to avoid the rejection and parse the correct value? 任何想法如何避免拒绝并解析正确的值?

I also receive the scientific format of number from my 35=8 message in tag 44 (price), but I could just getString then convert them into BigDecimal with no issue. 我还从标签44(价格)中的35 = 8消息中收到了科学的数字格式,但是我可以先将getString然后将它们转换为BigDecimal,而不会出现任何问题。

The real problem here is that your counterparty should not be sending a scientific-notation value in that field. 真正的问题在于,您的交易对手不应在该领域发送科学计数值。 The field has type "Price", and per spec, that should be a whole or decimal number, thus that's what the QF engine is validating. 该字段的类型为“ Price”,每个规格应为整数或十进制数,这就是QF引擎正在验证的内容。

So, I don't know who your counterparty is, but maybe you want to check with their support and see if this might be a legit bug on their end. 因此,我不知道您的对手方是谁,但也许您想在他们的支持下进行检查,看看这是否可能对他们不利。

(I can't explain why your 35=8/tag-44 message is being accepted. There must be a detail to your situation that I'm not aware of.) (我无法解释为什么您的35 = 8 / tag-44消息被接受。您的情况一定有一个我不知道的细节。)

If you need to work around this anyway: An easy cheat way to make the engine accept this message is to simply change the field's type to "string" in your Data Dictionary xml file. 如果您仍然需要解决此问题:使引擎接受此消息的一种简单的作弊方法是,只需在数据字典xml文件中将字段的类型更改为“字符串”。 Of course, that will require you to always explicitly convert the string to BigDecimal, but it sounds like you will not have a problem with that. 当然,这将要求您始终将字符串显式转换为BigDecimal,但这听起来像您不会遇到任何问题。

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

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