quickfix-users Mailing List for QuickFIX (Page 10)
Brought to you by:
orenmnero
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
(4) |
Mar
(6) |
Apr
(2) |
May
(4) |
Jun
(1) |
Jul
(1) |
Aug
(2) |
Sep
(11) |
Oct
(3) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(7) |
Feb
(3) |
Mar
(10) |
Apr
(40) |
May
(63) |
Jun
(12) |
Jul
(26) |
Aug
(13) |
Sep
(6) |
Oct
(13) |
Nov
(17) |
Dec
(28) |
| 2004 |
Jan
(13) |
Feb
(6) |
Mar
(9) |
Apr
(20) |
May
(15) |
Jun
(29) |
Jul
(22) |
Aug
(11) |
Sep
(32) |
Oct
(34) |
Nov
(22) |
Dec
(33) |
| 2005 |
Jan
(17) |
Feb
(8) |
Mar
(3) |
Apr
(20) |
May
(19) |
Jun
(29) |
Jul
(30) |
Aug
(10) |
Sep
(24) |
Oct
|
Nov
(17) |
Dec
(11) |
| 2006 |
Jan
(32) |
Feb
(54) |
Mar
(34) |
Apr
(43) |
May
(14) |
Jun
(11) |
Jul
(10) |
Aug
(43) |
Sep
(37) |
Oct
(44) |
Nov
(16) |
Dec
(11) |
| 2007 |
Jan
(26) |
Feb
(5) |
Mar
(23) |
Apr
(3) |
May
(22) |
Jun
(17) |
Jul
(22) |
Aug
(34) |
Sep
(17) |
Oct
(18) |
Nov
(4) |
Dec
(8) |
| 2008 |
Jan
(28) |
Feb
(28) |
Mar
(23) |
Apr
(37) |
May
(53) |
Jun
(20) |
Jul
(30) |
Aug
(12) |
Sep
(19) |
Oct
(16) |
Nov
(15) |
Dec
(10) |
| 2009 |
Jan
(19) |
Feb
(8) |
Mar
(21) |
Apr
(8) |
May
(15) |
Jun
(22) |
Jul
(34) |
Aug
(18) |
Sep
(23) |
Oct
(26) |
Nov
(16) |
Dec
(13) |
| 2010 |
Jan
(38) |
Feb
(17) |
Mar
(39) |
Apr
(34) |
May
(5) |
Jun
(15) |
Jul
(7) |
Aug
(18) |
Sep
(4) |
Oct
(16) |
Nov
(3) |
Dec
(17) |
| 2011 |
Jan
(28) |
Feb
(12) |
Mar
(36) |
Apr
(9) |
May
(26) |
Jun
(27) |
Jul
(6) |
Aug
(10) |
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(7) |
May
(9) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(9) |
Nov
(10) |
Dec
(8) |
| 2013 |
Jan
(3) |
Feb
(2) |
Mar
(7) |
Apr
(2) |
May
|
Jun
(7) |
Jul
(22) |
Aug
(5) |
Sep
(3) |
Oct
(3) |
Nov
(3) |
Dec
(2) |
| 2014 |
Jan
(4) |
Feb
|
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(7) |
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2015 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(4) |
Dec
|
| 2016 |
Jan
(1) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(5) |
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Grant B. <gbi...@co...> - 2011-06-10 18:51:57
|
With that definition, I'm pretty sure that every day your session will stop a minute before noon and then restart one minute later. -Grant On Fri, Jun 10, 2011 at 9:32 AM, Richard Hedin <rh...@pe...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Hello all. > > > > I’d like to turn my session off at the .ini file for a while. There is a program that starts several QuickFix sessions. The program hasn’t been designed so that it can readily not start one session for a few weeks. It would be nice to put in the .ini file: SessionEnabled=no . But that doesn’t seem to exist. > > > > If I do this, will I blow its mind? > > > > StartTime=12:00:00 > > EndTime=11:59:00 > > > > > > Regards, > > > > Rick > > > > Rick Hedin > > Software Engineer > > PE∆K6 Investments > > 141 W. Jackson Blvd. Suite 500 > > Chicago, Il 60604 > > D: (312) 362-4343 > > E: rh...@pe... > > > > ________________________________ > See http://www.peak6.com/email_disclaimer.php for terms and conditions related to this email > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > > |
|
From: Richard H. <rh...@pe...> - 2011-06-10 14:48:02
|
Hello all.
I’d like to turn my session off at the .ini file for a while. There is a program that starts several QuickFix sessions. The program hasn’t been designed so that it can readily not start one session for a few weeks. It would be nice to put in the .ini file: SessionEnabled=no . But that doesn’t seem to exist.
If I do this, will I blow its mind?
StartTime=12:00:00
EndTime=11:59:00
Regards,
Rick
Rick Hedin
Software Engineer
PE∆K6 Investments
141 W. Jackson Blvd. Suite 500
Chicago, Il 60604
D: (312) 362-4343
E: rh...@pe...<mailto:rh...@pe...>
______________________________________________
See http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email
|
|
From: Grant B. <gbi...@co...> - 2011-06-09 16:18:45
|
I'm not a seasoned Visual C++ dev, but I'm trying to follow what you're trying to do here... I think you just have some code errors. It looks to me that the compile error is because you are declaring initiator as a full object. The compiler is trying to implicitly use the default constructor (no params), but FIX::SocketInitiator does not have one. Then your call to initiator()... well, it looks like a function, and the compiler can't find a function like that. Are you trying to call the constructor for initiator? My C++ is getting rusty, but one possibly memory-leaking approach that comes to mind is to declare initiator as a pointer to null (which won't call the constructor), then in the connect method you'll construct it and assign the pointer to it. There's probably better ways to do it in C++ (sorry my mind leans toward Java/C# style approaches right now), but I think you see where I'm going. -Grant On Sat, Jun 4, 2011 at 10:32 AM, Nigel Sperinck <nig...@gm...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Hi, > > > > I am trying to place the QuickFIX functionality in a separate DLL which would be called from the main trading application. > > > > As a minimum for placing orders, the DLL would have the following exported functions: > > Connect() > > EnterOrder() > > Disconnect() > > > > Connect() would be called at the start of the trading day and would keep the QuickFIX session open. While this session is open, orders can be placed using EnterOrder(). At the end of the trading day, Disconnect() would call initiator.stop() and close the session. > > > > If the initiator and application objects are created in Connect(), then these would need to become class-level objects so as not to go out-of-scope when Connect() ends. > > > > Adapting the tradeclient sample to make both application and initiator as class-level objects causes two compile-time errors. > > > > If there a way to get this approach to work or otherwise a way to achieve the objective of a separate DLL where Connect() could keep the QuickFIX session open? > > > > I would be very grateful for any help. > > Nigel Sperinck > > > > // Define as Class-level objects > > Application application; > > FIX::SocketInitiator initiator; > > Causes compile-time error C2512: 'FIX::SocketInitiator' : no appropriate default constructor available > > > > __declspec(dllexport) void Connect() > > { > > std::string file = "C:\\tradeclient.cfg"; > > > > try > > { > > FIX::SessionSettings settings( file ); > > > > FIX::FileStoreFactory storeFactory( settings ); > > > > FIX::FileLogFactory logFactory( settings ); > > > > initiator( application, storeFactory, settings, logFactory ); > > Causes compile-time error C2064: term does not evaluate to a function taking 4 arguments > > > > initiator.start(); > > } > > catch ( std::exception & e ) > > { > > std::cout << e.what(); > > } > > } > > > > __declspec(dllexport) void Disconnect() > > { > > initiator.stop(); > > } > > > > __declspec(dllexport) void EnterOrder() > > { > > // In production, order details would be passed to this function > > application.queryEnterOrder(); > > } > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Discover what all the cheering's about. > Get your free trial download today. > http://p.sf.net/sfu/quest-dev2dev2 > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > > |
|
From: Nigel S. <nig...@gm...> - 2011-06-04 15:32:21
|
Hi,
I am trying to place the QuickFIX functionality in a separate DLL which
would be called from the main trading application.
As a minimum for placing orders, the DLL would have the following exported
functions:
Connect()
EnterOrder()
Disconnect()
Connect() would be called at the start of the trading day and would keep the
QuickFIX session open. While this session is open, orders can be placed
using EnterOrder(). At the end of the trading day, Disconnect() would call
initiator.stop() and close the session.
If the initiator and application objects are created in Connect(), then
these would need to become class-level objects so as not to go out-of-scope
when Connect() ends.
Adapting the tradeclient sample to make both application and initiator as
class-level objects causes two compile-time errors.
If there a way to get this approach to work or otherwise a way to achieve
the objective of a separate DLL where Connect() could keep the QuickFIX
session open?
I would be very grateful for any help.
Nigel Sperinck
// Define as Class-level objects
Application application;
FIX::SocketInitiator initiator;
Causes compile-time error C2512: 'FIX::SocketInitiator' : no appropriate
default constructor available
__declspec(dllexport) void Connect()
{
std::string file = "C:\\tradeclient.cfg";
try
{
FIX::SessionSettings settings( file );
FIX::FileStoreFactory storeFactory( settings );
FIX::FileLogFactory logFactory( settings );
initiator( application, storeFactory, settings, logFactory );
Causes compile-time error C2064: term does not evaluate to a function taking
4 arguments
initiator.start();
}
catch ( std::exception & e )
{
std::cout << e.what();
}
}
__declspec(dllexport) void Disconnect()
{
initiator.stop();
}
__declspec(dllexport) void EnterOrder()
{
// In production, order details would be passed to this function
application.queryEnterOrder();
}
|
|
From: Grant B. <gbi...@co...> - 2011-06-02 17:51:59
|
(Hayyan, please be aware that the default reply-to for list messages does not go the list.) Your point (1) is correct. If your message is valid, the counterparty should accept it and respond with an ExecutionReport message of some sort. For (2), nearly all counterparties that I have worked with have made at least a few modifications to the DataDictionary. So if your counterparty says they're FIX 4.2, that probably means that they started with FIX 4.2 and made changes from there. They should have documentation explaining what they expect from you and what you should expect from them. -Grant On Wed, Jun 1, 2011 at 10:52 AM, Hayyan Rafiq <hay...@ho...> wrote: > Hi Grant thanks for taking the time and effort to post such a great > explanation.Really appreciate it. From your message I have made some side > notes , let me know if these points are correct or not.. > 1) Fix is a simple messaging protocol , these messages are exchanged using > TCP/IP Protocol. The client connects to a server using TCP/IP on which it > needs to place orders , and if the client sends an order message (which is > compatible with the server (suppose this is a exchange) ). The the server > will accept the order > Correct me if my above point is wrong. > > 2) > One more thing. when you mentioned > "Every counter party may require certain fields that others don't, or for > fields to used in certain ways, or for custom fields to be added to > messages." > Question: > suppose i am using FIX4.2 and some exchange is also FIX4.2 compliant. So i > construct a standard message in FIX4.2 will I be able to send a compatible > order message to that exchange .. ?? If not , then how could i make this > possible (if different exchanges are FIX 4.2 compatible is it possible that > each exchange may have different tags to place the same kind of order > successfully ???? > > Please let me know if my question seems unclear . > Looking forward to hearing for you and thanks again.. Really appreciate it. > Regards > Hayyan > > =============================================================================================================== >> Date: Wed, 1 Jun 2011 09:54:20 -0500 >> Subject: Re: [Quickfix-developers] Testing A Custom Initiator ... >> Suggestions Needed >> From: gbi...@co... >> To: hay...@ho... >> CC: qui...@li... >> >> You are thinking about FIX in the wrong way. >> >> FIX is a protocol for transmitting messages. That's it. It doesn't >> tell you how to send orders, or process orders, or receive market >> data, though it does provide message types that can be used to do so. >> >> There is no one correct way to submit or accept an order. Every >> counterparty may require certain fields that others don't, or for >> fields to used in certain ways, or for custom fields to be added to >> messages. The default FIX messages are a good baseline, but in >> practice, all counterparties have made certain customizations that you >> need to find out (from them) in order to trade on their systems. >> >> Thus, the trade client example should be looked at only as an example >> of how to send and process messages. The order messages it sends out >> probably won't work on most real-world counterparties. If you have a >> specific counterparty in mind, you should check out their FIX >> interface's documentation. >> >> -Grant >> >> >> >> On Wed, Jun 1, 2011 at 5:53 AM, Hayyan Rafiq <hay...@ho...> wrote: >> > QuickFIX Documentation: >> > http://www.quickfixengine.org/quickfix/doc/html/index.html >> > QuickFIX Support: http://www.quickfixengine.org/services.html >> > >> > >> > Hi , I recently started using quick fix and I would like to ask the >> > experts out there a couple of questions. Please bare with me >> > I recently created an acceptor application (Receives an order and sends >> > an execution report back to the client), I was using the >> > tradeclient example in the quick fix source as the initiator. >> > Anyways.... >> > >> > I just found out that the trade client example only allows us to place >> > limit orders and does not support other order types >> > (I really do wonder why ?? since other order options are also present ) >> > what i want to know is suppose that I upgrade and extend the tradeclient so >> > it can also place orders like MARKET,STOP and STOP LIMIT is there any way by >> > which i can test these new ORDER TYPES ? I mean are there any websites out >> > there for testing purposes to see if my newly created client can place >> > orders of types (MARKET,STOP and STOP LIMIT) and the website validates the >> > orders informing me if the orders which i created are correct or incorrect >> > t?? >> > >> > My second question is exactly the opposite of above , I want to find out >> > if there is an initiator(some thing like tradeclient) out there that could >> > place all kind of orders. Since i am also developing an acceptor such a >> > client would also come in handy. >> > >> > Your suggestions and comments would highly be appreciated.. >> > >> > >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > Simplify data backup and recovery for your virtual environment with >> > vRanger. >> > Installation's a snap, and flexible recovery options mean your data is >> > safe, >> > secure and there when you need it. Data protection magic? >> > Nope - It's vRanger. Get your free trial download today. >> > http://p.sf.net/sfu/quest-sfdev2dev >> > _______________________________________________ >> > Quickfix-developers mailing list >> > Qui...@li... >> > https://lists.sourceforge.net/lists/listinfo/quickfix-developers >> > > |
|
From: dev13 <jo...@gm...> - 2011-06-01 08:03:54
|
Hi, I was creating a windows application that accepts FIX messages and
publishes messages in string format ("EURUSD:1.4443:1.4444;").
I have attached the piece of code that connects to the FIX MarketData
provider. The problem is if I use 'initiator.block()', then the application
retrieves data from the provider but the application gets stuck i.e., I am
not able to use any of the other controls in the user interface. And if I
don't use 'initiator.block()', the application will exit with a runtime
exception.
Please advise.
void Application::initConnection()
{
try
{
Application* appln = Application::getInstance();
FIX::SessionSettings settings = appln->getSettings();
FIX::ThreadedSocketInitiator initiator(*appln, FIX::NullStoreFactory(),
settings);
//initiator.start();
initiator.poll();
while(!initiator.isLoggedOn())
{
Sleep(1000);
}
appln->sendMarketDataRequest();
//initiator.block();
initiator.stop();
}
catch(char *str )
{
ExtLogger.Out("Connection error : %s", str);
}
}
--
View this message in context: http://old.nabble.com/Application-hangs-tp31747251p31747251.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: abaraff <ab...@ra...> - 2011-05-25 11:53:27
|
There's a hacked solution to this problem here: http://old.nabble.com/Message-with-contents-set-through-Message.setString%28string%29-can%27t-be-cracked-in-.Net-to31664717.html abaraff wrote: > > I'm trying to find a method to persist messages for restoring state in my > application. I've been unable to get the new Message(string) constructor > to return a new message where the fields are identical to the original. > I've detailed the bug in an earlier post. Another logical way of > persisting a message would be to store all the header field key/value > pairs and all the body key value pairs. I've restored the message by > adding the necessary fields back to a new message. While the string > output by this message is identical to the original, there is obviously > some problem because the cracker throws an exception with the cloned > version but not the original. > > I realize this is a non-typesafe approach to creating a message, if anyone > has an alternate suggestion that will adapt to restoring any message type, > I'm interested in the suggestion. > > public void fromApp(Message msg, SessionID sessionID) > { > > System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss.FFFF") > + " FromApp:" + sessionID.ToString() + "\t" + msg.ToString()); > try > { > > string message = msg.ToString(); > Message newMessage = new Message(); > foreach(Field fld in msg.getHeader()) > { > newMessage.getHeader().setField(fld.getField(), > fld.getObject().ToString()); > } > foreach (Field fld in msg) > { > newMessage.setField(fld.getField(), > fld.getObject().ToString()); > } > crack(msg, sessionID); > try > { > crack(newMessage, sessionID); > } > catch (Exception e2) > { > System.Diagnostics.Debug.WriteLine(e2.ToString()); > System.Diagnostics.Debug.WriteLine(msg.ToString() == > newMessage.ToString()); > System.Diagnostics.Debug.WriteLine("orig: " + > msg.ToString()); > System.Diagnostics.Debug.WriteLine("new: " + > newMessage.ToString()); > System.Diagnostics.Debug.WriteLine("round trip > failed"); > } > } > catch (Exception e) > { > System.Diagnostics.Debug.WriteLine(e.ToString()); > } > } > > public override void onMessage(QuickFix42.NewOrderSingle message, > SessionID session) > { > System.Diagnostics.Debug.WriteLine("New Order Single"); > } > > output: > > 14:30:47.4179 FromApp:FIX.4.2:SCTC->SCT1 > 8=FIX.4.29=18035=D34=249=SCT152=20110519-18:30:47.41756=SCTC11=SCT20110519-143047_0000218=121=138=20040=154=155=IBM58=SCT20110519-143047_0000259=060=20110519-14:30:47100=DB-SMART10=013 > New Order Single > A first chance exception of type 'QuickFix.UnsupportedMessageType' > occurred in quickfix_net_messages.dll > QuickFix.UnsupportedMessageType: Exception of type > 'QuickFix.UnsupportedMessageType' was thrown. > at QuickFix42.MessageCracker.onMessage(Message message, SessionID > session) > at QuickFix42.MessageCracker.crack(Message message, SessionID > sessionID) > at FIXServer.FIXServerApp.fromApp(Message msg, SessionID sessionID) in > C:\Dev\Abaraff\FIXServer\FIXServer\FIXServerApp.cs:line 238 > True > orig: > 8=FIX.4.29=18035=D34=249=SCT152=20110519-18:30:47.41756=SCTC11=SCT20110519-143047_0000218=121=138=20040=154=155=IBM58=SCT20110519-143047_0000259=060=20110519-14:30:47100=DB-SMART10=013 > new: > 8=FIX.4.29=18035=D34=249=SCT152=20110519-18:30:47.41756=SCTC11=SCT20110519-143047_0000218=121=138=20040=154=155=IBM58=SCT20110519-143047_0000259=060=20110519-14:30:47100=DB-SMART10=013 > round trip failed > -- View this message in context: http://old.nabble.com/Cracking-non-typesafe-message-in-.Net-fails-tp31664242p31698176.html Sent from the QuickFIX - User mailing list archive at Nabble.com. |
|
From: abaraff <ab...@ra...> - 2011-05-25 11:52:06
|
So I ripped off a bit of the code from the Java version of Quickfix. It's
not the prettiest port--I was just trying to get it functional. It does
produce correctly typed messages from strings however. I'd love to have
someone post a cleaner alternative, but here is the MessageUtils class that
I ported over. The parse() methods return messages that can be cracked and
are correctly typed:
using System;
using System.Collections.Generic;
using System.Text;
namespace QuickFix
{
public class MessageUtils
{
private const char FIELD_SEPARATOR = '\x0001';
public const string BEGINSTRING_FIX40 = "FIX.4.0";
public const string BEGINSTRING_FIX41 = "FIX.4.1";
public const string BEGINSTRING_FIX42 = "FIX.4.2";
public const string BEGINSTRING_FIX43 = "FIX.4.3";
public const string BEGINSTRING_FIX44 = "FIX.4.4";
/**
* FIX 5.0 does not have a begin string.
*/
public const string FIX50 = "FIX.5.0";
// FIXT.x.x support
public const string FIXT_SESSION_PREFIX = "FIXT.";
public const string BEGINSTRING_FIXT11 = FIXT_SESSION_PREFIX +
"1.1";
private static Dictionary<string, ApplVerID> BeginStringToApplVerID
= new Dictionary<String, ApplVerID>();
static MessageUtils()
{
// No support for earlier versions of FIX
BeginStringToApplVerID.Add(BEGINSTRING_FIX40, new
ApplVerID(ApplVerID.FIX40));
BeginStringToApplVerID.Add(BEGINSTRING_FIX41, new
ApplVerID(ApplVerID.FIX41));
BeginStringToApplVerID.Add(BEGINSTRING_FIX42, new
ApplVerID(ApplVerID.FIX42));
BeginStringToApplVerID.Add(BEGINSTRING_FIX43, new
ApplVerID(ApplVerID.FIX43));
BeginStringToApplVerID.Add(BEGINSTRING_FIX44, new
ApplVerID(ApplVerID.FIX44));
BeginStringToApplVerID.Add(FIX50, new
ApplVerID(ApplVerID.FIX50));
}
private static ApplVerID GetApplVerID(Session session, string
messageString)
{
ApplVerID applVerID = null;
string applVerIdString = GetStringField(messageString,
ApplVerID.FIELD);
if (applVerIdString != null)
{
applVerID = new ApplVerID(applVerIdString);
}
/* GetTargetDefaultApplicationVersionID doesn't exist in the
.Net version
if (applVerID == null) {
applVerID = session.GetTargetDefaultApplicationVersionID();
}*/
if (applVerID == null && IsLogon(messageString))
{
string defaultApplVerIdString =
GetStringField(messageString,
DefaultApplVerID.FIELD);
if (defaultApplVerIdString != null)
{
applVerID = new ApplVerID(defaultApplVerIdString);
}
}
if (applVerID == null)
{
throw new InvalidMessage("Can't determine ApplVerID for
message");
}
return applVerID;
}
public static string GetMessageType(String messageString)
{
string value = GetStringField(messageString, 35);
if (value == null)
{
throw new InvalidMessage("Missing or garbled message type in
" + messageString);
}
return value;
}
public static string GetStringField(String messageString, int tag)
{
string value = null;
string tagString = tag.ToString();
int start = messageString.IndexOf(tagString, 0);
while (start != -1 && value == null)
{
if ((start == 0 || messageString[start - 1] ==
FIELD_SEPARATOR))
{
int end = start + tagString.Length;
if ((end + 1) < messageString.Length &&
messageString[end] == '=')
{
// found tag, get value
start = end = (end + 1);
for (; end < messageString.Length
&& messageString[end] != FIELD_SEPARATOR;
end++)
{
;
}
if (end == messageString.Length)
{
return null;
}
else
{
value = messageString.Substring(start, end -
start);
}
}
}
start = messageString.IndexOf(tagString, start + 1);
}
return value;
}
public static bool IsAdminMessage(string msgType)
{
return msgType.Length == 1 && "0A12345h".IndexOf(msgType) != -1;
}
public static bool IsLogon(string message)
{
return IsMessageType(message, MsgType.Logon);
}
private static bool IsMessageType(string message, string msgType)
{
try
{
return msgType == GetMessageType(message);
}
catch (InvalidMessage e)
{
return false;
}
}
/**
* Utility method for parsing a mesasge. This should only be used
for parsing messages from
* FIX versions 4.4 or earlier.
*
* @param messageFactory
* @param dataDictionary
* @param messageString
* @return the parsed message
* @throws InvalidMessage
*/
public static Message parse(MessageFactory messageFactory,
DataDictionary dataDictionary,
string messageString)
{
int index = messageString.IndexOf(FIELD_SEPARATOR);
if (index < 0)
{
throw new InvalidMessage("Message does not contain any field
separator");
}
string beginString = messageString.Substring(2, index - 2);
string messageType = GetMessageType(messageString);
Message message = messageFactory.create(beginString,
messageType);
message.setString(messageString, dataDictionary != null,
dataDictionary);
return message;
}
/**
* NOTE: This method is intended for internal use.
*
* @param session - the Session that will process the message
* @param messageString
* @return the parsed message
* @throws InvalidMessage
*/
public static Message parse(Session session, string messageString,
MessageFactory messageFactory)
{
BeginString beginString = new
BeginString(GetStringField(messageString, BeginString.FIELD));
string msgType = GetMessageType(messageString);
ApplVerID applVerID = null;
//String customApplVerID = null;
if (BEGINSTRING_FIXT11 == beginString.getValue())
{
applVerID = GetApplVerID(session, messageString);
//customApplVerID = GetStringField(messageString,
CstmApplVerID.FIELD);
}
else
{
applVerID = ToApplVerID(beginString.getValue());
}
//MessageFactory messageFactory = session.getMessageFactory();
DataDictionaryProvider ddProvider =
session.getDataDictionaryProvider();
DataDictionary sessionDataDictionary = ddProvider == null ? null
: ddProvider.getSessionDataDictionary(beginString);
DataDictionary applicationDataDictionary = ddProvider == null ?
null : ddProvider.getApplicationDataDictionary(applVerID);
Message message = messageFactory.create(beginString.getValue(),
msgType);
//DataDictionary payloadDictionary =
MessageUtils.IsAdminMessage(msgType) ? sessionDataDictionary :
applicationDataDictionary;
message.setString(messageString, sessionDataDictionary != null,
sessionDataDictionary);//Closest .net version
//message.parse(messageString, sessionDataDictionary,
payloadDictionary, payloadDictionary != null);
return message;
}
/**
* Convert a begin string to an ApplVerID
* @param beginString
* @return the ApplVerID for the specified begin string.
* @throws QFJException if conversion fails.
* @see FixVersions
*/
public static ApplVerID ToApplVerID(string beginString)
{
ApplVerID applVerID = BeginStringToApplVerID[beginString];
if (applVerID == null)
{
throw new Exception("Can't convert to ApplVerID: " +
beginString);
}
return applVerID;
}
}
}
abaraff wrote:
>
> If a message is cloned using the .setString(string) method, calling crack
> on it fails. As you can see from my example below, crack is successful on
> the original message but throws an exception when called on the clone:
>
> public void fromApp(Message msg, SessionID sessionID)
> {
> try
> {
>
> string message = msg.ToString();
>
> Message newMessage = new Message();
> newMessage.setString(msg.ToString(), true);
>
> crack(msg, sessionID);
> try
> {
> crack(newMessage, sessionID);
> }
> catch (Exception e2)
> {
> System.Diagnostics.Debug.WriteLine(e2.ToString());
> System.Diagnostics.Debug.WriteLine(msg.ToString() ==
> newMessage.ToString());
> System.Diagnostics.Debug.WriteLine("orig: " +
> msg.ToString());
> System.Diagnostics.Debug.WriteLine("new: " +
> newMessage.ToString());
> System.Diagnostics.Debug.WriteLine("orig: " +
> msg.ToXML());
> System.Diagnostics.Debug.WriteLine("new: " +
> newMessage.ToXML());
> System.Diagnostics.Debug.WriteLine("round trip
> failed");
> }
> }
> catch (Exception e)
> {
> System.Diagnostics.Debug.WriteLine(e.ToString());
> }
> }
>
> public override void onMessage(QuickFix42.NewOrderSingle message,
> SessionID session)
> {
> System.Diagnostics.Debug.WriteLine("New Order Single");
> }
>
> Output:
> New Order Single
> A first chance exception of type 'QuickFix.UnsupportedMessageType'
> occurred in quickfix_net_messages.dll
> QuickFix.UnsupportedMessageType: Exception of type
> 'QuickFix.UnsupportedMessageType' was thrown.
> at QuickFix42.MessageCracker.onMessage(Message message, SessionID
> session)
> at QuickFix42.MessageCracker.crack(Message message, SessionID
> sessionID)
> at FIXServer.FIXServerApp.fromApp(Message msg, SessionID sessionID) in
> C:\Dev\Abaraff\FIXServer\FIXServer\FIXServerApp.cs:line 244
> True
> orig:
> 8=FIX.4.29=18035=D34=249=SCT152=20110520-14:38:23.52356=SCTC11=SCT20110520-103823_0000818=121=138=20040=154=155=IBM58=SCT20110520-103823_0000859=060=20110520-10:38:23100=DB-SMART10=239
> new:
> 8=FIX.4.29=18035=D34=249=SCT152=20110520-14:38:23.52356=SCTC11=SCT20110520-103823_0000818=121=138=20040=154=155=IBM58=SCT20110520-103823_0000859=060=20110520-10:38:23100=DB-SMART10=239
> orig: <message>
> <header>
> <field number="8"><![CDATA[FIX.4.2]]></field>
> <field number="9"><![CDATA[180]]></field>
> <field number="35"><![CDATA[D]]></field>
> <field number="34"><![CDATA[2]]></field>
> <field number="49"><![CDATA[SCT1]]></field>
> <field number="52"><![CDATA[20110520-14:38:23.523]]></field>
> <field number="56"><![CDATA[SCTC]]></field>
> </header>
> <body>
> <field number="11"><![CDATA[SCT20110520-103823_00008]]></field>
> <field number="18"><![CDATA[1]]></field>
> <field number="21"><![CDATA[1]]></field>
> <field number="38"><![CDATA[200]]></field>
> <field number="40"><![CDATA[1]]></field>
> <field number="54"><![CDATA[1]]></field>
> <field number="55"><![CDATA[IBM]]></field>
> <field number="58"><![CDATA[SCT20110520-103823_00008]]></field>
> <field number="59"><![CDATA[0]]></field>
> <field number="60"><![CDATA[20110520-10:38:23]]></field>
> <field number="100"><![CDATA[DB-SMART]]></field>
> </body>
> <trailer>
> <field number="10"><![CDATA[239]]></field>
> </trailer>
> </message>
> new: <message>
> <header>
> <field number="8"><![CDATA[FIX.4.2]]></field>
> <field number="9"><![CDATA[180]]></field>
> <field number="35"><![CDATA[D]]></field>
> <field number="34"><![CDATA[2]]></field>
> <field number="49"><![CDATA[SCT1]]></field>
> <field number="52"><![CDATA[20110520-14:38:23.523]]></field>
> <field number="56"><![CDATA[SCTC]]></field>
> </header>
> <body>
> <field number="11"><![CDATA[SCT20110520-103823_00008]]></field>
> <field number="18"><![CDATA[1]]></field>
> <field number="21"><![CDATA[1]]></field>
> <field number="38"><![CDATA[200]]></field>
> <field number="40"><![CDATA[1]]></field>
> <field number="54"><![CDATA[1]]></field>
> <field number="55"><![CDATA[IBM]]></field>
> <field number="58"><![CDATA[SCT20110520-103823_00008]]></field>
> <field number="59"><![CDATA[0]]></field>
> <field number="60"><![CDATA[20110520-10:38:23]]></field>
> <field number="100"><![CDATA[DB-SMART]]></field>
> </body>
> <trailer>
> <field number="10"><![CDATA[239]]></field>
> </trailer>
> </message>
> round trip failed
>
--
View this message in context: http://old.nabble.com/Message-with-contents-set-through-Message.setString%28string%29-can%27t-be-cracked-in-.Net-tp31664717p31698166.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: abaraff <ab...@ra...> - 2011-05-24 14:09:45
|
The version without the MessageFactory also works:
quickfix.Message newMessage =
MessageUtils.parse(Session.lookupSession(sessionID), persistedString);
abaraff wrote:
>
> I'm building an application that in the event of a crash or restart can
> reestablish state based on reprocessing messages that it has previously
> received. During normal operation messages that arrive are cracked in the
> fromApp callback. I'd like to be able to use the crack method of the
> MessageCracker to reprocess my persisted messages. Unfortunately, it
> appears as though the MessageCracker expects to receive a properly typed
> message, and I can't figure out how to construct a properly typed message
> from a string or from key-value pairs without completely reinventing the
> wheel.
>
> If I construct a quickfix.Message object like this:
> quickfix.Message newMessage = new quickfix.Message(persistedString, true);
>
> crack(newMessage, sessionID); will throw an exception stating that:
> "java.lang.ClassCastException: quickfix.Message cannot be cast to
> quickfix.fix42.Message"
>
> If I construct a quickfix.fix42.Message object like this :
> quickfix.Message msg = new quickfix.Message(persistedString, true);
> quickfix.fix42.Message newMessage = new quickfix.fix42.Message();
> Iterator fieldIterator = msg.getHeader().iterator();
> while(fieldIterator.hasNext())
> {
> Field fld = (Field) fieldIterator.next();
> newMessage.getHeader().setString(fld.getField(),
> fld.getObject().toString());
> }fieldIterator = msg.iterator();
> while(fieldIterator.hasNext())
> {
> Field fld = (Field) fieldIterator.next();
> newMessage.setString(fld.getField(), fld.getObject().toString());
> }
>
> crack(msg, sessionID); will throw this exception
> "java.lang.ClassCastException: quickfix.fix42.Message cannot be cast to
> quickfix.fix42.NewOrderSingle"
>
> Obviously, the API is converting a string into a properly typed Message
> somewhere. Is this machinery accessible? I could certainly do away with
> the cracker or build my own typed message constructor (which would
> constitute rewriting a huge chunk of QuickFIX/J) or build some sort of
> hacked switch statement.
>
> Thanks,
>
> Anthony
>
> (Message also posted to QuickFIX/J)
>
--
View this message in context: http://old.nabble.com/Creating-a-correctly-typed-message-from-a-string-tp31684672p31690692.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: abaraff <ab...@ra...> - 2011-05-24 13:46:22
|
The answer to the question is to use the MessageUtils.parse method:
quickfix.Message newMessage = MessageUtils.parse(_messageFactory,
Session.lookupSession(sessionID).getDataDictionary(), persistedString);
abaraff wrote:
>
> I'm building an application that in the event of a crash or restart can
> reestablish state based on reprocessing messages that it has previously
> received. During normal operation messages that arrive are cracked in the
> fromApp callback. I'd like to be able to use the crack method of the
> MessageCracker to reprocess my persisted messages. Unfortunately, it
> appears as though the MessageCracker expects to receive a properly typed
> message, and I can't figure out how to construct a properly typed message
> from a string or from key-value pairs without completely reinventing the
> wheel.
>
> If I construct a quickfix.Message object like this:
> quickfix.Message newMessage = new quickfix.Message(persistedString, true);
>
> crack(newMessage, sessionID); will throw an exception stating that:
> "java.lang.ClassCastException: quickfix.Message cannot be cast to
> quickfix.fix42.Message"
>
> If I construct a quickfix.fix42.Message object like this :
> quickfix.Message msg = new quickfix.Message(persistedString, true);
> quickfix.fix42.Message newMessage = new quickfix.fix42.Message();
> Iterator fieldIterator = msg.getHeader().iterator();
> while(fieldIterator.hasNext())
> {
> Field fld = (Field) fieldIterator.next();
> newMessage.getHeader().setString(fld.getField(),
> fld.getObject().toString());
> }fieldIterator = msg.iterator();
> while(fieldIterator.hasNext())
> {
> Field fld = (Field) fieldIterator.next();
> newMessage.setString(fld.getField(), fld.getObject().toString());
> }
>
> crack(msg, sessionID); will throw this exception
> "java.lang.ClassCastException: quickfix.fix42.Message cannot be cast to
> quickfix.fix42.NewOrderSingle"
>
> Obviously, the API is converting a string into a properly typed Message
> somewhere. Is this machinery accessible? I could certainly do away with
> the cracker or build my own typed message constructor (which would
> constitute rewriting a huge chunk of QuickFIX/J) or build some sort of
> hacked switch statement.
>
> Thanks,
>
> Anthony
>
> (Message also posted to QuickFIX/J)
>
--
View this message in context: http://old.nabble.com/Creating-a-correctly-typed-message-from-a-string-tp31684672p31690500.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: abaraff <ab...@ra...> - 2011-05-23 19:23:15
|
I'm building an application that in the event of a crash or restart can
reestablish state based on reprocessing messages that it has previously
received. During normal operation messages that arrive are cracked in the
fromApp callback. I'd like to be able to use the crack method of the
MessageCracker to reprocess my persisted messages. Unfortunately, it
appears as though the MessageCracker expects to receive a properly typed
message, and I can't figure out how to construct a properly typed message
from a string or from key-value pairs without completely reinventing the
wheel.
If I construct a quickfix.Message object like this:
quickfix.Message newMessage = new quickfix.Message(persistedString, true);
crack(newMessage, sessionID); will throw an exception stating that:
"java.lang.ClassCastException: quickfix.Message cannot be cast to
quickfix.fix42.Message"
If I construct a quickfix.fix42.Message object like this :
quickfix.Message msg = new quickfix.Message(persistedString, true);
quickfix.fix42.Message newMessage = new quickfix.fix42.Message();
Iterator fieldIterator = msg.getHeader().iterator();
while(fieldIterator.hasNext())
{
Field fld = (Field) fieldIterator.next();
newMessage.getHeader().setString(fld.getField(),
fld.getObject().toString());
}fieldIterator = msg.iterator();
while(fieldIterator.hasNext())
{
Field fld = (Field) fieldIterator.next();
newMessage.setString(fld.getField(), fld.getObject().toString());
}
crack(msg, sessionID); will throw this exception
"java.lang.ClassCastException: quickfix.fix42.Message cannot be cast to
quickfix.fix42.NewOrderSingle"
Obviously, the API is converting a string into a properly typed Message
somewhere. Is this machinery accessible? I could certainly do away with
the cracker or build my own typed message constructor (which would
constitute rewriting a huge chunk of QuickFIX/J) or build some sort of
hacked switch statement.
Thanks,
Anthony
(Message also posted to QuickFIX/J)
--
View this message in context: http://old.nabble.com/Creating-a-correctly-typed-message-from-a-string-tp31684672p31684672.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: abaraff <ab...@ra...> - 2011-05-20 14:45:48
|
If a message is cloned using the .setString(string) method, calling crack on
it fails. As you can see from my example below, crack is successful on the
original message but throws an exception when called on the clone:
public void fromApp(Message msg, SessionID sessionID)
{
try
{
string message = msg.ToString();
Message newMessage = new Message();
newMessage.setString(msg.ToString(), true);
crack(msg, sessionID);
try
{
crack(newMessage, sessionID);
}
catch (Exception e2)
{
System.Diagnostics.Debug.WriteLine(e2.ToString());
System.Diagnostics.Debug.WriteLine(msg.ToString() ==
newMessage.ToString());
System.Diagnostics.Debug.WriteLine("orig: " +
msg.ToString());
System.Diagnostics.Debug.WriteLine("new: " +
newMessage.ToString());
System.Diagnostics.Debug.WriteLine("orig: " +
msg.ToXML());
System.Diagnostics.Debug.WriteLine("new: " +
newMessage.ToXML());
System.Diagnostics.Debug.WriteLine("round trip failed");
}
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.ToString());
}
}
public override void onMessage(QuickFix42.NewOrderSingle message, SessionID
session)
{
System.Diagnostics.Debug.WriteLine("New Order Single");
}
Output:
New Order Single
A first chance exception of type 'QuickFix.UnsupportedMessageType' occurred
in quickfix_net_messages.dll
QuickFix.UnsupportedMessageType: Exception of type
'QuickFix.UnsupportedMessageType' was thrown.
at QuickFix42.MessageCracker.onMessage(Message message, SessionID
session)
at QuickFix42.MessageCracker.crack(Message message, SessionID sessionID)
at FIXServer.FIXServerApp.fromApp(Message msg, SessionID sessionID) in
C:\Dev\Abaraff\FIXServer\FIXServer\FIXServerApp.cs:line 244
True
orig:
8=FIX.4.29=18035=D34=249=SCT152=20110520-14:38:23.52356=SCTC11=SCT20110520-103823_0000818=121=138=20040=154=155=IBM58=SCT20110520-103823_0000859=060=20110520-10:38:23100=DB-SMART10=239
new:
8=FIX.4.29=18035=D34=249=SCT152=20110520-14:38:23.52356=SCTC11=SCT20110520-103823_0000818=121=138=20040=154=155=IBM58=SCT20110520-103823_0000859=060=20110520-10:38:23100=DB-SMART10=239
orig: <message>
<header>
<field number="8"><![CDATA[FIX.4.2]]></field>
<field number="9"><![CDATA[180]]></field>
<field number="35"><![CDATA[D]]></field>
<field number="34"><![CDATA[2]]></field>
<field number="49"><![CDATA[SCT1]]></field>
<field number="52"><![CDATA[20110520-14:38:23.523]]></field>
<field number="56"><![CDATA[SCTC]]></field>
</header>
<body>
<field number="11"><![CDATA[SCT20110520-103823_00008]]></field>
<field number="18"><![CDATA[1]]></field>
<field number="21"><![CDATA[1]]></field>
<field number="38"><![CDATA[200]]></field>
<field number="40"><![CDATA[1]]></field>
<field number="54"><![CDATA[1]]></field>
<field number="55"><![CDATA[IBM]]></field>
<field number="58"><![CDATA[SCT20110520-103823_00008]]></field>
<field number="59"><![CDATA[0]]></field>
<field number="60"><![CDATA[20110520-10:38:23]]></field>
<field number="100"><![CDATA[DB-SMART]]></field>
</body>
<trailer>
<field number="10"><![CDATA[239]]></field>
</trailer>
</message>
new: <message>
<header>
<field number="8"><![CDATA[FIX.4.2]]></field>
<field number="9"><![CDATA[180]]></field>
<field number="35"><![CDATA[D]]></field>
<field number="34"><![CDATA[2]]></field>
<field number="49"><![CDATA[SCT1]]></field>
<field number="52"><![CDATA[20110520-14:38:23.523]]></field>
<field number="56"><![CDATA[SCTC]]></field>
</header>
<body>
<field number="11"><![CDATA[SCT20110520-103823_00008]]></field>
<field number="18"><![CDATA[1]]></field>
<field number="21"><![CDATA[1]]></field>
<field number="38"><![CDATA[200]]></field>
<field number="40"><![CDATA[1]]></field>
<field number="54"><![CDATA[1]]></field>
<field number="55"><![CDATA[IBM]]></field>
<field number="58"><![CDATA[SCT20110520-103823_00008]]></field>
<field number="59"><![CDATA[0]]></field>
<field number="60"><![CDATA[20110520-10:38:23]]></field>
<field number="100"><![CDATA[DB-SMART]]></field>
</body>
<trailer>
<field number="10"><![CDATA[239]]></field>
</trailer>
</message>
round trip failed
--
View this message in context: http://old.nabble.com/Message-with-contents-set-through-Message.setString%28string%29-can%27t-be-cracked-in-.Net-tp31664717p31664717.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: abaraff <ab...@ra...> - 2011-05-20 13:47:06
|
I'm trying to find a method to persist messages for restoring state in my
application. I've been unable to get the new Message(string) constructor to
return a new message where the fields are identical to the original. I've
detailed the bug in an earlier post. Another logical way of persisting a
message would be to store all the header field key/value pairs and all the
body key value pairs. I've restored the message by adding the necessary
fields back to a new message. While the string output by this message is
identical to the original, there is obviously some problem because the
cracker throws an exception with the cloned version but not the original.
I realize this is a non-typesafe approach to creating a message, if anyone
has an alternate suggestion that will adapt to restoring any message type,
I'm interested in the suggestion.
public void fromApp(Message msg, SessionID sessionID)
{
System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss.FFFF") +
" FromApp:" + sessionID.ToString() + "\t" + msg.ToString());
try
{
string message = msg.ToString();
Message newMessage = new Message();
foreach(Field fld in msg.getHeader())
{
newMessage.getHeader().setField(fld.getField(),
fld.getObject().ToString());
}
foreach (Field fld in msg)
{
newMessage.setField(fld.getField(),
fld.getObject().ToString());
}
crack(msg, sessionID);
try
{
crack(newMessage, sessionID);
}
catch (Exception e2)
{
System.Diagnostics.Debug.WriteLine(e2.ToString());
System.Diagnostics.Debug.WriteLine(msg.ToString() ==
newMessage.ToString());
System.Diagnostics.Debug.WriteLine("orig: " +
msg.ToString());
System.Diagnostics.Debug.WriteLine("new: " +
newMessage.ToString());
System.Diagnostics.Debug.WriteLine("round trip failed");
}
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.ToString());
}
}
public override void onMessage(QuickFix42.NewOrderSingle message, SessionID
session)
{
System.Diagnostics.Debug.WriteLine("New Order Single");
}
output:
14:30:47.4179 FromApp:FIX.4.2:SCTC->SCT1
8=FIX.4.29=18035=D34=249=SCT152=20110519-18:30:47.41756=SCTC11=SCT20110519-143047_0000218=121=138=20040=154=155=IBM58=SCT20110519-143047_0000259=060=20110519-14:30:47100=DB-SMART10=013
New Order Single
A first chance exception of type 'QuickFix.UnsupportedMessageType' occurred
in quickfix_net_messages.dll
QuickFix.UnsupportedMessageType: Exception of type
'QuickFix.UnsupportedMessageType' was thrown.
at QuickFix42.MessageCracker.onMessage(Message message, SessionID
session)
at QuickFix42.MessageCracker.crack(Message message, SessionID sessionID)
at FIXServer.FIXServerApp.fromApp(Message msg, SessionID sessionID) in
C:\Dev\Abaraff\FIXServer\FIXServer\FIXServerApp.cs:line 238
True
orig:
8=FIX.4.29=18035=D34=249=SCT152=20110519-18:30:47.41756=SCTC11=SCT20110519-143047_0000218=121=138=20040=154=155=IBM58=SCT20110519-143047_0000259=060=20110519-14:30:47100=DB-SMART10=013
new:
8=FIX.4.29=18035=D34=249=SCT152=20110519-18:30:47.41756=SCTC11=SCT20110519-143047_0000218=121=138=20040=154=155=IBM58=SCT20110519-143047_0000259=060=20110519-14:30:47100=DB-SMART10=013
round trip failed
--
View this message in context: http://old.nabble.com/Cracking-non-typesafe-message-in-.Net-fails-tp31664242p31664242.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: abaraff <ab...@ra...> - 2011-05-18 19:59:39
|
Creating a Message using the new Message(string) constructor doesn't return
an identical message to the original. It modifies and increments a number
of things.
Executing the following code:
public void fromApp(Message msg, SessionID sessionID)
{
try
{
string message = msg.ToString();
Message nm = new Message(message);
crack(msg, sessionID);
try
{
crack(newMessage, sessionID);
}
catch (Exception e2)
{
Debug.WriteLine(e2.ToString());
Debug.WriteLine("orig: " + msg.ToXML());
Debug.WriteLine("new: " + nm.ToXML());
Debug.WriteLine("round trip failed");
}
}
catch (Exception e)
{
Debug.WriteLine(e.ToString());
}
}
Gives the following output:
A first chance exception of type 'QuickFix.UnsupportedMessageType' occurred
in quickfix_net_messages.dll
orig: <message>
<header>
<field number="8"><![CDATA[FIX.4.2]]></field>
<field number="9"><![CDATA[257]]></field>
<field number="35"><![CDATA[8]]></field>
<field number="34"><![CDATA[2]]></field>
<field number="49"><![CDATA[SCTC]]></field>
<field number="52"><![CDATA[20110518-19:39:08.402]]></field>
<field number="56"><![CDATA[SCT1]]></field>
</header>
<body>
<field number="6"><![CDATA[0.0000]]></field>
<field number="11"><![CDATA[SCT20110518-153908_00000]]></field>
<field number="14"><![CDATA[0]]></field>
<field number="17"><![CDATA[1839597056]]></field>
<field number="18"><![CDATA[1]]></field>
<field number="20"><![CDATA[0]]></field>
<field number="21"><![CDATA[1]]></field>
<field number="31"><![CDATA[0.0000]]></field>
<field number="32"><![CDATA[0]]></field>
<field number="37"><![CDATA[110518-193902-3]]></field>
<field number="38"><![CDATA[200]]></field>
<field number="39"><![CDATA[0]]></field>
<field number="40"><![CDATA[1]]></field>
<field number="54"><![CDATA[1]]></field>
<field number="55"><![CDATA[IBM]]></field>
<field number="58"><![CDATA[SCT20110518-153908_00000]]></field>
<field number="59"><![CDATA[0]]></field>
<field number="60"><![CDATA[20110518-19:39:02.590]]></field>
<field number="150"><![CDATA[0]]></field>
<field number="151"><![CDATA[200]]></field>
</body>
<trailer>
<field number="10"><![CDATA[058]]></field>
</trailer>
</message>
new: <message>
<header>
<field number="8"><![CDATA[FIX.4.2]]></field>
<field number="9"><![CDATA[258]]></field>
<field number="35"><![CDATA[8]]></field>
<field number="34"><![CDATA[71]]></field>
<field number="49"><![CDATA[DBSI]]></field>
<field number="52"><![CDATA[20110518-19:39:02.591]]></field>
<field number="56"><![CDATA[SCTC]]></field>
</header>
<body>
<field number="6"><![CDATA[0.0000]]></field>
<field number="11"><![CDATA[SCT20110518-153908_00000]]></field>
<field number="14"><![CDATA[0]]></field>
<field number="17"><![CDATA[1839597056]]></field>
<field number="18"><![CDATA[1]]></field>
<field number="20"><![CDATA[0]]></field>
<field number="21"><![CDATA[1]]></field>
<field number="31"><![CDATA[0.0000]]></field>
<field number="32"><![CDATA[0]]></field>
<field number="37"><![CDATA[110518-193902-3]]></field>
<field number="38"><![CDATA[200]]></field>
<field number="39"><![CDATA[0]]></field>
<field number="40"><![CDATA[1]]></field>
<field number="54"><![CDATA[1]]></field>
<field number="55"><![CDATA[IBM]]></field>
<field number="58"><![CDATA[SCT20110518-153908_00000]]></field>
<field number="59"><![CDATA[0]]></field>
<field number="60"><![CDATA[20110518-19:39:02.590]]></field>
<field number="150"><![CDATA[0]]></field>
<field number="151"><![CDATA[200]]></field>
</body>
<trailer>
<field number="10"><![CDATA[123]]></field>
</trailer>
</message>
round trip failed
Many of the header values have been changed:
Field 9 from 257 to 258.
Field 34 from 2 to 71.
Field 49from "SCTC" to "DBSI"
Field 52 from 20110518-19:39:08.402 to CDATA[20110518-19:39:02.591
Is this intended behavior? If so then why? It seems exceptionally counter
intuitive that an object constructor should selectively modify data supplied
to its constructor.
Thanks,
Anthony
Not that it matters, but I'm attempting to persist the messages then push
them back through my application to restore state since there is no inbuilt
mechanism within QuickFIX.
--
View this message in context: http://old.nabble.com/.Net-Message-can%27t-make-round-trip-from-Message-to-string-and-back-to-Message-tp31640827p31650349.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: abaraff <ab...@ra...> - 2011-05-17 19:01:29
|
I'd like to reprocess all the existing messages I've previously received when
starting a session. I've tried both directly calling crack() on them as
well as forcing them through my fromApp callback. Either way I get
UnsupportedMessageType exceptions on MessageTypes that I have onMessage
methods for--it's important to note that all the code works fine when
QuickFIX initially sends these messages in via the fromApp method. My
onCreate method looks like this:
public void onCreate(SessionID sessionID)
{
MessageStore ms = Session.lookupSession(sessionID).getStore();
System.Collections.ArrayList messages = new
System.Collections.ArrayList();
ms.get(1, Math.Max(ms.getNextSenderMsgSeqNum() - 1,
ms.getNextTargetMsgSeqNum() - 1), messages);
System.Diagnostics.Debug.WriteLine(messages.Count + " found for
" + sessionID.ToString());
foreach (string message in messages)
{
Message msg = new Message(message);
MsgType type = new MsgType();
msg.getHeader().getField(type);
System.Diagnostics.Debug.WriteLine(type.ToString());
System.Diagnostics.Debug.WriteLine(msg.isAdmin() + "\t" +
msg.getHeader().getInt(MsgSeqNum.FIELD) + "\t" + type.ToString());
fromApp(msg, sessionID);
}
System.Diagnostics.Debug.WriteLine("OnCreate:" +
sessionID.ToString());
}
fromApp looks like this:
public void fromApp(Message msg, SessionID sessionID)
{
System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss.FFFF") +
" FromApp:" + sessionID.ToString() + "\t" + msg.ToString());
try
{
crack(msg, sessionID);
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.ToString());
}
}
And I have the following cracker overrides:
public override void onMessage(QuickFix42.ExecutionReport message,
SessionID session)
{
System.Diagnostics.Debug.WriteLine("Execution Report");
}
public override void onMessage(QuickFix42.OrderCancelReject message,
SessionID session)
{
System.Diagnostics.Debug.WriteLine("Cancel Rejected");
}
public override void onMessage(QuickFix42.Reject message, SessionID
session)
{
System.Diagnostics.Debug.WriteLine("Something Rejected");
}
public override void onMessage(QuickFix42.ResendRequest message,
SessionID session)
{
System.Diagnostics.Debug.WriteLine("Resend Requested");
}
public override void onMessage(QuickFix42.NewOrderSingle message,
SessionID session)
{
System.Diagnostics.Debug.WriteLine("New Order Single");
}
Here is some of the output(D is NewOrderSingle and I have an onMessageMethod
for NewOrderSingle):
D
False 2 D
14:40:00.5585 FromApp:FIX.4.2:SCTC->DBSI
8=FIX.4.29=18035=D34=249=SCTC52=20110517-17:38:46.77656=DBSI11=SCT20110517-133846_0000018=121=138=20040=154=155=IBM58=SCT20110517-133846_0000059=060=20110517-13:38:46100=DB-SMART10=040
A first chance exception of type 'QuickFix.UnsupportedMessageType' occurred
in quickfix_net_messages.dll
QuickFix.UnsupportedMessageType: Exception of type
'QuickFix.UnsupportedMessageType' was thrown.
at QuickFix42.MessageCracker.onMessage(Message message, SessionID
session)
at QuickFix42.MessageCracker.crack(Message message, SessionID sessionID)
at FIXServer.FIXServerApp.fromApp(Message msg, SessionID sessionID) in
C:\Dev\Abaraff\FIXServer\FIXServer\FIXServerApp.cs:line 209
D
False 3 D
14:40:00.5742 FromApp:FIX.4.2:SCTC->DBSI
8=FIX.4.29=18035=D34=349=SCTC52=20110517-17:38:49.93356=DBSI11=SCT20110517-133849_0000118=121=138=20040=154=255=IBM58=SCT20110517-133849_0000159=060=20110517-13:38:49100=DB-SMART10=051
A first chance exception of type 'QuickFix.UnsupportedMessageType' occurred
in quickfix_net_messages.dll
QuickFix.UnsupportedMessageType: Exception of type
'QuickFix.UnsupportedMessageType' was thrown.
at QuickFix42.MessageCracker.onMessage(Message message, SessionID
session)
at QuickFix42.MessageCracker.crack(Message message, SessionID sessionID)
at FIXServer.FIXServerApp.fromApp(Message msg, SessionID sessionID) in
C:\Dev\Abaraff\FIXServer\FIXServer\FIXServerApp.cs:line 209
--
View this message in context: http://old.nabble.com/Can%27t-Crack-a-message-created-from-the-MessageStore-tp31640827p31640827.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: abaraff <ab...@ra...> - 2011-05-12 15:43:04
|
I'm trying to use the .Net version and have managed to setup initiators and acceptors, connect to remote Engines as well as my own, send messages, receive messages and crack messages so some of the basics are working. I've gone through the scant documentation, have browsed the class structure and have done about a thousand google searches, but I'm having trouble understanding how QuickFIX is supposed work/deal with various situations. Is there some functional documentation that exists? A book? A few of the things I can't figure out: Is there a built-class for accessing messages that have been written by the FileLogFactory? Am I expected to re-parse this on my own? I don't mind doing that, but it seems like the system is probably already doing this somewhere. I've looked at all the Session class methods and LogFactory methods and don't see anything exposed that looks like it's relevant. In the events log I can see that there are resends being done when the system starts but I don't see any callbacks to my QuickFix.Application object in response to them. I don't have any problems getting callbacks after this resyncing has taken place however. Is this expected behavior? How does QuickFIX Decide which messages it will call me back on and which ones it will hide. Is there a way to have the application call me back with every message for the session that was received by the previous instance of the application on restart? If I manually send a ResendRequest, should I get called back when the messages arrive or are they bypassed for some reason? Thanks, Anthony -- View this message in context: http://old.nabble.com/QuickFIX-Functional-Documentation-Expected-behaviors--tp31603621p31603621.html Sent from the QuickFIX - User mailing list archive at Nabble.com. |
|
From: mguo <mg...@dv...> - 2011-05-12 11:34:42
|
Hi, I'm trying to run the 2 example applications tradeclient and executor with MySQL as the storage and logging options. I ran the MySQL configuration batch file, and both applications compiled fine, but when I try to run either programs, I get the error: "Configuration failed: Unable to connect to database [MySQL server has gone away]" Both programs were up and running fine with file based storage and logging but this error always comes up when I try to run them with MySQL storage and logging. I'm using the default MySQL configuration, the example applications have the default MySQL settings set as per the documentation, all of the applications including the MySQL server are running on the same machine, and I can see that the databases and tables are properly setup using the MySQL command line client. Can anyone give me an idea of where to look or what's causing this? Thanks Mike -- View this message in context: http://old.nabble.com/QuickfFIX-with-MySQL-tp31602206p31602206.html Sent from the QuickFIX - User mailing list archive at Nabble.com. |
|
From: John V. <jva...@co...> - 2011-05-11 14:22:16
|
I highly recommend signing up on the FIX Protocol website, downloading the 4.2 specification, and going over the Resend logic outlined there. Since you're logging in with ResetSeqNumFlag (141) set to Y, there's really nothing to ask for. Also, I don't think you can send a BeginSeqNo of 0, but check. QuickFIX will handle Resends automatically without a programmer having to do anything, if in fact SeqNums are out of sync. John Vatianou Connamara Systems, LLC On Wed, May 11, 2011 at 8:36 AM, abaraff <ab...@ra...> wrote: > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > There must be something that I'm missing. When I logon I'm having my > CLIENT > send a resend request: > > public void onLogon(SessionID sessionID) > { > System.Diagnostics.Debug.WriteLine("OnLogon:" + > sessionID.ToString()); > _sessionID = sessionID; > QuickFix42.ResendRequest resend = new > QuickFix42.ResendRequest(new BeginSeqNo(0), new EndSeqNo(0)); > System.Diagnostics.Debug.WriteLine("Sending Resend"); > Session.sendToTarget(resend, sessionID); > } > > It's being received by my SERVER: > > FromAdmin:FIX.4.2:SCTC->SCT1 > 8=FIX.4.2 9=69 35=A 34=1 49=SCT1 52=20110511-13:23:47.365 56=SCTC 98=0 > 108=60 141=Y 10=120 > ToAdmin:FIX.4.2:SCTC->SCT1 > 8=FIX.4.2 9=69 35=A 34=1 49=SCTC 52=20110511-13:23:47.427 56=SCT1 98=0 > 108=60 141=Y 10=119 > OnLogon:FIX.4.2:SCTC->SCT1 > FromAdmin:FIX.4.2:SCTC->SCT1 > 8=FIX.4.2 9=60 35=2 34=2 49=SCT1 52=20110511-13:23:47.458 56=SCTC 7=0 16=0 > 10=149 > Resend Requested > ToAdmin:FIX.4.2:SCTC->SCT1 > 8=FIX.4.2 9=93 35=4 34=1 43=Y 49=SCTC 52=20110511-13:23:47.474 56=SCT1 > 122=20110511-13:23:47.474 36=2 123=Y 10=036 > > But I'm not seeing any events on the CLIENT application that correspond to > messages that I've previously sent the server from the CLIENT or messages > that the SERVER has sent the CLIENT. > > Maybe I'm using the FileStoreFactory or FileLogFactory incorrectly? Right > now the FileStoreFactory uses the same destination directory every day and > the FileLogFactory uses a different directory every time I start the app. > Should I always provide it with the same directory? > > Also, what are the methods for accessing previous messages? I didn't see > anything obvious in the Log object of the Session, or should I be storing > them in a list for later use? > > Thanks, > > Anthony > > > John Vatianou wrote: > > > > QuickFIX Documentation: > > http://www.quickfixengine.org/quickfix/doc/html/index.html > > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > > > It's pretty standard FIX to have an EndSeqNo be 0 (infinity). This way, > > you > > don't have to worry about the end, you just specify the beginning. > > > > But since it sounds like CLIENT needs to get everything anyway, maybe > > implementing a SERVER method that overloads onLogon to send everything to > > the CLIENT automatically is the way to go, instead of forcing the CLIENT > > to > > do a Resend Request. > > > > John Vatianou > > Connamara Systems, LLC > > www.connamara.com > > > > On Tue, May 10, 2011 at 3:12 PM, abaraff <ab...@ra...> wrote: > > > >> QuickFIX Documentation: > >> http://www.quickfixengine.org/quickfix/doc/html/index.html > >> QuickFIX Support: http://www.quickfixengine.org/services.html > >> > >> > >> I'm using QuickFix for .Net and I have one application that acts as an > >> intermediary (I'll call it the SERVER). This application has a > >> connection > >> to the broker (BROKER) and listens for an incoming connection from a > >> client > >> application (CLIENT). When the CLIENT reconnects, I'd like to get a > full > >> playback of the NewOrderSubmits and ExecutionReports that have taken > >> place > >> that day. I assume that I should just send a ResendRequest from the > >> CLIENT > >> to the SERVER. I assume the BeginSeqNo is 0. How do I know what the > >> EndSeqNo is? Does QuickFix's internal logic on the SERVER automatically > >> handle resending these messages or do I have to do it myself? > >> > >> What happens if the SERVER shuts down? I'm using the FileStoreFactory > >> and > >> FileLogFactory. Does QuickFIX automatically retrieve prior messages > from > >> these logs or do I have to manually load the messages. Also what needs > >> to > >> be done to get any messages from the BROKER that have been dropped > >> between > >> the last message stored in the log and the reconnect. > >> > >> I realize there are some very open ended questions here, but I'm really > >> not > >> sure where to start looking. If you point me in the right direction I'm > >> sure I can figure it out myself. I just have know way of knowing what > >> default behavior is. > >> > >> Thanks, > >> > >> Anthony > >> -- > >> View this message in context: > >> http://old.nabble.com/How-do-resends-work--tp31588898p31588898.html > >> Sent from the QuickFIX - User mailing list archive at Nabble.com. > >> > >> > >> > >> > ------------------------------------------------------------------------------ > >> Achieve unprecedented app performance and reliability > >> What every C/C++ and Fortran developer should know. > >> Learn how Intel has extended the reach of its next-generation tools > >> to help boost performance applications - inlcuding clusters. > >> http://p.sf.net/sfu/intel-dev2devmay > >> _______________________________________________ > >> Quickfix-users mailing list > >> Qui...@li... > >> https://lists.sourceforge.net/lists/listinfo/quickfix-users > >> > > > > > ------------------------------------------------------------------------------ > > Achieve unprecedented app performance and reliability > > What every C/C++ and Fortran developer should know. > > Learn how Intel has extended the reach of its next-generation tools > > to help boost performance applications - inlcuding clusters. > > http://p.sf.net/sfu/intel-dev2devmay > > _______________________________________________ > > Quickfix-users mailing list > > Qui...@li... > > https://lists.sourceforge.net/lists/listinfo/quickfix-users > > > > > > -- > View this message in context: > http://old.nabble.com/How-do-resends-work--tp31588898p31594299.html > Sent from the QuickFIX - User mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > Achieve unprecedented app performance and reliability > What every C/C++ and Fortran developer should know. > Learn how Intel has extended the reach of its next-generation tools > to help boost performance applications - inlcuding clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > |
|
From: abaraff <ab...@ra...> - 2011-05-11 13:36:15
|
There must be something that I'm missing. When I logon I'm having my CLIENT
send a resend request:
public void onLogon(SessionID sessionID)
{
System.Diagnostics.Debug.WriteLine("OnLogon:" +
sessionID.ToString());
_sessionID = sessionID;
QuickFix42.ResendRequest resend = new
QuickFix42.ResendRequest(new BeginSeqNo(0), new EndSeqNo(0));
System.Diagnostics.Debug.WriteLine("Sending Resend");
Session.sendToTarget(resend, sessionID);
}
It's being received by my SERVER:
FromAdmin:FIX.4.2:SCTC->SCT1
8=FIX.4.29=6935=A34=149=SCT152=20110511-13:23:47.36556=SCTC98=0108=60141=Y10=120
ToAdmin:FIX.4.2:SCTC->SCT1
8=FIX.4.29=6935=A34=149=SCTC52=20110511-13:23:47.42756=SCT198=0108=60141=Y10=119
OnLogon:FIX.4.2:SCTC->SCT1
FromAdmin:FIX.4.2:SCTC->SCT1
8=FIX.4.29=6035=234=249=SCT152=20110511-13:23:47.45856=SCTC7=016=010=149
Resend Requested
ToAdmin:FIX.4.2:SCTC->SCT1
8=FIX.4.29=9335=434=143=Y49=SCTC52=20110511-13:23:47.47456=SCT1122=20110511-13:23:47.47436=2123=Y10=036
But I'm not seeing any events on the CLIENT application that correspond to
messages that I've previously sent the server from the CLIENT or messages
that the SERVER has sent the CLIENT.
Maybe I'm using the FileStoreFactory or FileLogFactory incorrectly? Right
now the FileStoreFactory uses the same destination directory every day and
the FileLogFactory uses a different directory every time I start the app.
Should I always provide it with the same directory?
Also, what are the methods for accessing previous messages? I didn't see
anything obvious in the Log object of the Session, or should I be storing
them in a list for later use?
Thanks,
Anthony
John Vatianou wrote:
>
> QuickFIX Documentation:
> http://www.quickfixengine.org/quickfix/doc/html/index.html
> QuickFIX Support: http://www.quickfixengine.org/services.html
>
>
> It's pretty standard FIX to have an EndSeqNo be 0 (infinity). This way,
> you
> don't have to worry about the end, you just specify the beginning.
>
> But since it sounds like CLIENT needs to get everything anyway, maybe
> implementing a SERVER method that overloads onLogon to send everything to
> the CLIENT automatically is the way to go, instead of forcing the CLIENT
> to
> do a Resend Request.
>
> John Vatianou
> Connamara Systems, LLC
> www.connamara.com
>
> On Tue, May 10, 2011 at 3:12 PM, abaraff <ab...@ra...> wrote:
>
>> QuickFIX Documentation:
>> http://www.quickfixengine.org/quickfix/doc/html/index.html
>> QuickFIX Support: http://www.quickfixengine.org/services.html
>>
>>
>> I'm using QuickFix for .Net and I have one application that acts as an
>> intermediary (I'll call it the SERVER). This application has a
>> connection
>> to the broker (BROKER) and listens for an incoming connection from a
>> client
>> application (CLIENT). When the CLIENT reconnects, I'd like to get a full
>> playback of the NewOrderSubmits and ExecutionReports that have taken
>> place
>> that day. I assume that I should just send a ResendRequest from the
>> CLIENT
>> to the SERVER. I assume the BeginSeqNo is 0. How do I know what the
>> EndSeqNo is? Does QuickFix's internal logic on the SERVER automatically
>> handle resending these messages or do I have to do it myself?
>>
>> What happens if the SERVER shuts down? I'm using the FileStoreFactory
>> and
>> FileLogFactory. Does QuickFIX automatically retrieve prior messages from
>> these logs or do I have to manually load the messages. Also what needs
>> to
>> be done to get any messages from the BROKER that have been dropped
>> between
>> the last message stored in the log and the reconnect.
>>
>> I realize there are some very open ended questions here, but I'm really
>> not
>> sure where to start looking. If you point me in the right direction I'm
>> sure I can figure it out myself. I just have know way of knowing what
>> default behavior is.
>>
>> Thanks,
>>
>> Anthony
>> --
>> View this message in context:
>> http://old.nabble.com/How-do-resends-work--tp31588898p31588898.html
>> Sent from the QuickFIX - User mailing list archive at Nabble.com.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Achieve unprecedented app performance and reliability
>> What every C/C++ and Fortran developer should know.
>> Learn how Intel has extended the reach of its next-generation tools
>> to help boost performance applications - inlcuding clusters.
>> http://p.sf.net/sfu/intel-dev2devmay
>> _______________________________________________
>> Quickfix-users mailing list
>> Qui...@li...
>> https://lists.sourceforge.net/lists/listinfo/quickfix-users
>>
>
> ------------------------------------------------------------------------------
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> Quickfix-users mailing list
> Qui...@li...
> https://lists.sourceforge.net/lists/listinfo/quickfix-users
>
>
--
View this message in context: http://old.nabble.com/How-do-resends-work--tp31588898p31594299.html
Sent from the QuickFIX - User mailing list archive at Nabble.com.
|
|
From: John V. <jva...@co...> - 2011-05-10 20:23:03
|
It's pretty standard FIX to have an EndSeqNo be 0 (infinity). This way, you don't have to worry about the end, you just specify the beginning. But since it sounds like CLIENT needs to get everything anyway, maybe implementing a SERVER method that overloads onLogon to send everything to the CLIENT automatically is the way to go, instead of forcing the CLIENT to do a Resend Request. John Vatianou Connamara Systems, LLC www.connamara.com On Tue, May 10, 2011 at 3:12 PM, abaraff <ab...@ra...> wrote: > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > I'm using QuickFix for .Net and I have one application that acts as an > intermediary (I'll call it the SERVER). This application has a connection > to the broker (BROKER) and listens for an incoming connection from a client > application (CLIENT). When the CLIENT reconnects, I'd like to get a full > playback of the NewOrderSubmits and ExecutionReports that have taken place > that day. I assume that I should just send a ResendRequest from the CLIENT > to the SERVER. I assume the BeginSeqNo is 0. How do I know what the > EndSeqNo is? Does QuickFix's internal logic on the SERVER automatically > handle resending these messages or do I have to do it myself? > > What happens if the SERVER shuts down? I'm using the FileStoreFactory and > FileLogFactory. Does QuickFIX automatically retrieve prior messages from > these logs or do I have to manually load the messages. Also what needs to > be done to get any messages from the BROKER that have been dropped between > the last message stored in the log and the reconnect. > > I realize there are some very open ended questions here, but I'm really not > sure where to start looking. If you point me in the right direction I'm > sure I can figure it out myself. I just have know way of knowing what > default behavior is. > > Thanks, > > Anthony > -- > View this message in context: > http://old.nabble.com/How-do-resends-work--tp31588898p31588898.html > Sent from the QuickFIX - User mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > Achieve unprecedented app performance and reliability > What every C/C++ and Fortran developer should know. > Learn how Intel has extended the reach of its next-generation tools > to help boost performance applications - inlcuding clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > |
|
From: Kenny S. <ks...@co...> - 2011-05-10 20:21:24
|
Should be entirely automatic for client and server. -- Kenny Stone Connamara Systems, LLC On Tue, May 10, 2011 at 3:12 PM, abaraff <ab...@ra...> wrote: > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > I'm using QuickFix for .Net and I have one application that acts as an > intermediary (I'll call it the SERVER). This application has a connection > to the broker (BROKER) and listens for an incoming connection from a client > application (CLIENT). When the CLIENT reconnects, I'd like to get a full > playback of the NewOrderSubmits and ExecutionReports that have taken place > that day. I assume that I should just send a ResendRequest from the CLIENT > to the SERVER. I assume the BeginSeqNo is 0. How do I know what the > EndSeqNo is? Does QuickFix's internal logic on the SERVER automatically > handle resending these messages or do I have to do it myself? > > What happens if the SERVER shuts down? I'm using the FileStoreFactory and > FileLogFactory. Does QuickFIX automatically retrieve prior messages from > these logs or do I have to manually load the messages. Also what needs to > be done to get any messages from the BROKER that have been dropped between > the last message stored in the log and the reconnect. > > I realize there are some very open ended questions here, but I'm really not > sure where to start looking. If you point me in the right direction I'm > sure I can figure it out myself. I just have know way of knowing what > default behavior is. > > Thanks, > > Anthony > -- > View this message in context: > http://old.nabble.com/How-do-resends-work--tp31588898p31588898.html > Sent from the QuickFIX - User mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > Achieve unprecedented app performance and reliability > What every C/C++ and Fortran developer should know. > Learn how Intel has extended the reach of its next-generation tools > to help boost performance applications - inlcuding clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > |
|
From: abaraff <ab...@ra...> - 2011-05-10 20:12:49
|
I'm using QuickFix for .Net and I have one application that acts as an intermediary (I'll call it the SERVER). This application has a connection to the broker (BROKER) and listens for an incoming connection from a client application (CLIENT). When the CLIENT reconnects, I'd like to get a full playback of the NewOrderSubmits and ExecutionReports that have taken place that day. I assume that I should just send a ResendRequest from the CLIENT to the SERVER. I assume the BeginSeqNo is 0. How do I know what the EndSeqNo is? Does QuickFix's internal logic on the SERVER automatically handle resending these messages or do I have to do it myself? What happens if the SERVER shuts down? I'm using the FileStoreFactory and FileLogFactory. Does QuickFIX automatically retrieve prior messages from these logs or do I have to manually load the messages. Also what needs to be done to get any messages from the BROKER that have been dropped between the last message stored in the log and the reconnect. I realize there are some very open ended questions here, but I'm really not sure where to start looking. If you point me in the right direction I'm sure I can figure it out myself. I just have know way of knowing what default behavior is. Thanks, Anthony -- View this message in context: http://old.nabble.com/How-do-resends-work--tp31588898p31588898.html Sent from the QuickFIX - User mailing list archive at Nabble.com. |
|
From: Phil <ph...@me...> - 2011-05-10 17:14:35
|
I've been trying for the past week to make an application using QuickFIX Ruby and I'm having a weird problem. I posted a message earlier this week to try to figure out if I was coding my application the wrong way but now I know I'm not.
Here is a snippet of my code:
----
settings = Quickfix::SessionSettings.new("quickfix.conf") # HeartBeat is set to 30 seconds
application = Quickfix_Application.new
storeFactory = Quickfix::FileStoreFactory.new(settings)
logFactory = Quickfix::ScreenLogFactory.new(settings)
initiator = Quickfix::SocketInitiator.new(application, storeFactory, settings, logFactory)
initiator.start
while true
puts "Hello!"
sleep(1)
end
initiator.stop
----
The I have is the command "puts Hello" gets executed once every 30 seconds, which is the HeartBeat timeout, instead of every second. I coded the same exact thing in Python and it works as expected (outputs Hello every second).
Does anybody encountered this problem with Quickfix-Ruby?
- Phil
|
|
From: <ma...@ma...> - 2011-05-08 03:36:59
|
Does the tradeclient example program work for you? If so, it's your code... Martin |
|
From: Phil M. <ph...@me...> - 2011-05-07 12:48:56
|
Interesting, I just checked the code and it is essentially what I have coded however the code inside my while loop is only triggered once every heartbeat meaning if my heartbeat is set to 30 seconds, the code will get triggered once every 30 seconds. Based on the example you sent me I'm assuming that there is something wrong with my code because the loop should be like any other loop correct? - Phil On May 7, 2011, at 7:02 PM, "ma...@ma..." <ma...@ma...> wrote: > On Sat, May 07, 2011 at 06:38:52PM +0700, Phil Michaud wrote: >> The part where I'm still confused with is where in my QuickFIX >> application that I need to write the code to poll the commands. Any >> idea? > > Have a look at line 91 of: > > http://quickfix.svn.sourceforge.net/viewvc/quickfix/trunk/quickfix/examples/tradeclient/Application.cpp?revision=2076&view=markup > > ...called from line 57 of: > > http://quickfix.svn.sourceforge.net/viewvc/quickfix/trunk/quickfix/examples/tradeclient/tradeclient.cpp?revision=2241&view=markup > > Seems like a simple place to start. > >> - Phil > > Martin |