{{Quickfixn}} Adding Custom Messages

(Eddie) John Jackson eddie at datobyte.com
Wed Mar 6 10:47:05 PST 2019


Thanks for all the information.  It would be nice to have a way to regenerate the classes easily so I will try it.

Eddie

From: Quickfixn <quickfixn-bounces at lists.quickfixn.com> On Behalf Of Grant Birchmeier
Sent: Wednesday, March 6, 2019 11:55 AM
To: Mailing list for QuickFIX/n <quickfixn at lists.quickfixn.com>
Subject: Re: {{Quickfixn}} Adding Custom Messages

Huh, never heard of that package.  Nice if it works!

On Wed, Mar 6, 2019 at 1:09 AM Matthias Güntert <matthias.guentert at raiffeisen.ch<mailto:matthias.guentert at raiffeisen.ch>> wrote:
Hello

Another approach would be to use the NuGet package QuickFix.CustomMessages. It uses T4 templates to generate custom fields, messages, etc. based on your data dictionary.

Best, Matthias

Von: Quickfixn [mailto:quickfixn-bounces at lists.quickfixn.com<mailto:quickfixn-bounces at lists.quickfixn.com>] Im Auftrag von Mike Gatny
Gesendet: Dienstag, 5. März 2019 18:39
An: Mailing list for QuickFIX/n <quickfixn at lists.quickfixn.com<mailto:quickfixn at lists.quickfixn.com>>
Betreff: Re: {{Quickfixn}} Adding Custom Messages

Eddie,

What you've done so far (adding to the data dictionary) is sufficient to cause Message validation to pass (although, make sure the fields you defined on your Message also exist in the <fields> section of the data dictionary.

If you'd like to re-generate the code so that you can use your new Message like any other Message, you must run the generate.bat. This requires ruby and the nokigiri rubygem (instructions are in the README).

If you don't want to bother with code generation, qf/n lets you manually manipulate Messages. For example, if you are receiving this Message, you can add something like the following to FromApp before you call Crack:

public void FromApp(Message message, SessionID sessionID)
{
    string msgType = msg.Header.GetField(Fields.Tags.MsgType);
    if (msgType == "CW")
    {
        // handle QuoteAck message here, e.g.:
        string quoteID = message.GetString(Fields.Tags.QuoteID);
        int quoteAckStatus = message.GetInt(Fields.Tags.QuoteAckStatus);
        // etc... or, call your own method for doing so
    }
    else // carry on as usual for other message types
    {
        Crack(message, sessionID);
    }
}

If you are sending this Message, you can do something like:

Message quoteAckMsg = new Message();
quoteAckMsg.Header.SetField(new QuickFix.Fields.MsgType("CW"));
     quoteAckMsg.SetField(new QuickFix.Fields.QuoteID("1234"));
     // or even looser:
     quoteAckMsg.SetField(new StringField(1328, "RejectText here"));

--
Mike Gatny
Connamara Systems


On Tue, Mar 5, 2019 at 11:44 AM (Eddie) John Jackson <eddie at datobyte.com<mailto:eddie at datobyte.com>> wrote:
I see part of my problem as I was using the dll instead of the QuickFixn project.  But the classes are generated.  I have tried to directly add the new class but that does not seem to work either.

Can someone help with the steps to add a new message to the QuickFixn project to create the classes for the custom message?

Kind Regards,

Eddie

From: Quickfixn <quickfixn-bounces at lists.quickfixn.com<mailto:quickfixn-bounces at lists.quickfixn.com>> On Behalf Of (Eddie) John Jackson
Sent: Tuesday, March 5, 2019 9:34 AM
To: Mailing list for QuickFIX/n <quickfixn at lists.quickfixn.com<mailto:quickfixn at lists.quickfixn.com>>
Subject: {{Quickfixn}} Adding Custom Messages

I have added a custom message to the DataDictionary but I can’t see class or reference it in my code.  Is there anything else that I would need to do to create an instance of the class?  I have cleaned and rebuilt each project.  I assumed that it is created the classes from metadata of the DataDictionary.

    <message name="StreamAssignmentReportACK" msgcat="app" msgtype="CE">
      <field name="StreamAsgnAckType" required="Y"/>
      <field name="StreamAsgnRptID" required="Y"/>
      <field name="StreamAsgnRejReason" required="N"/>
      <field name="Text" required="N"/>
      <field name="EncodedTextLen" required="N"/>
      <field name="EncodedText" required="N"/>
    </message>
    <message name="QuoteAck" msgcat="app" msgtype="CW">
      <field name="QuoteID" required="Y" />
      <field name="QuoteAckStatus" required="Y" />
      <field name="QuoteRejectReason" required="N" />
      <field name="RejectText" required="N" />
    </message>
  </messages>


<value description="STREAMASSIGNMENTREPORTACK" enum="CE"/>
<value description="QUOTEACK" enum="CW"/>
<value description="NEWORDERSINGLE" enum="D"/>
_______________________________________________
Quickfixn mailing list
Quickfixn at lists.quickfixn.com<mailto:Quickfixn at lists.quickfixn.com>
http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com

*****************************************************
This e-mail may contain confidential material. It is intended only for the person or entity which it is addressed to. In case you should not be supposed to get this e-mail we ask you to delete it without taking notice of its content. Any views or opinions expressed in this e-mail are those of the sender and do not necessarily coincide with those of The Swiss Raiffeisen Group. Therefore this e-mail does not represent a binding agreement nor an offer to deal. E-Mail transmission can be insecure and can contain errors. Information could be intercepted, corrupted, lost, destroyed, incomplete or may contain viruses. Neither The Swiss Raiffeisen Group nor the sender can accept any liability for any kind of damage as the result of viruses or transmission errors.
*****************************************************
_______________________________________________
Quickfixn mailing list
Quickfixn at lists.quickfixn.com<mailto:Quickfixn at lists.quickfixn.com>
http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com


--
Grant Birchmeier
Connamara Systems, LLC
Made-To-Measure Trading Solutions.
Exactly what you need. No more. No less.
http://connamara.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20190306/b89d119c/attachment.htm>


More information about the Quickfixn mailing list