Skip to main content

Dynamic Acceptor Session Definition

Sometimes an application needs more flexibility than a static configuration provides. For example, test programs, simulators, or SaaS gateways may not want to pre-define every single session.

Dynamic sessions are implemented using a session provider. A simple session provider implementation, DynamicAcceptorSessionProvider, is available for these scenarios. This provider specifies a session ID for a session definition that will be used as a template for setting session options. The session template in the configuration file should be marked with the AcceptorTemplate=Y setting so the session will not be registered as a normal static session.

You programmatically associate a specific acceptor socket address with a session provider instance. A dynamic session will be created for any logon attempt on this socket address if a session has not already been defined. This allows a mixture of static session definitions and dynamic session definitions on the same acceptor socket.

Registration of a Dynamic Session Provider

acceptor.setSessionProvider(socketAddress, new DynamicAcceptorSessionProvider(
settings, templateSessionID, application, messageStoreFactory, logFactory,
messageFactory));

Example Acceptor Configuration for Dynamic Sessions

[DEFAULT]
FileStorePath=target/data/executor
ConnectionType=acceptor
SocketAcceptPort=9876
StartTime=00:00:00
EndTime=00:00:00
HeartBtInt=30
ValidOrderTypes=1,2,F
SenderCompID=*
TargetCompID=*
UseDataDictionary=Y
DefaultMarketPrice=15

[SESSION]
AcceptorTemplate=Y
DataDictionary=FIX40.xml
BeginString=FIX.4.0