Closed alepekhin closed 4 years ago
Hi alepekhin,
In your service class you can autowire the Initiator
and then create, add or remove dynamically a session:
@Autowired
private Initiator clientInitiator;
...
clientInitiator.addDynamicSession(session);
clientInitiator.createDynamicSession(session);
clientInitiator.removeDynamicSession(session);
Thank you for a hint. I have tried it, but probably I don't quite understand the topic or may be addDynamicSession() is not fully implemented, so I got the errors like "Responder not set"... After all I have ended with creating separate initiators for every session, like
ThreadedSocketInitiator priceSocketInitiator = new ThreadedSocketInitiator(application, storeFactory, settings, logFactory, new DefaultMessageFactory());
priceSocketInitiator.start();
ThreadedSocketInitiator tradeSocketInitiator = new ThreadedSocketInitiator(application, storeFactory, settings, logFactory, new DefaultMessageFactory());
tradeSocketInitiator.start();
In this way it works
Hi alepekhin,
I found this link that maybe useful https://www.quickfixj.org/usermanual/2.1.0/usage/acceptor_dynamic.html
Registration of a dynamic session provider:
acceptor.setSessionProvider(socketAddress, new DynamicAcceptorSessionProvider( settings, templateSessionID, application, messageStoreFactory, logFactory, messageFactory));
If you could share your code I will have a look and try make it work the way you originally intended.
I have also seen this link. It's not very clear, it's about acceptor and does not include username/password as I seen in DynamicAcceptorSessionProvider
class. I did not find DynamicInitiatorSessionProvider
also. So I will stay with my solution. Anyway clientQuickFixJTemplate
works, listeners work too - it's enough for me. Thank you once more for your project. I have added a star to it :)
Perhaps the server needs to be configured with the DynamicAcceptorSessionProvider
and the clientInitiator
is the one requesting the sessions to be added dynamically.
It's not an issue, it is a question. Everything works fine, thank you for publishing this project! The question is how to add sessions dynamically in initiator bypassing configuration file? Suppose we work with a single FIX server where users can be registered/unregistered so we can not place their sessions into config file because we simply don't know their names.