Thread: [Quickfix-developers] Just Starting...
Brought to you by:
orenmnero
From: azmat <mr...@gm...> - 2008-01-14 19:57:32
|
Hello everyone... I've been reading through the FIX Spec (4.2) as well as the quickfix documentation. I'm able to create sessions, send logon messages, get feedback from the server, etc. Now I want to create a message and send it over to the Acceptor, and hopefully receive something from the Server. This is where I am 'stuck'. How do I handle all of the possible return messages from the Acceptor in my code? Do I have to create case statements in case of each type of message that might get returned from the Acceptor (broker)? Another question/concern I have now is what happens when a packet/message gets "dropped" between me (initiator) and the broker (acceptor)? I know there are a number of resend requests that get passed back and forth, but what actually happens? Does quickfix have some sort of internal data structure that has all of the messages that were sent but not yet ACKd? Or is this something I need to implement on my OMS? I would also be interested in finding some sort of documentation regarding the data flow of objects using the quickfix engine or maybe an entity relationship diagram of the objects....anything like this would be much appreciated! I've read several posts of people trying to learn FIX/quickfix over the years and now that's my turn I'm hoping some of those people can come back and help explain some of the things they learned along the way! thanks! Azmat -- View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p14811784.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: azmat <mr...@gm...> - 2008-01-16 18:41:13
|
All- In my efforts to learn and use QF at my firm, I plan to share my journey with everyone here -- well mostly for the future newcomers who will need a place to start. Yesterday I downloaded the source code ( quickfix-1.12.4.zip) and built the solution for VS2005, and followed the Installation instructions (http://www.quickfixengine.org/quickfix/doc/html/index.html). I can now view all of the class files in C++ and C#, but am unsure where to go from here. I tried running some of the examples (ordermatch, tradeclient, etc), but that doesn't seem to work. I would like to create a QFServer and a QFClient on my machine to simulate orders/transactions between the two projects -- but not before these samples get working. Any suggestions? with regards, azmat azmat wrote: > > Hello everyone... > > I've been reading through the FIX Spec (4.2) as well as the quickfix > documentation. I'm able to create sessions, send logon messages, get > feedback from the server, etc. > > Now I want to create a message and send it over to the Acceptor, and > hopefully receive something from the Server. This is where I am 'stuck'. > How do I handle all of the possible return messages from the Acceptor in > my code? Do I have to create case statements in case of each type of > message that might get returned from the Acceptor (broker)? > > Another question/concern I have now is what happens when a packet/message > gets "dropped" between me (initiator) and the broker (acceptor)? I know > there are a number of resend requests that get passed back and forth, but > what actually happens? Does quickfix have some sort of internal data > structure that has all of the messages that were sent but not yet ACKd? > Or is this something I need to implement on my OMS? > > I would also be interested in finding some sort of documentation regarding > the data flow of objects using the quickfix engine or maybe an entity > relationship diagram of the objects....anything like this would be much > appreciated! > > I've read several posts of people trying to learn FIX/quickfix over the > years and now that's my turn I'm hoping some of those people can come back > and help explain some of the things they learned along the way! > > > > thanks! > Azmat > -- View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p14888248.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: McAndrew, P. <pa...@no...> - 2008-01-16 21:17:23
|
You should start with the executor project. Review the code, set up a = config file with your connections and see if you can connect. You can = go to the Open Fix testing website to see if you can connect and = practice sending different types of orders. Below is my config file = code: =20 [DEFAULT] ConnectionType=3Dinitiator ReconnectInterval=3D30 FileStorePath=3DC:\QuickFix\Log FileLogPath=3DC:\QuickFix\Log [SESSION] BeginString=3DFIX.4.2 TargetCompID=3DTarget HeartBtInt=3D45 LogonTimeout=3D60 SenderCompID=3DSender SocketConnectPort=3D1234 SocketConnectHost=3D198.63.227.24 StartTime=3D00:00:00 EndTime=3D23:59:00 DataDictionary=3DC:\\quickfix\spec\FIX42.xml CheckLatency=3DN ResetOnLogout=3DN ResetOnDisconnect=3DN SendResetSeqNumFlag=3DY RefreshOnLogon=3DY =20 [SESSION] BeginString=3DFIX.4.2 TargetCompID=3DTarget1 HeartBtInt=3D45 LogonTimeout=3D60 SenderCompID=3DSender SocketConnectPort=3D1234 SocketConnectHost=3D66.150.110.105 StartDay=3Dsun StartTime=3D00:01:00 EndDay=3Dsat EndTime=3D23:59:00 DataDictionary=3DC:\quickfix\spec\FIX42.xml ValidateUserDefinedFields=3DN ValidateFieldsHaveValues=3DN=20 CheckLatency=3DN ResetOnLogout=3DN ResetOnDisconnect=3DN SendResetSeqNumFlag=3DY RefreshOnLogon=3DY =20 [SESSION] BeginString=3DFIX.4.2 TargetCompID=3DTarget2 HeartBtInt=3D45 LogonTimeout=3D60 SenderCompID=3DSender SocketConnectPort=3D1234 SocketConnectHost=3D66.150.110.105 StartDay=3Dsun StartTime=3D00:01:00 EndDay=3Dsat EndTime=3D23:59:00 DataDictionary=3DC:\quickfix\spec\FIX42.xml ValidateUserDefinedFields=3DN ValidateFieldsHaveValues=3DN=20 CheckLatency=3DN ResetOnLogout=3DN ResetOnDisconnect=3DN SendResetSeqNumFlag=3DY RefreshOnLogon=3DY =20 Here is the code for the executor login to begin heartbeating with the = connection you set up. This is the debug version so it's called from a = form. The live version runs as a service: =20 public void Login() { try { int index =3D new int(); index =3D 1; =20 if (!System.Diagnostics.EventLog.SourceExists("NewSource"))=20 {=20 System.Diagnostics.EventLog.CreateEventSource( "NewSource","EC_Log"); } else { //mEC_Log.Clear(); } mEC_Log.Source =3D "NewSource"; mEC_Log.Log =3D "EC_Log"; mEC_Log.Clear(); mEC_Log.WriteEntry("ElectronicClerk"); ElectronicClerk ec =3D new ElectronicClerk(); //System.Threading.AutoResetEvent autoEvent =3D new = System.Threading.AutoResetEvent(false); // Create a timer that signals the delegate to invoke=20 // ProcessOrders after one second, and every 1/4 second=20 // thereafter. TimerCallback timerDelegate =3D=20 new TimerCallback(ProcessOrders); // create timer and attach our method delegate to it mtmEC =3D=20 new Timer(timerDelegate, null, 1000, 250); =20 string path =3D System.IO.Path.GetDirectoryName(=20 System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase ); path =3D path.Substring(6, path.Length - 6); System.Diagnostics.Debug.WriteLine(path); SessionSettings settings =3D new SessionSettings(path.ToString() + = "\\QuickFix_Test_ALL.cfg"); FIX_ElectronicClerk.Application application =3D new = FIX_ElectronicClerk.Application(); FileStoreFactory factory =3D new FileStoreFactory(settings); FileLogFactory logFactory =3D new FileLogFactory(settings); System.Diagnostics.Debug.WriteLine(settings); MessageFactory messageFactory =3D new DefaultMessageFactory(); m_initiator =3D new SocketInitiator(application, factory, settings, = logFactory, messageFactory); //try //{ //Conn.ConnectionString=3D settings.ToString(); m_initiator.start(); // Write an informational entry to the event log.=20 //} } catch (Exception e) { mEC_Log.WriteEntry(e.ToString()); mtmEC.Dispose(); } } =20 =20 =20 =20 ________________________________ From: qui...@li... on behalf of = azmat Sent: Wed 1/16/2008 12:40 PM To: qui...@li... Subject: Re: [Quickfix-developers] Just Starting... QuickFIX Documentation: = http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html All- In my efforts to learn and use QF at my firm, I plan to share my journey with everyone here -- well mostly for the future newcomers who will need = a place to start. Yesterday I downloaded the source code ( quickfix-1.12.4.zip) and built the solution for VS2005, and followed the Installation instructions (http://www.quickfixengine.org/quickfix/doc/html/index.html).=20 I can now view all of the class files in C++ and C#, but am unsure where = to go from here. I tried running some of the examples (ordermatch, tradeclient, etc), but that doesn't seem to work. I would like to = create a QFServer and a QFClient on my machine to simulate orders/transactions between the two projects -- but not before these samples get working. = Any suggestions? with regards, azmat azmat wrote: > > Hello everyone... > > I've been reading through the FIX Spec (4.2) as well as the quickfix > documentation. I'm able to create sessions, send logon messages, get > feedback from the server, etc.=20 > > Now I want to create a message and send it over to the Acceptor, and > hopefully receive something from the Server. This is where I am = 'stuck'. > How do I handle all of the possible return messages from the Acceptor = in > my code? Do I have to create case statements in case of each type of > message that might get returned from the Acceptor (broker)? > > Another question/concern I have now is what happens when a = packet/message > gets "dropped" between me (initiator) and the broker (acceptor)? I = know > there are a number of resend requests that get passed back and forth, = but > what actually happens? Does quickfix have some sort of internal data > structure that has all of the messages that were sent but not yet = ACKd? > Or is this something I need to implement on my OMS? > > I would also be interested in finding some sort of documentation = regarding > the data flow of objects using the quickfix engine or maybe an entity > relationship diagram of the objects....anything like this would be = much > appreciated! > > I've read several posts of people trying to learn FIX/quickfix over = the > years and now that's my turn I'm hoping some of those people can come = back > and help explain some of the things they learned along the way! > > > > thanks! > Azmat > -- Sent from the QuickFIX - Dev mailing list archive at Nabble.com. -------------------------------------------------------------------------= This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers |
From: azmat <mr...@gm...> - 2008-01-16 21:38:38
|
Paige- Thank you for replying! I will take a look at the executor project and go from there. I know I will not be using QF as a server, at my firm. We are using it simply to connect to one brokerage house that handles our orders. I need to write a front end that allows us to enter orders and then send them to our brokerage partner that will be receiving the FIX message. The hardest part of doing any of this is, the complete lack of any substantial code snippets that show how I can interact completely with the QF engine. I'm hoping this thread can change that ;-) many thanks, azmat Paige wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > You should start with the executor project. Review the code, set up a > config file with your connections and see if you can connect. You can go > to the Open Fix testing website to see if you can connect and practice > sending different types of orders. > -- View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p14895700.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: Patrick W. <pw...@ka...> - 2008-01-16 23:03:08
|
You need to call the crack method. In this example I create an AdapterTradeResult class which encapsulates the response in a way which is sensible for my systems (sorry about formatting).=20 My Application-Derived class (not included here) calls this adapter whenever it receives a message. =09 public class QuickFixAdapter : MessageCracker { ..... public virtual void fromAdmin(Message message_, SessionID session_) { crack(message_, session_); } public virtual void fromApp(Message message_, SessionID session_) { crack(message_, session_); } =20 public override void onMessage(QuickFix42.ExecutionReport message_, SessionID session) { OrdType ordType =3D message_.getOrdType(); SecurityType secType =3D message_.getSecurityType(); ClOrdID orderId =3D message_.getClOrdID(); OrderID tradeId =3D message_.getOrderID(); ExecTransType transType =3D message_.getExecTransType(); ExecType type =3D message_.getExecType(); OrdRejReason reason =3D new OrdRejReason(); Text text =3D new Text(); if (message_.isSetOrdRejReason()) { reason =3D message_.getOrdRejReason(); } if (message_.isSetText()) { text =3D message_.getText(); } Symbol symbol =3D message_.getSymbol(); Currency currency =3D message_.getCurrency(); Side side =3D message_.getSide(); Price price =3D new Price(); if (message_.isSetPrice()) { price =3D message_.getPrice(); } OrderQty qty =3D new OrderQty(); if (message_.isSetOrderQty()) { qty =3D message_.getOrderQty(); } TransactTime transactTime =3D new TransactTime(); if (message_.isSetTransactTime()) { transactTime =3D message_.getTransactTime(); } char execType =3D type.getValue(); switch (execType) { case Configuration.Constants.EXEC_TYPE_FILLED: { =20 AdapterTradeResult tr =3D new AdapterTradeResult(); tr.AdapterType =3D _type; tr.Status =3D = eOrderAutoTradeResultStatus.Success; tr.Quantity =3D (int)qty.getValue(); tr.Price =3D price.getValue(); tr.Direction =3D side.getValue() =3D=3D Configuration.Constants.SIDE_BUY ? eOrderDirection.Buy : eOrderDirection.Sell; tr.TradeTime =3D transactTime.getValue(); tr.ExecutionOrderId =3D eeOrder.EEOrderId; tr.FillId =3D tradeId.getValue(); } break; case Configuration.Constants.EXEC_TYPE_REJECTED: { =20 string rejectionReason =3D "Rejection code: " + Convert.ToInt32(reason.getValue()); rejectionReason +=3D " description: " + text.getValue(); AdapterTradeResult tr =3D new AdapterTradeResult(); tr.AdapterType =3D _type; tr.Status =3D eOrderAutoTradeResultStatus.Rejected; tr.Description =3D rejectionReason; tr.TradeTime =3D transactTime.getValue(); } break; } //now I send the AdapterTradeResult message to downstream systems for processing ...... } } Good luck. Patrick -----Original Message----- From: qui...@li... [mailto:qui...@li...] On Behalf Of azmat Sent: Thursday, 17 January 2008 9:23 AM To: qui...@li... Subject: Re: [Quickfix-developers] Just Starting... QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html I went through the executor project (http://www.quickfixengine.org/quickfix/doc/html/csharp/application_2.ht ml)=20 but I can't see how this is beneficial to me. =20 I have this in my code write now: ThreadedSocketInitiator _initiator =3D null; public void Start() { if (_initiator !=3D null) throw new Exception("Already Started"); SessionSettings settings =3D new SessionSettings("FixSettings.txt"); Application application =3D new QFWrapper(this); FileStoreFactory storeFactory =3D new FileStoreFactory(settings); FileLogFactory logFactory =3D new FileLogFactory(settings); MessageFactory messageFactory =3D new = DefaultMessageFactory(); _initiator =3D new ThreadedSocketInitiator(application, storeFactory, settings, logFactory, messageFactory); _initiator.start(); } I have a qfwrapper class that is a nested class inside of a FixServer class.=20 QFWrapper inherits from MessageCracker and implements the QF Interface methods. The FIXServer class is the class that contains the start, stop and all the delegates I will need in order to function with a windows form. I can now communicate with our brokerage company, but the problem is in dissecting the messages that come back from the FIX Server. How do I (or where do I) take the message apart to realize what type of message it is...so I can then write all the various handling methods for the many different types of messages that we might expect from the Server. I imagine I will need to capture the message (in order to dissect it and run my own business logic) in the fromApp function. But I have no idea how to do any of the FIX Message 'surgery', so to speak.=20 Can someone help shed some light on this? thanks! Azmat Paige wrote: >=20 > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html >=20 > You should start with the executor project. Review the code, set up a > config file with your connections and see if you can connect. You can go > to the Open Fix testing website to see if you can connect and practice > sending different types of orders. Below is my config file code: >=20 >=20 --=20 View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p14896451.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. ------------------------------------------------------------------------ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers |
From: azmat <mr...@gm...> - 2008-01-17 20:34:10
|
Patrick, Thanks! This is perfect. I have something very similar now. I understand that I should call the crack method in the fromApp method so that the MessageCracker can identify exactly what type of message it is. That is really neat. But, what I do not get is how or when is the onMessage method is called (the one that takes the ExecutionReport parameter)? Is this something that automagically happens with the crack method if it determines the message is of type ExecutionReport? Also on the flipside of it. If I call sendToTarget from my business layer will it automatically go to the Application.toApp method OR do I need to somehow call toApp and then call sendToTarget from there? Any help would be much, much appreciated! thanks! Azmat Patrick Wright-3 wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > You need to call the crack method. > In this example I create an AdapterTradeResult class which encapsulates > the response in a way which is sensible for my systems (sorry about > formatting). > My Application-Derived class (not included here) calls this adapter > whenever it receives a message. > -- View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p14932270.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: Patrick W. <pw...@ka...> - 2008-01-17 21:12:04
|
Yes that is right. When you call sendtoTarget the toApp callback should be called by the fix engine to allow you to do some processing before the message is sent (log it for example). Also you can throw a DoNotSend exception here to stop the message from being sent. toApp will also be called when the engine responds to a resend request. I have only been using this for a few months - other people may have a better insight into this. Patrick -----Original Message----- From: qui...@li... [mailto:qui...@li...] On Behalf Of azmat Sent: Friday, 18 January 2008 7:56 AM To: qui...@li... Subject: Re: [Quickfix-developers] Just Starting... QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html Actually, I figured out the first part. =20 fromApp, call crack...crack distinguishes what type of message it is and calls the appropiate OnMessage that is overridden from MessageCracker...if onMessage for the specific message type is NOT implemented, than an UnsupportedMessageType exception is thrown. =20 So in the onMessage (execution report) I would write the business related code for what I need to do for when/if an executionReport is a type of message that is received, correct? =20 My confusion now lies with sending messages with sendToTarget and its relation to toApp? Should I call sendToTarget from toApp or will it somehow (again) magically end up in toApp? =20 thanks! Azmat Patrick, Thanks! This is perfect. I have something very similar now. I understand that I should call the crack method in the fromApp method so that the MessageCracker can identify exactly what type of message it is. That is really neat. But, what I do not get is how or when is the onMessage method is called (the one that takes the ExecutionReport parameter)? Is this something that automagically happens with the crack method if it determines the message is of type ExecutionReport? Also on the flipside of it. If I call sendToTarget from my business layer will it automatically go to the Application.toApp method OR do I need to somehow call toApp and then call sendToTarget from there? Any help would be much, much appreciated! thanks! Azmat --=20 View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p14933076.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. ------------------------------------------------------------------------ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers |
From: azmat <mr...@gm...> - 2008-01-17 22:16:36
|
All, How are "lost" messages handled? Let's say a message is never received by the brokerage firm, and they request a resend. Will I have to handle the request resend message (in fromApp/onMessage)? Or will QuickFix automagically resend the "lost" message? Are the gapfill procedures specified in the FIX Spec, implemented by QF, or is this the responsibility of the implementor (read: my poor soul). thank you! azmat Patrick Wright-3 wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Yes that is right. > > When you call sendtoTarget the toApp callback should be called by the > fix engine to allow you to do some processing before the message is sent > (log it for example). Also you can throw a DoNotSend exception here to > stop the message from being sent. toApp will also be called when the > engine responds to a resend request. > > I have only been using this for a few months - other people may have a > better insight into this. > > Patrick > > -- View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p14935932.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: azmat <mr...@gm...> - 2008-03-13 21:40:29
|
All- I need to check if the possdup flag is set, when I receive an execution report from the counter-party. I've also read many places that I should "throw a donotsend exception" in ToApp after I check for the PossDup flag. Something similar to this, written by Caleb: http://www.nabble.com/Request-resend-ts3856953.html#a3881695 For some reason I can't get this to work with C#. I'm having issues 'translating' the C++ to C#, using QuickFix 1.2.4. This is quite frusturating. Has anyone done this in C#? thanks! azmat Patrick Wright-3 wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Yes that is right. > > When you call sendtoTarget the toApp callback should be called by the > fix engine to allow you to do some processing before the message is sent > (log it for example). Also you can throw a DoNotSend exception here to > stop the message from being sent. toApp will also be called when the > engine responds to a resend request. > > I have only been using this for a few months - other people may have a > better insight into this. > > Patrick > > -- View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p16039185.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: azmat <mr...@gm...> - 2008-01-16 22:22:57
|
I went through the executor project (http://www.quickfixengine.org/quickfix/doc/html/csharp/application_2.html) but I can't see how this is beneficial to me. I have this in my code write now: ThreadedSocketInitiator _initiator = null; public void Start() { if (_initiator != null) throw new Exception("Already Started"); SessionSettings settings = new SessionSettings("FixSettings.txt"); Application application = new QFWrapper(this); FileStoreFactory storeFactory = new FileStoreFactory(settings); FileLogFactory logFactory = new FileLogFactory(settings); MessageFactory messageFactory = new DefaultMessageFactory(); _initiator = new ThreadedSocketInitiator(application, storeFactory, settings, logFactory, messageFactory); _initiator.start(); } I have a qfwrapper class that is a nested class inside of a FixServer class. QFWrapper inherits from MessageCracker and implements the QF Interface methods. The FIXServer class is the class that contains the start, stop and all the delegates I will need in order to function with a windows form. I can now communicate with our brokerage company, but the problem is in dissecting the messages that come back from the FIX Server. How do I (or where do I) take the message apart to realize what type of message it is...so I can then write all the various handling methods for the many different types of messages that we might expect from the Server. I imagine I will need to capture the message (in order to dissect it and run my own business logic) in the fromApp function. But I have no idea how to do any of the FIX Message 'surgery', so to speak. Can someone help shed some light on this? thanks! Azmat Paige wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > You should start with the executor project. Review the code, set up a > config file with your connections and see if you can connect. You can go > to the Open Fix testing website to see if you can connect and practice > sending different types of orders. Below is my config file code: > > -- View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p14896451.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: azmat <mr...@gm...> - 2008-01-17 20:56:19
|
Actually, I figured out the first part. fromApp, call crack...crack distinguishes what type of message it is and calls the appropiate OnMessage that is overridden from MessageCracker...if onMessage for the specific message type is NOT implemented, than an UnsupportedMessageType exception is thrown. So in the onMessage (execution report) I would write the business related code for what I need to do for when/if an executionReport is a type of message that is received, correct? My confusion now lies with sending messages with sendToTarget and its relation to toApp? Should I call sendToTarget from toApp or will it somehow (again) magically end up in toApp? thanks! Azmat Patrick, Thanks! This is perfect. I have something very similar now. I understand that I should call the crack method in the fromApp method so that the MessageCracker can identify exactly what type of message it is. That is really neat. But, what I do not get is how or when is the onMessage method is called (the one that takes the ExecutionReport parameter)? Is this something that automagically happens with the crack method if it determines the message is of type ExecutionReport? Also on the flipside of it. If I call sendToTarget from my business layer will it automatically go to the Application.toApp method OR do I need to somehow call toApp and then call sendToTarget from there? Any help would be much, much appreciated! thanks! Azmat -- View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p14933076.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: <or...@qu...> - 2008-03-13 22:09:28
|
<html><body><div>Well if that's all you want to do then just don't pass the message into your OMS when the flag is true. The DoNotSend exception doesn't enter into it. In reality you should very rarely encounter this situation because you will only ever see a PossDup message if the engine has not seen the message before. Meaning it came as a result of a resend request. But in this case all you have to do is see that the value is true, then simply don't pass it along.</div> <div> </div> <div>--oren<BR></div> <BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT: blue 2px solid" webmail="1">-------- Original Message --------<BR>Subject: Re: [Quickfix-developers] Just Starting...<BR>From: "mr azmat" <mr...@gm...><BR>Date: Thu, March 13, 2008 4:56 pm<BR>To: <a href="mailto:or...@qu...">or...@qu...</a><BR>Cc: <a href="mailto:qui...@li...">qui...@li...</a><BR><BR>QuickFIX Documentation: <a href="http://www.quickfixengine.org/quickfix/doc/html/index.html" target=_blank>http://www.quickfixengine.org/quickfix/doc/html/index.html</a><BR>QuickFIX Support: <a href="http://www.quickfixengine.org/services.html" target=_blank>http://www.quickfixengine.org/services.html</a><BR><BR> <HR> Hmm, I'm not sure I quite understand your second paragraph.<BR><BR>Basically I want to check PossDup on receipt and if it is TRUE...I'd like to discard the message altogether before it gets into our OMS.<BR>Isn't that the entire purpose of the PossDupFlag? <BR><BR>thanks-<BR>azmat<BR><BR> <DIV class=gmail_quote>On Thu, Mar 13, 2008 at 4:50 PM, <<a onclick="Popup.composeWindow('pcompose.php?sendto=oren%40quickfixengine.org');; return false;" href="mailto:or...@qu..." target=_blank><a href="mailto:or...@qu...">or...@qu...</a></A>> wrote:<BR> <BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"> <DIV> <DIV>You are kind of talking about two different things here. One is checking for a possdup flag on receipt, which is simply a matter of checking for the field in the header.</DIV> <DIV> </DIV> <DIV>The other is checking in sent messages presumably because you don't want to send messages that didn't make it out the first time. In this case can you elaborate on what problem you encountered and what exactly isn't working in your port of the code?<BR><BR>--oren</DIV> <BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT: blue 2px solid"> <DIV class=Ih2E3d>-------- Original Message --------<BR>Subject: Re: [Quickfix-developers] Just Starting...<BR></DIV> <DIV class=Ih2E3d>From: azmat <<A onclick="Popup.composeWindow('pcompose.php?sendto=mrazmat%40gmail.com');; return false;" href="mailto:mr...@gm..." target=_blank><a href="mailto:mr...@gm...">mr...@gm...</a></A>><BR>Date: Thu, March 13, 2008 4:40 pm<BR>To: <A onclick="Popup.composeWindow('pcompose.php?sendto=quickfix-developers%40lists.sourceforge.net');; return false;" href="mailto:qui...@li..." target=_blank><a href="mailto:qui...@li...">qui...@li...</a></A><BR><BR></DIV> <DIV> <DIV></DIV> <DIV class=Wj3C7c>QuickFIX Documentation: <A href="http://www.quickfixengine.org/quickfix/doc/html/index.html" target=_blank>http://www.quickfixengine.org/quickfix/doc/html/index.html</a><BR>QuickFIX Support: <a href="http://www.quickfixengine.org/services.html" target=_blank>http://www.quickfixengine.org/services.html</a><BR><BR><BR>All-<BR><BR>I need to check if the possdup flag is set, when I receive an execution<BR>report from the counter-party. I've also read many places that I should<BR>"throw a donotsend exception" in ToApp after I check for the PossDup flag. <BR><BR>Something similar to this, written by Caleb:<BR><a href="http://www.nabble.com/Request-resend-ts3856953.html#a3881695" target=_blank>http://www.nabble.com/Request-resend-ts3856953.html#a3881695</a><BR><BR><BR>For some reason I can't get this to work with C#. I'm having issues<BR>'translating' the C++ to C#, using QuickFix 1.2.4. This is quite<BR>frusturating. Has anyone done this in C#?<BR><BR><BR>thanks!<BR>azmat<BR><BR><BR><BR>Patrick Wright-3 wrote:<BR>> <BR>> QuickFIX Documentation:<BR>> <a href="http://www.quickfixengine.org/quickfix/doc/html/index.html" target=_blank>http://www.quickfixengine.org/quickfix/doc/html/index.html</a><BR>> QuickFIX Support: <a href="http://www.quickfixengine.org/services.html" target=_blank>http://www.quickfixengine.org/services.html</a><BR>> <BR>> Yes that is right.<BR>> <BR>> When you call sendtoTarget the toApp callback should be called by the<BR>> fix engine to allow you to do some processing before the message is sent<BR>> (log it for example). Also you can throw a DoNotSend exception here to<BR>> stop the message from being sent. toApp will also be called when the<BR>> engine responds to a resend request.<BR>> <BR>> I have only been using this for a few months - other people may have a<BR>> better insight into this.<BR>> <BR>> Patrick<BR>> <BR>> <BR><BR>-- <BR>View this message in context: <a href="http://www.nabble.com/Just-Starting...-tp14811784p16039185.html" target=_blank>http://www.nabble.com/Just-Starting...-tp14811784p16039185.html</a><BR>Sent from the QuickFIX - Dev mailing list archive at <a href="http://nabble.com/" target=_blank><a href="http://Nabble.com">Nabble.com</a></A>.<BR><BR><BR>-------------------------------------------------------------------------<BR>This <A href="http://sf.net/" target=_blank><a href="http://SF.net">SF.net</a></A> email is sponsored by: Microsoft<BR>Defy all challenges. Microsoft(R) Visual Studio 2008.<BR><A href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/" target=_blank>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/</a><BR>_______________________________________________<BR>Quickfix-developers mailing list<BR><a href="#118aa1f8d3fd2f6b_Compose" target=_self>Quickfix-developers<B></B>@lists.sourceforge.net</A><BR><A href="https://lists.sourceforge.net/lists/listinfo/quickfix-developers" target=_blank>https://lists.sourceforge.net/lists/listinfo/quickfix-developers</a><BR></DIV></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></DIV><BR> <HR> -------------------------------------------------------------------------<BR>This <a href="http://SF.net">SF.net</a> email is sponsored by: Microsoft<BR>Defy all challenges. Microsoft(R) Visual Studio 2008.<BR><a href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/" target=_blank>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/</a> <HR> _______________________________________________<BR>Quickfix-developers mailing list<BR><a onclick="Popup.composeWindow('pcompose.php?sendto=Quickfix-developers%40lists.sourceforge.net'); return false;" href="#Compose">Quickfix-developers<B></B>@lists.sourceforge.net</A><BR><A href="https://lists.sourceforge.net/lists/listinfo/quickfix-developers" target=_blank>https://lists.sourceforge.net/lists/listinfo/quickfix-developers</a> </BLOCKQUOTE></body></html> |
From: azmat <mr...@gm...> - 2008-03-14 13:35:05
|
Well, I think that is where my problem is. I overrode the onMessage(ExecutionReport) function and this is what I'm thinking I should write in it. PossDupFlag pdf = execrpt.getHeader().getField(new PossDupFlag()); if (pdf != null) { return; } else { // process messages that do not have possdup flag set at all to the OMS } This is the error I am receiving: Error 2 Cannot implicitly convert type 'QuickFix.BooleanField' to 'QuickFix.PossDupFlag'. An explicit conversion exists (are you missing a cast?) I haven't worked with the getHeader() function and am not familiar with how I should get properties from it. I am using the QuickFix .NET wrapper (C#). thanks! azmat Oren Miller wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Well if that's all you want to do then just don't pass the message > into your OMS when the flag is true. The DoNotSend > exception doesn't enter into it. In reality you should very > rarely encounter this situation because you will only ever see a PossDup > message if the engine has not seen the message before. Meaning it > came as a result of a resend request. But in this case all you have > to do is see that the value is true, then simply don't pass it along. > > --oren > > -- View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p16048126.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: Shane T. <str...@co...> - 2008-03-14 14:04:37
|
Azmat, You should be getting fields the type safe way (taken from http://quickfixengine.org/quickfix/doc/html/csharp/receiving_messages_3.html): QuickFix.PossDupFlag possDupe = msg.getHeader().getField(QuickFix.PossDupFlag.FIELD); Note that you shouldn't instantiate with getField(new Type()) to get any field, it just wastes allocations/cpu/memory. When you have the possDupe object, you can get its boolean value with possDupe.getValue(); -- Shane Trotter Connamara Systems, LLC On 3/14/08, azmat <mr...@gm...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > Well, I think that is where my problem is. I overrode the > onMessage(ExecutionReport) function and this is what I'm thinking I should > write in it. > > > PossDupFlag pdf = execrpt.getHeader().getField(new PossDupFlag()); > if (pdf != null) > { > return; > } > else > { > // process messages that do not have possdup flag set at all to the OMS > } > > > This is the error I am receiving: > > Error 2 Cannot implicitly convert type 'QuickFix.BooleanField' to > 'QuickFix.PossDupFlag'. An explicit conversion exists (are you missing a > cast?) > > I haven't worked with the getHeader() function and am not familiar with how > I should get properties from it. I am using the QuickFix .NET wrapper (C#). > > thanks! > azmat > > > > > Oren Miller wrote: > > > > QuickFIX Documentation: > > http://www.quickfixengine.org/quickfix/doc/html/index.html > > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > > > > Well if that's all you want to do then just don't pass the message > > into your OMS when the flag is true. The DoNotSend > > exception doesn't enter into it. In reality you should very > > rarely encounter this situation because you will only ever see a PossDup > > message if the engine has not seen the message before. Meaning it > > came as a result of a resend request. But in this case all you have > > to do is see that the value is true, then simply don't pass it along. > > > > --oren > > > > > > > -- > View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p16048126.html > > Sent from the QuickFIX - Dev mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |
From: Shane T. <str...@co...> - 2008-03-14 14:09:43
|
Alternatively, taken from the link you posted with the following C++ code: FIX::PossDupFlag possDupFlag; message.getHeader().getField( possDupFlag ); This is very similar to the C# translation: QuickFix.PossDupFlag possDupFlag; message.getHeader().getField( possDupFlag ); -- Shane Trotter Connamara Systems, LLC On 3/14/08, Shane Trotter <str...@co...> wrote: > Azmat, > > You should be getting fields the type safe way (taken from > http://quickfixengine.org/quickfix/doc/html/csharp/receiving_messages_3.html): > > QuickFix.PossDupFlag possDupe = > msg.getHeader().getField(QuickFix.PossDupFlag.FIELD); > > Note that you shouldn't instantiate with getField(new Type()) to get > any field, it just wastes allocations/cpu/memory. > > When you have the possDupe object, you can get its boolean value with > possDupe.getValue(); > > > -- > Shane Trotter > Connamara Systems, LLC > > > On 3/14/08, azmat <mr...@gm...> wrote: > > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > > > > > Well, I think that is where my problem is. I overrode the > > onMessage(ExecutionReport) function and this is what I'm thinking I should > > write in it. > > > > > > PossDupFlag pdf = execrpt.getHeader().getField(new PossDupFlag()); > > if (pdf != null) > > { > > return; > > } > > else > > { > > // process messages that do not have possdup flag set at all to the OMS > > } > > > > > > This is the error I am receiving: > > > > Error 2 Cannot implicitly convert type 'QuickFix.BooleanField' to > > 'QuickFix.PossDupFlag'. An explicit conversion exists (are you missing a > > cast?) > > > > I haven't worked with the getHeader() function and am not familiar with how > > I should get properties from it. I am using the QuickFix .NET wrapper (C#). > > > > thanks! > > azmat > > > > > > > > > > Oren Miller wrote: > > > > > > QuickFIX Documentation: > > > http://www.quickfixengine.org/quickfix/doc/html/index.html > > > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > > > > > > > > Well if that's all you want to do then just don't pass the message > > > into your OMS when the flag is true. The DoNotSend > > > exception doesn't enter into it. In reality you should very > > > rarely encounter this situation because you will only ever see a PossDup > > > message if the engine has not seen the message before. Meaning it > > > came as a result of a resend request. But in this case all you have > > > to do is see that the value is true, then simply don't pass it along. > > > > > > --oren > > > > > > > > > > > > -- > > View this message in context: http://www.nabble.com/Just-Starting...-tp14811784p16048126.html > > > > Sent from the QuickFIX - Dev mailing list archive at Nabble.com. > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > Quickfix-developers mailing list > > Qui...@li... > > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > |