<div dir="ltr"><div class="gmail_default" style="font-size:small;color:#000000">You might be able to hack QF/n to accept the message, but you might have trouble extracting the second field.  When you call GetField (or GetString or whatever), it will return the first instance of the field.  There will be no function to return the second instance (because it shouldn't exist in properly-crafted FIX).</div><div class="gmail_default" style="font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-size:small;color:#000000">To get the second instance, you'll probably have to call msg.ToString() and use a regex or something on the result.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 9, 2019 at 2:06 AM Russell Watson <<a href="mailto:russellwatson@gmail.com">russellwatson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks Grant,</div><div><br></div><div>The documentation doesn't detail this wrong use of this field which leads me to believe it is a quirk of their system. I agree 2 unique tags would have been a viable solution.</div><div><br></div><div>I will report this issue to them.</div><div><br></div><div>I can rationalise why they have done it as they are endeavouring to disclose the different fix interest components for a two way quote so 1st relates to SELL and 2nd relates to BUY presumably. It doesn't make it correct and as agreed previously 
2 unique tags would have been a viable solution.</div><div><br></div><div>Another mailing list participant has suggested a work around as he faced the same issue which I intend to pursue -> compile QuickFIX from source
and disable the checks that are identifying this issue.


I considered using another library and located 3 (fix8, hotfix and rapidfix) the most promising fix8 nuget 
package is malformed so that stopped me in my tracks and the other 2 are
 very raw.



</div><div><br></div><div>Rgds</div><div>Russ<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 8 Aug 2019 at 16:22, Grant Birchmeier <<a href="mailto:gbirchmeier@connamara.com" target="_blank">gbirchmeier@connamara.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">Russell,</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">Does your counterparty have documentation that actually specifies that they consider this to be correct behavior?  Do they actually tell you that there will be two 159 tags in one message, and that the first instance means something different than the second one?<br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">If true, it would be very odd.  It implies that someone on their end does not properly understand the FIX specification.  The proper approach would be to simply use 2 unique tags for these 2 values.  Easy!</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">In my 10 years working with FIX, I've seen a lot of weird stuff.  But this is a new one.  (And I don't see a quick hack that would allow QF/n to support it.)</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">I highly recommend that you report this as a bug to your counterparty.  They may blow you off, but if enough of their clients complain, maybe they'll feel the pressure to do it right.</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">-Grant</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 8, 2019 at 1:56 AM Russell Watson <<a href="mailto:russellwatson@gmail.com" target="_blank">russellwatson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks Kevin for the insight much appreciated. Also according to <a href="https://stackoverflow.com/questions/23357620/capturing-incoming-fix-messages-which-fail-quickfix-validation" target="_blank">https://stackoverflow.com/questions/23357620/capturing-incoming-fix-messages-which-fail-quickfix-validation</a> there is no way to capture incoming FIX messages which fail quickfix validation.<div><br></div><div>It looks like unless I can get the counterparty to adapt their wrong use of FIX message I am unable to use QuickFIX/N.</div><div><br></div><div>Hopefully if someone takes on the challenge of building an open source FIX engine for .net core they take on-board that there are many legacy system out there that do strange things.<br><div><br></div><div>Thanks again</div><div>Russell</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 7 Aug 2019 at 15:11, Kevin Carlton <<a href="mailto:kcarlton@k2.ca" target="_blank">kcarlton@k2.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div class="gmail-m_-1494399121189790829gmail-m_3539601243523782799gmail-m_6677098477541307992gmail-m_-3878354472828652120WordSection1">
<p class="MsoNormal">So to be clear, the message below is invalid FIX. You can not handle a tag twice unless it is in a repeating group. This is probably something your counterparty should be correcting. Plus, tag 159 doesn’t really make sense on a Quote Message.
 So something funny is going on.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If all you need is for the message to not be rejected, then maybe you could configure your settings to not use a DataDictionary, and turn off all the validation flags? Not sure if this will work. I think you may still reject.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>From:</b> Quickfixn <<a href="mailto:quickfixn-bounces@lists.quickfixn.com" target="_blank">quickfixn-bounces@lists.quickfixn.com</a>>
<b>On Behalf Of </b>Russell Watson<br>
<b>Sent:</b> Wednesday, August 7, 2019 9:50 AM<br>
<b>To:</b> Mailing list for QuickFIX/n <<a href="mailto:quickfixn@lists.quickfixn.com" target="_blank">quickfixn@lists.quickfixn.com</a>><br>
<b>Subject:</b> Re: {{Quickfixn}} Quote <S> Tag appears more than once<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Thanks Kevin for the prompt response much appreciated.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If I understand correctly then my problem isn't with groups as there is not actually a 9876 tag is the message, I was trying to use groups to allow the use of tag 159 twice. My problem is with the same tag 159 (in yellow bellow) being used
 twice. Any ideas how I handle 159 twice?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">8=FIX.4.2 9=355 35=S 49=xxx 115=xxxx 56=xxxxxx 34=2 52=20190807-10:10:45 43=N 131=OR00999999x001 117=OU1JZXLH8B0000B4 55=TR30 48=GB00B24FF097 22=4 167=CS 207=L 6158=xxxx 537=1 132=136.68 134=250000 188=0.00
<span style="color:black;background:none 0% 0% repeat scroll yellow">159=29.99</span> 133=138.18 135=250000
<span style="color:black;background:none 0% 0% repeat scroll yellow">159=29.66</span> 190=0.00 157=62 60=20190807-10:10:45.457 62=20190807-10:11:15 63=6 64=20190808 15=GBP 120=GBP 9007=1 10=116
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Rgds<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Russell<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, 7 Aug 2019 at 14:30, Kevin Carlton <<a href="mailto:kcarlton@k2.ca" target="_blank">kcarlton@k2.ca</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Russel,
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">You have set up the NoAccruedInterestAmt (9876)  group, with one field AccruedInterestAmt (159). But in the FIX message you provided there is no tag 9876. For the “group” to be
 parsed correctly, there needs to be one 9876 tag for each 159.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">It would like:<u></u><u></u></p>
<p class="MsoNormal">9876=1<u></u><u></u></p>
<p class="MsoNormal">159=29.99<u></u><u></u></p>
<p class="MsoNormal">9786=2<u></u><u></u></p>
<p class="MsoNormal">159=29.66<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">The first 159 field belongs to the 9876=1 group, and the second to the second group.<u></u><u></u></p>
<p class="MsoNormal">In code you can then specify which 9876 group you want, by the number.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><b>From:</b> Quickfixn <<a href="mailto:quickfixn-bounces@lists.quickfixn.com" target="_blank">quickfixn-bounces@lists.quickfixn.com</a>>
<b>On Behalf Of </b>Russell Watson<br>
<b>Sent:</b> Wednesday, August 7, 2019 7:45 AM<br>
<b>To:</b> <a href="mailto:quickfixn@lists.quickfixn.com" target="_blank">quickfixn@lists.quickfixn.com</a><br>
<b>Subject:</b> {{Quickfixn}} Quote <S> Tag appears more than once<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">Hello,<br>
<br>
After many days of research and re-reading (<a href="http://quickfixn.org/tutorial/custom-fields-groups-and-messages.html" target="_blank">http://quickfixn.org/tutorial/custom-fields-groups-and-messages.html</a>) many times and trial and error regrettably I
 have been unable to solve the error of Tag appears more than once in Quote <S> message<br>
<br>
The messages I am receiving<br>
<br>
<incoming> 8=FIX.4.2 9=355 35=S 49=xxx 115=xxxx 56=xxxxxx 34=2 52=20190807-10:10:45 43=N 131=OR00999999x001 117=OU1JZXLH8B0000B4 55=TR30 48=GB00B24FF097 22=4 167=CS 207=L 6158=xxxx 537=1 132=136.68 134=250000 188=0.00 159=29.99 133=138.18 135=250000 159=29.66
 190=0.00 157=62 60=20190807-10:10:45.457 62=20190807-10:11:15 63=6 64=20190808 15=GBP 120=GBP 9007=1 10=116
<br>
<br>
<event> Message 2 Rejected: Tag appears more than once (Field=159)<br>
<br>
I have adapted the DataDictionary countless times with no success e.g.<br>
<br>
<messages><br>
  ...<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<p class="MsoNormal"><message name='Quote' msgtype='S' msgcat='app'><br>
<!-- ... other fields ... --><br>
<group name="NoAccruedInterestAmt" required="N"><br>
      <field name="AccruedInterestAmt" required="N"/><br>
</group><br>
<!-- ... other fields ... --><br>
</message><u></u><u></u></p>
</blockquote>
<p class="MsoNormal">  ...<br>
</messages><br>
...<br>
<fields><br>
  ...<br>
<field number='9876' name='NoAccruedInterestAmt' type='NUMINGROUP'/><br>
<field number='159' name='AccruedInterestAmt' type='AMT' /><br>
</fields> <u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>

_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</blockquote></div>
_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-1494399121189790829gmail-m_3539601243523782799gmail_signature"><div><font size="2"><span style="background-color:rgb(0,0,0)"><span style="background-color:rgb(255,255,255)">Grant Birchmeier</span></span></font><font size="2"><font color="#3333ff"><br></font></font></div><div><font size="2"><b><font color="#3333ff"><span style="background-color:rgb(255,204,51)"><span style="background-color:rgb(255,204,102)"><span style="background-color:rgb(255,204,153)"><span style="background-color:rgb(255,255,255)"><span style="background-color:rgb(255,204,0)">Connamara Systems, LLC</span></span></span></span></span></font></b></font><br></div><div><font size="2"><b>Made-To-Measure Trading Solutions.</b></font></div><div><font size="2">Exactly what you need. No more. No less.</font><font size="2"><b><font color="#3333ff"><br></font></b></font></div><div><font size="2"><a href="http://connamara.com" target="_blank">http://connamara.com</a><br></font></div></div>
_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</blockquote></div>
_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div><font size="2"><span style="background-color:rgb(0,0,0)"><span style="background-color:rgb(255,255,255)">Grant Birchmeier</span></span></font><font size="2"><font color="#3333ff"><br></font></font></div><div><font size="2"><b><font color="#3333ff"><span style="background-color:rgb(255,204,51)"><span style="background-color:rgb(255,204,102)"><span style="background-color:rgb(255,204,153)"><span style="background-color:rgb(255,255,255)"><span style="background-color:rgb(255,204,0)">Connamara Systems, LLC</span></span></span></span></span></font></b></font><br></div><div><font size="2"><b>Made-To-Measure Trading Solutions.</b></font></div><div><font size="2">Exactly what you need. No more. No less.</font><font size="2"><b><font color="#3333ff"><br></font></b></font></div><div><font size="2"><a href="http://connamara.com" target="_blank">http://connamara.com</a><br></font></div></div>