简体   繁体   English

Quickfixn Fix 4.2如何在同一会话中向不同的TargetCompID发送和接收消息

[英]Quickfixn Fix 4.2 How to Send & Receive messages to different TargetCompID in same session

How to send & receive Fix messages to different TargetCompID in same session 如何在同一会话中向不同的TargetCompID发送和接收Fix消息

public void ToAdmin(Message message, SessionID sessionID)
{
if ( (message.ToString().IndexOf("35=D") > 0) || (message.ToString().IndexOf("35=G") > 0) || (message.ToString().IndexOf("35=F") > 0))
{            message.Header.SetField(new TargetCompID("1"));
}
}

9:56:38 ToApp: 8=FIX.4.2 9=261 35=D 34=63 49=555 50=BBBBBB 52=20180918-06:56:38 56=0 128=1 129=AAAAAA 1=555-----126 11=1 21=1 22=4 38=2500 40=2 44=0.03 47=C 48=JO3109211016 54=2 55=JO3109211016 58=Testing Fix Connec 59=1 60=20180918-09:56:38.579 109=126 110=50 111=100 9596=2 9947=55500350 10=140 9:56:38 Exchange: 8=FIX.4.2 9=115 35=3 34=73 49=0 50=AAAAAA 52=20180918-09:56:38 56=555 45=63 58=cannot process order: TargetCompID is invalid 372=D 10=067 9:56:38 ToApp:8 =FIX.4.2 9=261 35=D 34=63 49=555 50=BBBBBB 52= 20180918-06:56:38 56=0 128= 1 129 = AAAAAA1 = 555 ----- 12611 = 121 = 122 = 438 = 250040 = 244 = 0.0347 = C48 = JO310921101654 = 2 55=JO3109211016 58= Testing FixConnec 59=1 60= 20180918-09:56:38.579 109=126 110=50 111=100 9596=2 9947=55500350 10=140 9 :56:38交换:8 =FIX.4.2 9=115 35=3 34=73 49=0 50=AAAAAA 52= 20180918-09:56:38 56=555 45= 63。 58 =无法处理订单:TargetCompID无效.372 =D 10= 067。

TargetCompID is a part of Session's identifier, see http://quickfixn.org/tutorial/configuration.html : TargetCompID是会话标识符的一部分,请参阅http://quickfixn.org/tutorial/configuration.html

A FIX session is defined in QuickFix/N as a unique combination of a BeginString (the FIX version number), a SenderCompID (your ID), and a TargetCompID (the ID of your counterparty). FIX会话在QuickFix / N中定义为BeginString(FIX版本号),SenderCompID(您的ID)和TargetCompID(对方的ID)的唯一组合。

So it seems incorrect to try to send messages to different TargetCompID within the same session; 因此,尝试在同一会话中将消息发送到不同的TargetCompID似乎是不正确的。 you need to create a separate session for each TargetCompID . 您需要为每个TargetCompID创建一个单独的会话。

Simplest is defining sessions in configuration file (see the link above); 最简单的方法是在配置文件中定义会话(请参见上面的链接); alternatively you can create them dynamically - see http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/2016q1/000277.html 或者,您也可以动态创建它们-请参阅http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/2016q1/000277.html

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

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