quickfixj-spring-boot-starter icon indicating copy to clipboard operation
quickfixj-spring-boot-starter copied to clipboard

Support for Dynamic Acceptor Sessions in QuickFIX/J

Open ChildrenGreens opened this issue 1 year ago • 4 comments

I would like to request support for dynamic acceptor sessions in the quickfixj-spring-boot-starter framework. The dynamic acceptor feature in QuickFIX/J allows the program to handle sessions flexibly without predefined configurations for each session, using DynamicAcceptorSessionProvider.

For more details, you can refer to the QuickFIX/J user manual: Dynamic Acceptor Sessions.

ChildrenGreens avatar Aug 08 '24 03:08 ChildrenGreens

Hi @ChildrenGreens,

Thanks for using the library. There is an example on how to use dynamic sessions here https://github.com/esanchezros/quickfixj-spring-boot-starter-examples/tree/master/simple-server-dynamic-sessions

Are you referring to doing this but using auto configuration?

Thanks

esanchezros avatar Aug 08 '24 16:08 esanchezros

@esanchezros Yes, is it possible to control whether to enable Dynamic Acceptor Sessions by using the properties attribute combined with auto configuration?

ChildrenGreens avatar Aug 09 '24 01:08 ChildrenGreens

Not right using properties but you can override the Acceptor bean

        @Bean
        public Acceptor serverAcceptor(quickfix.Application serverApplication, MessageStoreFactory serverMessageStoreFactory,
                                       SessionSettings serverSessionSettings, LogFactory serverLogFactory,
                                       MessageFactory serverMessageFactory) throws ConfigError {

                ThreadedSocketAcceptor threadedSocketAcceptor = new ThreadedSocketAcceptor(serverApplication, serverMessageStoreFactory, serverSessionSettings,
                                serverLogFactory, serverMessageFactory);

                final SessionID anySession = new SessionID(BEGINSTRING_FIX40, WILDCARD, WILDCARD);
                serverSessionSettings.setBool(anySession, SETTING_ACCEPTOR_TEMPLATE, true);
                serverSessionSettings.setString(anySession, BEGINSTRING, BEGINSTRING_FIX44);
                threadedSocketAcceptor.setSessionProvider(
                                new InetSocketAddress("0.0.0.0", 9876),
                                new DynamicAcceptorSessionProvider(serverSessionSettings, anySession, serverApplication, serverMessageStoreFactory,
                                                serverLogFactory, serverMessageFactory)
                );
                return threadedSocketAcceptor;
        }

I think this could be a nice feature in the qfj spring boot starter, I'll try adding it soon

esanchezros avatar Aug 10 '24 16:08 esanchezros

@esanchezros I am currently using the override Acceptor bean. I would greatly appreciate it if you could add this feature to the QFJ Spring Boot Starter.

ChildrenGreens avatar Aug 12 '24 01:08 ChildrenGreens