[英]How to validate a FIX message against Fix dictionary in QuickFix/J?
如果验证在 QuickFix/J 中打开,接收到的 FIX 消息将根据为 Fix 引擎配置的 FIX 字典进行验证。
验证传入消息| 允许绕过消息验证(针对字典)。 默认值为“Y”。
QuickFix/J 中是否存在任何实用程序类或方法,它为我提供此功能以根据 Fix 字典验证示例 Fix 消息?
你想使用 DataDictionary.validate()
DataDictionary dataDictionary = new DataDictionary( pathToDictionary );
Message quickfixMessage = new Message( message, dataDictionary );
dataDictionary.validate( quickfixMessage );
其中 message 是修复消息。 QuickfixJ 在 etc 文件夹中包含一些字典。
如果您有要验证的特定String
, quickfix.Message
有一个构造函数可以让您执行此操作:
public Message(String string,
DataDictionary dd,
boolean validate)
throws InvalidMessage
例如,可以像这样使用。
DataDictionary myDict = new DataDictionary(dictionaryPathHere);
Message myMessage = new Message(messageString, myDict, true);
// If this doesn't throw an exception, the message was successfully validated against the dictionary.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.