[QFJ-993] AbstractSocketAcceptor attempts to create SocketDescriptor for template session Created: 15/Apr/20 Updated: 19/Jun/20 Resolved: 19/Jun/20 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | Engine |
Affects Version/s: | 2.1.1 |
Fix Version/s: | None |
Type: | Bug | Priority: | Default |
Reporter: | abeel | Assignee: | Unassigned |
Resolution: | Not a bug | Votes: | 0 |
Labels: | QuickfixJ |
Description |
configuration: quickfix.properties [SESSION] Code: public synchronized void start() { try { final SLF4JLogFactory logger = new SLF4JLogFactory(this.sessionSettings); this.acceptor = new SocketAcceptor(this.application, this.messageStoreFactory, this.sessionSettings, logger, this.msgFactory); this.acceptor.setSessionProvider(new InetSocketAddress("0.0.0.0", 50000), new DynamicAcceptorSessionProvider( this.sessionSettings, new SessionID("FIX.4.4", "SENDCOMPID", "TARGETCOMPID"), this.application, this.messageStoreFactory, logger, this.msgFactory)); this.acceptor.start(); } catch (ConfigError ex) { log.error("Failed to start QuickFIX-J socket acceptor.", ex); this.acceptor = null; } } Throws:
Issue seems to be with this code quickfix.mina.acceptor.AbstractSocketAcceptor private void createSessions(SessionSettings settings) throws ConfigError, FieldConvertError { HashMap<SessionID, Session> allSessions = new HashMap<>(); for (Iterator<SessionID> i = settings.sectionIterator(); i.hasNext();) { SessionID sessionID = i.next(); String connectionType = settings.getString(sessionID, SessionFactory.SETTING_CONNECTION_TYPE); boolean isTemplate = false; if (settings.isSetting(sessionID, Acceptor.SETTING_ACCEPTOR_TEMPLATE)) { isTemplate = settings.getBool(sessionID, Acceptor.SETTING_ACCEPTOR_TEMPLATE); } if (connectionType.equals(SessionFactory.ACCEPTOR_CONNECTION_TYPE)) { AcceptorSocketDescriptor descriptor = getAcceptorSocketDescriptor(settings, sessionID); if (!isTemplate) { Session session = sessionFactory.create(sessionID, settings); descriptor.acceptSession(session); allSessions.put(sessionID, session); } } } setSessions(allSessions); if (socketDescriptorForAddress.isEmpty()) { throw new ConfigError("No acceptor sessions found in settings."); } } // attempts to create descriptor for a session template
|
Comments |
Comment by Christoph John [ 19/Jun/20 ] |
Hmm, could you please elaborate where you see the problem? IMHO even dynamic sessions need a SocketAcceptPort to know on which port sessions should get accepted. The address that you assign to a session provider is just to do a lookup for a specific address when a connection comes in. It does not mean that you do not need to specify a SockketAcceptPort. What is the problem of specifying that port in your config? I am closing this for now. Feel free to reopen if you think there still is a problem. |