Thread: [Quickfix-developers] catch getField business rejects
Brought to you by:
orenmnero
|
From: John G. <joh...@wa...> - 2005-11-21 17:49:02
|
Hi there,
The more different Fix engines I connect to, the more I see that no one
cares about conditionnaly required fields. So very often, I use a
getField() method that fails and sends a Business Reject. The counterparty
then complains about this (well of course, they don't send the correct
data so it's only logical they should complain when they are told they
don't). Anyway, I'd rather not have to always use the
if(isSetField(...)){getField()...} construct when I *know* the message is
supposed to have the tag, but at the same time, manage the error myself.
What would be the central point for catching which exception to do that ?
The fromApp() method catching FIX::FieldNotFound ?
TIA
JG
|
|
From: Oren M. <or...@qu...> - 2005-11-21 18:18:01
|
Yeah. The fromApp method normally propogates the FieldNotFound error, which the session catches and send a reject indicating the conditionally required field is missing. If you want to handle this yourself, you would wrap the implementation of your method in a try/catch block and trap the exception. You can then handle it yourself, and rethrow if you would like the session to also send its normal reject. --oren John GALLET wrote: >QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html >QuickFIX Support: http://www.quickfixengine.org/services.html > >Hi there, > >The more different Fix engines I connect to, the more I see that no one >cares about conditionnaly required fields. So very often, I use a >getField() method that fails and sends a Business Reject. The counterparty >then complains about this (well of course, they don't send the correct >data so it's only logical they should complain when they are told they >don't). Anyway, I'd rather not have to always use the >if(isSetField(...)){getField()...} construct when I *know* the message is >supposed to have the tag, but at the same time, manage the error myself. > >What would be the central point for catching which exception to do that ? >The fromApp() method catching FIX::FieldNotFound ? > >TIA >JG > > > > >------------------------------------------------------- >This SF.Net email is sponsored by the JBoss Inc. Get Certified Today >Register for a JBoss Training Course. Free Certification Exam >for All Training Attendees Through End of 2005. For more info visit: >http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click >_______________________________________________ >Quickfix-developers mailing list >Qui...@li... >https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > |
|
From: Reiner N. <rei...@ma...> - 2005-11-22 10:14:20
|
Hi there, it would be wounderfull to use simple Java bean approach. Having get and set method without throwing an exception but able to manage null values. So a setFieldXXX (null) should suppress submitting the value in the FIX message where getFieldXXX() for an unset value should return null. Cheers Reiner > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX > Support: http://www.quickfixengine.org/services.html > > Hi there, > > The more different Fix engines I connect to, the more I see that no one > cares about conditionnaly required fields. So very often, I use a > getField() method that fails and sends a Business Reject. The counterparty > then complains about this (well of course, they don't send the correct > data so it's only logical they should complain when they are told they > don't). Anyway, I'd rather not have to always use the > if(isSetField(...)){getField()...} construct when I *know* the message is > supposed to have the tag, but at the same time, manage the error myself. > > What would be the central point for catching which exception to do that ? > The fromApp() method catching FIX::FieldNotFound ? > > TIA > JG > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. Get Certified Today > Register for a JBoss Training Course. Free Certification Exam > for All Training Attendees Through End of 2005. For more info visit: > http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers -- Reiner B. Nix IT-Architect rei...@ma... http://www.macd.com Tel.: +49 (0)241 44597-23 Macdonald Associates GmbH Fax : +49 (0)241 44597-10 Lothringer Str. 52, D-52070 Aachen |
|
From: Caleb E. <cal...@gm...> - 2005-11-22 19:21:50
|
On 11/22/05, Reiner Nix <rei...@ma...> wrote:
>
> Having get and set method without throwing an exception but able to manag=
e
> null values. So a setFieldXXX (null) should suppress submitting the value
> in
> the FIX message where getFieldXXX() for an unset value should return null=
.
I don't think this particular interface would work in C++ (we're dealing
with either FIX::FieldBase or std::string objects and there is no "null").
It would be possible to provide some additional getField/setField overloads
in FieldMap that would do what you want though:
namespace FIX {
struct nothrow {};
class FieldMap {
...
bool getField (FieldBase& field, nothrow) // doesn't throw; returns true is
hasField (field)
bool getField (int field, std::string&) // doesn't throw, returns true if
hasField (field)
I can't really see the value in them, but these could also be added:
bool setField (const FieldBase&, nothrow) // doesn't throw (and has no
effect) if value is empty
bool setField (int field, const std::string& value, nothrow) // same as
above
If people really want these interfaces they'd be very simple to add.
--
Caleb Epstein
caleb dot epstein at gmail dot com
|
|
From: Dale W. <wil...@oc...> - 2005-11-22 20:08:24
|
Hi Caleb (et. al.)
Caleb Epstein wrote:
> On 11/22/05, *Reiner Nix* <rei...@ma...
> <mailto:rei...@ma...>> wrote:
>
> Having get and set method without throwing an exception but able
> to manage
> null values. So a setFieldXXX (null) should suppress submitting
> the value in
> the FIX message where getFieldXXX() for an unset value should
> return null.
>
>
> I don't think this particular interface would work in C++ (we're
> dealing with either FIX::FieldBase or std::string objects and there is
> no "null"). It would be possible to provide some additional
> getField/setField overloads in FieldMap that would do what you want
> though:
>
> namespace FIX {
>
> struct nothrow {};
>
> class FieldMap {
> ...
> bool getField (FieldBase& field, nothrow) // doesn't throw; returns
> true is hasField (field)
> bool getField (int field, std::string&) // doesn't throw, returns
> true if hasField (field)
>
Rather than overload based on a bool (or adding a bool with a default)
I'd much rather see:
bool getOptionalField(FieldBase& field);
This makes it much more obvious (to me anyway) when to use this method:
If the field is optional then it's not an exception for it to be missing.
That being said, I really like the idea, 'cause I'm certainly tired of
typing:
if(message.isSetField(filbert))
{
message.getField(filbert);
etc
}
> I can't really see the value in them, but these could also be added:
>
> bool setField (const FieldBase&, nothrow) // doesn't throw (and
> has no effect) if value is empty
> bool setField (int field, const std::string& value, nothrow) //
> same as above
Agreed, these don't make a whole lot of sense.
Dale
>
> If people really want these interfaces they'd be very simple to add.
>
> --
> Caleb Epstein
> caleb dot epstein at gmail dot com
--
-----------------------------------------------------
Dale Wilson, Senior Software Engineer
Object Computing, Inc. (OCI)
http://www.ociweb.com/ http://www.theaceorb.com/
----------------------------------------------------
|
|
From: John G. <joh...@wa...> - 2005-11-24 13:13:32
|
@all, Thanks for your answers, I'll try (to) catch in the fromApp method. Sincerely, JG |