[QFJ-674] acceptor.getSessions() returning empty ArrayList Created: 25/Apr/12  Updated: 02/Aug/12  Resolved: 02/Aug/12

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.5.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Dan Marques Assignee: Unassigned
Resolution: Not a bug Votes: 0
Labels: None
Environment:

Java 7, Windows 7 - x64



 Description   

In QFJ 1.5.2 acceptor.getSessions() is returning an empty array list when previous version (at least 1.4.0, but I'm pretty sure this was working in 1.5.1 as well) are returning non-empty lists.

For example, the following little code segment (as part of an application)

Acceptor acceptor = null;
String configFileName = null;
try

{ configFileName = args[0]; final SessionSettings sessionSettings = new SessionSettings(new FileInputStream(configFileName)); final MessageStoreFactory storeFactory = new FileStoreFactory(sessionSettings); final LogFactory logFactory = new FileLogFactory(sessionSettings); final MessageFactory messageFactory = new DefaultMessageFactory(); acceptor = new SocketAcceptor(app, storeFactory, sessionSettings, logFactory, messageFactory); log.info("version " + org.quickfixj.Version.getVersion() + ", size " + acceptor.getSessions().size()); }

given the same config file (describing two acceptor sessions), produces different output with 1.5.2 than with 1.4.0

DropCopy 20:06:55,087 INFO [main] (DropCopy.java:285) - version Version: 1.5.2, size 0
DropCopy 20:07:39,103 INFO [main] (DropCopy.java:285) - version Version: 1.4.0, size 2



 Comments   
Comment by Christoph John [ 25/Apr/12 ]

The call to createSessions() has been moved into the method startAcceptingConnections() of the AbstractSocketAcceptor to ensure that the acceptor can be restarted after a call to stop() (QFJ-643).

I.e. after call to SocketAcceptor.start() you should be able to get the sessions.

Generated at Sat Nov 23 10:43:21 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.