Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Dynamic Acceptor Sessions in QuickFIX/J #135

Open
ChildrenGreens opened this issue Aug 8, 2024 · 4 comments
Open

Support for Dynamic Acceptor Sessions in QuickFIX/J #135

ChildrenGreens opened this issue Aug 8, 2024 · 4 comments

Comments

@ChildrenGreens
Copy link

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.

@esanchezros
Copy link
Owner

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

@ChildrenGreens
Copy link
Author

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

@esanchezros
Copy link
Owner

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

@ChildrenGreens
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants