{{Quickfixn}} How to prevent rejection of message missing an *optional* field.

Grant Birchmeier gbirchmeier at connamara.com
Fri Jan 10 22:53:28 PST 2014


DO NOT set UseDataDictionary to "N" !!!   It won't fix your problem, and
it'll break any repeating groups also.

The engine is operating correctly.  The problem is your code.  I'm guessing
you're calling "message.LastPx" (or "GetField(31)" or whatever) without
actually checking that LastPx is in the message.

If you attempt to extract a field and it's not set, the engine assumes
that, since you expected the field to be there, it was conditionally
required.  (Not *always* required, but conditionally required, which means
it's only required in certain circumstances that the engine can't know.)

That is today, the engine is trusting that *your* code is correct, and that
the other party has violated *your* requirement.

It appears that you want 31 to be completely optional.  In that case, you
must check to see if it's present before you extract it, e.g.

    if(message.IsSetLastPx)
        lastPx = message.LastPx.Value;  // or whatever

(Pardon me if I didn't get the function names exactly right.)



On Fri, Jan 10, 2014 at 6:21 PM, Manuel Lopez <lopez.post at gmail.com> wrote:

> I think I'll set UseDataDictionary to "N."
>
>
> _______________________________________________
> Quickfixn mailing list
> 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/20140111/45c695ab/attachment-0001.htm>


More information about the Quickfixn mailing list