簡體   English   中英

如何根據 QuickFix/J 中的 Fix 字典驗證 FIX 消息?

[英]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 文件夾中包含一些字典。

如果您有要驗證的特定Stringquickfix.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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM