如何在QuickFixJ中手动设置序列号? [英] How to set sequence numbers manually in QuickFixJ?

查看:589
本文介绍了如何在QuickFixJ中手动设置序列号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在充当接受者.有没有办法手动设置序列号?

I'm acting as an acceptor. Is there a way to set sequence numbers manually?

我的第一个想法是修改.seqnums文件,但是它不起作用.

The first idea I had, was to modify .seqnums files, but it does not work.

Google提到存在setNextSenderMsgSeqNum和setNextTargetMsgSeqNum方法,但是我不知道应该在哪个对象上调用它们(使用quickfixj 1.4).

Google mentions existence of setNextSenderMsgSeqNum and setNextTargetMsgSeqNum methods, however I can't tell on which object I should call them (using quickfixj 1.4).

我知道不建议手动设置序列号,并且有一堆类似ResetOnLogon和ResetOnDisconnect的标志,但是我无法控制启动器,还有一堆其他的接收器(测试工具)使用的是相同的会议.

I'm aware that setting sequence numbers by hand is discouraged and there are bunch of flags like ResetOnLogon and ResetOnDisconnect, but I have no control over initiator and there are bunch of other acceptors (test-tools) which are using the same session.

Application myApp = new FIXSender();
settings = new SessionSettings(sessionConfig);
MessageFactory messageFactory = new MessageFactory();
MessageStoreFactory storeFactory = new FileStoreFactory(settings);
LogFactory logFactory = new FileLogFactory(settings);
Acceptor acceptor = new SocketAcceptor(myApp, storeFactory, settings, logFactory, messageFactory);
acceptor.start();

推荐答案

首先,您需要浏览quickfixJ代码以了解其完成方式.

First of all you need to explore the quickfixJ code to see how it is done.

第二个原因是使用quickfixJ的旧版本的原因是什么?为什么不升级到最新版本.

Secondly what is the reason to use such an old version of quickfixJ ? Why not upgrade to the most recent version.

第三,如果您不正确地理解通信中如何使用序列号,应该非常警惕更改序列号.如果您不理解,肯定会遇到一些模糊的问题.

Thirdly you should be very wary of changing sequence numbers if you don't understand properly how they are used in the communication. If you don't understand you are guaranteed to get into murky problems.

您可以做类似

Session.lookupSession(sessionID).setNextSenderMsgSeqNum())

Session.lookupSession(sessionID).setNextSenderMsgSeqNum())

但是在您执行此操作之前,了解如何使用序列号非常重要

But before you do it, it is very important to understand how sequence numbers are used

这篇关于如何在QuickFixJ中手动设置序列号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆