Quantcast

bypassing config file and doing it programmatically?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bypassing config file and doing it programmatically?

falconair
Hi,
Is there  way to create initiators or acceptors without feeding them a text config file containing parameters?  I tried passing in a Map with relevant values to the SessionsSettings object, but a map obviously doesn't have a way of differentiating between various sessions.
 
Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: bypassing config file and doing it programmatically?

Ken Anderson-3
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



I do this:

   SessionSettings settings = new SessionSettings();
    settings.setString(SessionSettings.BEGINSTRING, "FIX.4.4");
    settings.setString(quickfix.DefaultSessionFactory.SETTING_CONNECTION_TYPE, quickfix.DefaultSessionFactory.INITIATOR_CONNECTION_TYPE);
    settings.setLong(quickfix.Initiator.SETTING_SOCKET_CONNECT_PORT, port.intValue());
    settings.setString(quickfix.Initiator.SETTING_SOCKET_CONNECT_HOST, host);
    settings.setString(quickfix.SessionSettings.TARGETCOMPID, "XXX");
    settings.setLong(quickfix.Session.SETTING_HEARTBTINT, 30);
    settings.setLong("ReconnectInterval", 60);
    settings.setString(quickfix.Session.SETTING_USE_DATA_DICTIONARY, "Y");
    settings.setString("FileStorePath", "examples/target/data/banzai");
    settings.setString("ResetOnLogon", "Y");
    settings.setString("DataDictionary", "Contents/Resources/FIX44.xml");

    settings.setString("StartTime", "19:30:00 US/Eastern");
    settings.setString("EndTime", "18:33:00 US/Eastern");

    quickfix.SessionID sessionID = new quickfix.SessionID(new quickfix.field.BeginString("FIX.4.4"), new quickfix.field.SenderCompID(mii.senderCompID().toString()), new quickfix.field.TargetCompID("XXX"));

    MessageStoreFactory storeFactory = new FileStoreFactory(settings);
    MessageFactory messageFactory = new DefaultMessageFactory();

    si = new SocketInitiator(qfApp, storeFactory, settings, messageFactory);

Ken

On Jul 19, 2009, at 3:39 AM, falconair wrote:

QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



Hi,
Is there  way to create initiators or acceptors without feeding them a text
config file containing parameters?  I tried passing in a Map with relevant
values to the SessionsSettings object, but a map obviously doesn't have a
way of differentiating between various sessions.

Thanks
--
View this message in context: http://n2.nabble.com/bypassing-config-file-and-doing-it-programmatically--tp3283590p3283590.html
Sent from the QuickFIX/J mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: bypassing config file and doing it programmatically?

falconair
Thanks Ken,

I had to pass in sessionID as the first parameter to all the 'set' functions, but it works very nicely.

Thanks!

Ken Anderson wrote
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



I do this:

           SessionSettings settings = new SessionSettings();
            settings.setString(SessionSettings.BEGINSTRING, "FIX.4.4");
             
settings
.setString(quickfix.DefaultSessionFactory.SETTING_CONNECTION_TYPE,  
quickfix.DefaultSessionFactory.INITIATOR_CONNECTION_TYPE);
            settings.setLong(quickfix.Initiator.SETTING_SOCKET_CONNECT_PORT,  
port.intValue());
             
settings.setString(quickfix.Initiator.SETTING_SOCKET_CONNECT_HOST,  
host);
            settings.setString(quickfix.SessionSettings.TARGETCOMPID, "XXX");
            settings.setLong(quickfix.Session.SETTING_HEARTBTINT, 30);
            settings.setLong("ReconnectInterval", 60);
            settings.setString(quickfix.Session.SETTING_USE_DATA_DICTIONARY,  
"Y");
            settings.setString("FileStorePath", "examples/target/data/banzai");
            settings.setString("ResetOnLogon", "Y");
            settings.setString("DataDictionary", "Contents/Resources/
FIX44.xml");

            settings.setString("StartTime", "19:30:00 US/Eastern");
            settings.setString("EndTime", "18:33:00 US/Eastern");

            quickfix.SessionID sessionID = new quickfix.SessionID(new  
quickfix.field.BeginString("FIX.4.4"), new  
quickfix.field.SenderCompID(mii.senderCompID().toString()), new  
quickfix.field.TargetCompID("XXX"));

            MessageStoreFactory storeFactory = new FileStoreFactory(settings);
            MessageFactory messageFactory = new DefaultMessageFactory();

            si = new SocketInitiator(qfApp, storeFactory, settings,  
messageFactory);

Ken

On Jul 19, 2009, at 3:39 AM, falconair wrote:

> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
>
>
>
> Hi,
> Is there  way to create initiators or acceptors without feeding them  
> a text
> config file containing parameters?  I tried passing in a Map with  
> relevant
> values to the SessionsSettings object, but a map obviously doesn't  
> have a
> way of differentiating between various sessions.
>
> Thanks
> --
> View this message in context: http://n2.nabble.com/bypassing-config-file-and-doing-it-programmatically--tp3283590p3283590.html
> Sent from the QuickFIX/J mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited  
> time,
> vendors submitting new applications to BlackBerry App World(TM) will  
> have
> the opportunity to enter the BlackBerry Developer Challenge. See  
> full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Quickfixj-users mailing list
> Quickfixj-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Quickfixj-users mailing list
Quickfixj-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: bypassing config file and doing it programmatically?

renangado
This post has NOT been accepted by the mailing list yet.
In reply to this post by Ken Anderson-3
hi guys im am trying to use your code to write create the Session Settings in code however i get the following error

Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774)
        at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
        at javafx.event.Event.fireEvent(Event.java:198)
        at javafx.scene.Node.fireEvent(Node.java:8413)
        at javafx.scene.control.Button.fire(Button.java:185)
        at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
        at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
        at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
        at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
        at javafx.event.Event.fireEvent(Event.java:198)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
        at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
        at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:381)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:417)
        at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:416)
        at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
        at com.sun.glass.ui.View.notifyMouse(View.java:937)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
        at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771)
        ... 48 more
Caused by: quickfix.ConfigError: no initiators in settings
        at quickfix.mina.initiator.AbstractSocketInitiator.createSessions(AbstractSocketInitiator.java:202)
        at quickfix.mina.initiator.AbstractSocketInitiator.createSessionInitiators(AbstractSocketInitiator.java:83)
        at quickfix.SocketInitiator.initialize(SocketInitiator.java:114)
        at quickfix.SocketInitiator.start(SocketInitiator.java:89)
        at controller.Controller.connectButtonAction(Controller.java:162)
        ... 58 more

could anyone please help
Loading...