Thread: [Quickfix-developers] Crack Message
Brought to you by:
orenmnero
From: Parjeet S. <par...@oa...> - 2008-03-03 06:33:09
|
This may be a simple question but I am struggling at the moment. I have created a message and sent to client side: Using Session.sendToTarget(message,"nnnn","cccc"). In the first instance my message got rejected. How can I handle rejected message and resend back to the client. Another issue how can I crack a message I am working with C#. Is there any example available. Thanks in advance. Regards PS |
From: Hozaifa A. A. <hoz...@ve...> - 2008-03-03 06:58:56
|
Hello You can extend 'MessageCracker' and implement the messages events you required example: public override void onMessage( QuickFix42.NewOrderSingle order, SessionID sessionID ) { } public override void onMessage( QuickFix42. ExecutionReport report, SessionID sessionID ) { } Etc. Or just implement public void fromApp(QuickFix.Message message, SessionID sessionID) { switch (message.getHeader().getField(35)) { case "d": break; } } Also try to add SessionQualifier to the configuration setting and give any name to them for both order and marketdata. Maybe that let you connect on first attempt. This helped me to connect. maybe u also can. Regards, Hozaifa Akber Ali From: qui...@li... [mailto:qui...@li...] On Behalf Of Parjeet Singh Sent: Monday, March 03, 2008 11:32 AM To: qui...@li... Subject: [Quickfix-developers] Crack Message This may be a simple question but I am struggling at the moment. I have created a message and sent to client side: Using Session.sendToTarget(message,"nnnn","cccc"). In the first instance my message got rejected. How can I handle rejected message and resend back to the client. Another issue how can I crack a message I am working with C#. Is there any example available. Thanks in advance. Regards PS |
From: Parjeet S. <par...@oa...> - 2008-03-04 05:11:53
|
This is may be simple question but at moment it is tough for me. I may be missing some basic point or misunderstanding. I have created a created this code to connect to the client side. e.g. This is from form load event and the client can see the connection. SessionSettings settings = new SessionSettings("C:\\Documents and Settings\\ParjeetS\\Projects\\FIXBarxsAcorn\\FIXBarxsAcorn\\Initiator.co nfig"); Application application = new Application(); FileStoreFactory storeFactory = new FileStoreFactory(settings); MessageFactory messageFactory = new DefaultMessageFactory(); ThreadedSocketInitiator initiator = new ThreadedSocketInitiator(application, storeFactory, settings, messageFactory); // SocketInitiator initiator = new SocketInitiator(application, storeFactory, settings,messageFactory); initiator.start(); while (initiator.isLoggedOn() == true) { MessageBox.Show("Test"); } The issue or missing some major point is from where I should be sending message and receiving message for example in creating message in Send Message public void onCreate( SessionID sessionID ) { msg.getHeader().setField(new StringField(8, "FIX.4.2")); // SenderCompID msg.getHeader().setField(new StringField(49, "yyy-PRICES-TEST")); // TargetCompID, with enumeration msg.getHeader().setField(new StringField(56, "xxx -PRICES-TEST")); // MsgType msg.getHeader().setField(new CharField(35, 'R')); msg.setField(new CharField(54, "1")); msg.setField(new StringField(58, "Cancel My Order!")); Session.sendToTarget(message, "xxx-TEST", "yyy-PRICES-TEST"); } Receive Message public void fromApp( Message message, SessionID sessionID ) { crack( message, sessionID ) Price price = new Price(); message.getField(price); ClOrdID clOrdID = new ClOrdID(); message.getField(clOrdID); } How I will receive the message in the file that is defined directory. At the end I need to convert the above message to xml. I will appreciate your help. Thanks in advance. PS |
From: Hozaifa A. A. <hoz...@ve...> - 2008-03-04 05:24:31
|
Hello, Create onLogon event and after logon u can send the request. Other things are correct unless ur having some error. From: qui...@li... [mailto:qui...@li...] On Behalf Of Parjeet Singh Sent: Tuesday, March 04, 2008 10:11 AM To: qui...@li... Subject: [Quickfix-developers] Message CallBack This is may be simple question but at moment it is tough for me. I may be missing some basic point or misunderstanding. I have created a created this code to connect to the client side. e.g. This is from form load event and the client can see the connection. SessionSettings settings = new SessionSettings("C:\\Documents and Settings\\ParjeetS\\Projects\\FIXBarxsAcorn\\FIXBarxsAcorn\\Initiator.config "); Application application = new Application(); FileStoreFactory storeFactory = new FileStoreFactory(settings); MessageFactory messageFactory = new DefaultMessageFactory(); ThreadedSocketInitiator initiator = new ThreadedSocketInitiator(application, storeFactory, settings, messageFactory); // SocketInitiator initiator = new SocketInitiator(application, storeFactory, settings,messageFactory); initiator.start(); while (initiator.isLoggedOn() == true) { MessageBox.Show("Test"); } The issue or missing some major point is from where I should be sending message and receiving message for example in creating message in Send Message public void onCreate( SessionID sessionID ) { msg.getHeader().setField(new StringField(8, "FIX.4.2")); // SenderCompID msg.getHeader().setField(new StringField(49, "yyy-PRICES-TEST")); // TargetCompID, with enumeration msg.getHeader().setField(new StringField(56, "xxx -PRICES-TEST")); // MsgType msg.getHeader().setField(new CharField(35, 'R')); msg.setField(new CharField(54, "1")); msg.setField(new StringField(58, "Cancel My Order!")); Session.sendToTarget(message, "xxx-TEST", "yyy-PRICES-TEST"); } Receive Message public void fromApp( Message message, SessionID sessionID ) { crack( message, sessionID ) Price price = new Price(); message.getField(price); ClOrdID clOrdID = new ClOrdID(); message.getField(clOrdID); } How I will receive the message in the file that is defined directory. At the end I need to convert the above message to xml. I will appreciate your help. Thanks in advance. PS |
From: Parjeet S. <par...@oa...> - 2008-03-05 05:30:47
|
I have implemented public void fromApp(QuickFix.Message message, SessionID sessionID) { switch (message.getHeader().getField(35)) { case "d": break; } } My defined dictionary is FIX42, when I pass the "message" in the fromApp, I can see the QuickFix42.BusinessMessageReject. I have checked the FIX42 xml as per required by the client and still I am getting the error. When I step into the code switch (message.getHeader().getField(35)), the application halts. I will appreciate your help. Thanks in advance. PS |
From: Hozaifa A. A. <hoz...@ve...> - 2008-03-05 05:55:31
|
Add default case and in that print the message.tostring() to check what's the message and there u will also find some text error message. What's the meaning of application halts. Does it hangs or just move forward? Regards Hozaifa Akber Ali From: qui...@li... [mailto:qui...@li...] On Behalf Of Parjeet Singh Sent: Wednesday, March 05, 2008 10:30 AM To: qui...@li... Subject: [Quickfix-developers] QuickFix42.BusinessManagerReject I have implemented public void fromApp(QuickFix.Message message, SessionID sessionID) { switch (message.getHeader().getField(35)) { case "d": break; } } My defined dictionary is FIX42, when I pass the "message" in the fromApp, I can see the QuickFix42.BusinessMessageReject. I have checked the FIX42 xml as per required by the client and still I am getting the error. When I step into the code switch (message.getHeader().getField(35)), the application halts. I will appreciate your help. Thanks in advance. PS |