简体   繁体   English

如何在 QuickFix/J 中测试连接

[英]How to test the connection in QuickFix/J

I wrote an QuickFix program and created a config file.. Now, when I'm running my application, nothing happens.. So I ask me, how I can recognize if the connection (my program is of type initiator) is established or not.我编写了一个 QuickFix 程序并创建了一个配置文件。现在,当我运行我的应用程序时,什么也没有发生。所以我问我,我如何识别连接(我的程序是启动器类型)是否已建立.

I've added to the methods that I implement from the Application interface我已添加到从Application接口实现的方法中

void fromAdmin(Message message, SessionID sessionId)
void fromApp(Message message, SessionID sessionId)
void onCreate(SessionID sessionId)
void onLogon(SessionID sessionId)
void onLogout(SessionID sessionId)
void toAdmin(Message message, SessionID sessionId)
void toApp(Message message, SessionID sessionId)

a System.out and a logger.info, but nothing of them fires something.一个 System.out 和一个 logger.info,但它们都没有触发任何东西。

If a connection established, the methods onCreate and onLogon are invoked, or?.如果建立了连接,则调用 onCreate 和 onLogon 方法,或者? So the System.outs in these methods should write something..所以这些方法中的 System.outs 应该写一些东西..

But are there any other opportunitys to check wheter the connection established, respectively the config file is valid.但是有没有其他机会检查连接是否建立,配置文件是否有效。

PS: I use the SessionSettings to read the config File in.. But I can't find a method in the SessionSettings like validateConfigFile() or something like that. PS:我使用SessionSettings来读取配置文件。但是我在 SessionSettings 中找不到像 validateConfigFile() 或类似的方法。

Maybe you can help me with my problem.也许你可以帮我解决我的问题。

Thank you for your help!!!谢谢您的帮助!!!

Has your config file got 有你的配置文件

FileLogPath=log FileLogPath = log

?

Then to debug you look at the FIX messages log, usually in the bin/debug/log directory, which is where it would be for the above config file. 然后进行调试,请查看FIX消息日志,通常在bin / debug / log目录中,该目录就是上面的配置文件所在的目录。 If it's not a security risk then paste your config file here please. 如果不是安全隐患,请在此处粘贴您的配置文件。 Also, yes add the System.Out to your Application interface. 另外,是的,将System.Out添加到您的应用程序界面。 Here's mine: 这是我的:

public void FromApp(Message msg, SessionID s)
    {
        Console.WriteLine("IN: " + msg.ToString());

You can download Banzai application which is an accpetor/iniciator with grafic interface.您可以下载Banzai 应用程序,它是一个带有图形界面的启动器/启动器。 You can iniciate a session, and send/receive messages from your app.您可以启动 session,并从您的应用程序发送/接收消息。 enter image description here在此处输入图像描述

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

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