简体   繁体   English

QuickFix / N:使用FIXT1与FIX5.0时如何输入键入的消息?

[英]QuickFix/N: How to have typed messages when using FIXT1.1 with FIX5.0?

Context 上下文

I have a test Acceptor and Initiator. 我有一个测试Acceptor和Initiator。 I am using QuickFix/N 1.7 release. 我正在使用QuickFix / N 1.7版本。 Everything works fine, if I configure both Acceptor and Initiator to FIX 4.4. 如果我将Acceptor和Initiator配置为FIX 4.4,一切正常。 Doing nothing, just connecting, then logging the incoming/outgoing heartbeat messages to the debug console. 什么都不做,只是连接,然后将传入/传出的心跳消息记录到调试控制台。 All OK, see below. 好的,见下文。

I change nothing just the two configuration files accordingly from FIX 4.4 to FIX 5.0. 因此,我改变什么只是两个配置文件从FIX 4.4至5.0 FIX。 All works (I mean the heartbeat messages still coming and going), but the message parameter of the callback is not a typed (heartbeat) runtime instance message anymore, instead the base class. 所有工作(我的意思是心跳消息仍在进行中),但回调的message参数不再是类型化(心跳)运行时实例消息,而是基类。

Diagnostics: 诊断:

  • All referenced specification files are in place. 所有引用的规范文件都已到位。 If I intentionally ruin a character either in TransportDataDictionary path or AppDataDictionary I got the expected exception 如果我故意破坏TransportDataDictionary路径或AppDataDictionary中的字符,我得到了预期的异常
  • Using the out of the box specification files, no customization at all. 使用开箱即用的规范文件,根本不需要自定义。

Question: 题:

Why the message instance is not a typed runtime instance message in the FIX 5.0 case and typed in the FIX 4.4 case? 为什么消息实例不是FIX 5.0案例中的类型化运行时实例消息,并且在FIX 4.4案例中键入? Is this the expected behavior or am I missing something? 这是预期的行为还是我错过了什么?

Code Exhibits: 代码展品:

Code in Initiator IApplication implementation which produces the output lines: Initiator IApplication实现中的代码,用于生成输出行:

public void ToAdmin(Message message, SessionID sessionID)
{
    Debug.WriteLine($@"(A)OUT: {message.GetType()}{message}");
}
public void FromAdmin(Message message, SessionID sessionID)
{
    Debug.WriteLine($@"(A)IN: {message.GetType()}{message}");
}

When using the 4.4 configuration then I see this: (message type is QuickFix.FIX44.Heartbeat ) 使用4.4配置时,我看到:(消息类型为QuickFix.FIX44.Heartbeat

Logon - FIX.4.4:TEST01->MYACCEPTOR
(A)IN: QuickFix.FIX44.Heartbeat8=FIX.4.4 9=5335=034=249=MYACCEPTOR52=20170715-15:00:31.59656=TEST0110=179
(A) OUT: QuickFix.FIX44.Heartbeat8=FIX.4.4 9=5335=034=249=TEST0152=20170715-15:00:31.60456=MYACCEPTOR10=169
(A) OUT: QuickFix.FIX44.Heartbeat8=FIX.4.4 9=5335=034=349=TEST0152=20170715-15:00:36.61056=MYACCEPTOR10=172
(A) IN: QuickFix.FIX44.Heartbeat8=FIX.4.4 9=5335=034=349=MYACCEPTOR52=20170715-15:00:36.61556=TEST0110=177

When using the 5.0 and configuration then I see this: ( message type is just QuickFix.FIX50.Message ) 使用5.0和配置时,我看到:( 消息类型只是 QuickFix.FIX50.Message

Logon - FIXT.1.1:TEST01->MYACCEPTOR
(A)IN: QuickFix.Message8=FIXT.1.19=5335=034=249=MYACCEPTOR52=20170715-15:06:16.92256=TEST0110=003
(A) OUT: QuickFix.Message8=FIXT.1.19=5335=034=249=TEST0152=20170715-15:06:16.93056=MYACCEPTOR10=002
(A) OUT: QuickFix.Message8=FIXT.1.19=5335=034=349=TEST0152=20170715-15:06:21.93656=MYACCEPTOR10=005
(A) IN: QuickFix.Message8=FIXT.1.19=5335=034=349=MYACCEPTOR52=20170715-15:06:21.94156=TEST0110=001

FIX5.0 configuration for Intiator: Intiator的FIX5.0配置:

[DEFAULT]
ConnectionType=initiator
ReconnectInterval=2
FileStorePath=store
FileLogPath=log
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=Y
TransportDataDictionary=..\spec\FIXT11.xml
AppDataDictionary=..\spec\FIX50.xml
SocketConnectHost=127.0.0.1
SocketConnectPort=1111
LogoutTimeout=5
ResetOnLogon=Y
ResetOnDisconnect=Y

[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=FIX.5.0
SenderCompID=TEST01
TargetCompID=MYACCEPTOR
HeartBtInt=5

FIX5.0 configuration for Acceptor: Acceptor的FIX5.0配置:

[DEFAULT]
ConnectionType=acceptor
SocketAcceptPort=1111
StartTime=00:00:00
EndTime=00:00:00
FileLogPath=log
UseDataDictionary=Y
ResetOnLogon=Y
ResetOnLogout=Y
ResetOnDisconnect=Y

[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=FIX.5.0
SenderCompID=MYACCEPTOR
TargetCompID=TEST01
FileStorePath=store
TransportDataDictionary=..\spec\FIXT11.xml
AppDataDictionary=..\spec\FIX50.xml

The data dictionary for FIX4.4 at quickfixn repository contains - Quickfixn存储库中FIX4.4的数据字典包含 -

<message name="Heartbeat" msgtype="0" msgcat="admin">
  <field name="TestReqID" required="N" />
</message>

which is the formal definition of Heartbeat message. 这是Heartbeat消息的正式定义。

This definition is missing in the FIX 5.0 data dictionary, causing the quickfix engine to consider it as a generic message. FIX 5.0数据字典中缺少此定义,导致quickfix引擎将其视为通用消息。

Adding the heartbeat message definition to the FIX 5.0 data dictionary should solve your problem. 将心跳消息定义添加到FIX 5.0数据字典应该可以解决您的问题。

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

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