|
From: Toli K. <to...@ma...> - 2006-08-29 18:49:42
|
Alex,
I've tried Steve's suggestion, and it works for me. Here's the pseudocode:
override the fromApp() or fromAdmin() functions:
public void fromApp(Message message, SessionID sessionId) throws
FieldNotFound,
IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType
{
messageCracker.crack(message, sessionId);
}
the messageCracker is a subclass of MessageCracker where you override
the exact onMessage() functions that you need, or just override the
generic function receiving a plain Message like Steve suggests. Here's
an example:
private class MyMessageCracker extends MessageCracker {
/** Handle the incoming new order */
public void onMessage(NewOrderSingle message, SessionID
sessionID) throws FieldNotFound, UnsupportedMessageType,
IncorrectTagValue {
...... code ....
try {
... more code ....
} catch (Exception e) {
LoggerAdapter.error(MessageKey.ERROR_PROCESSING_ORDER.getLocalizedMessage(),
e, this);
try {
rejectOrder(message, e.getMessage(), sessionID);
} catch (NoMoreIDsException e1) {
LoggerAdapter.error(MessageKey.ERROR_NEXT_ORDERID_GEN.getLocalizedMessage(),
e1, this);
}
}
}
hope this helps.
On 8/29/06, Steve Bate <st...@te...> wrote:
> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
> Hi Alex,
>
> Like Toby said, the MessageCracker is intended to be used with
> generated Message subtypes. However, in your application class
> you could override the
>
> public void onMessage(
> quickfix.Message message, SessionID sessionID )
>
> method defined from the message cracker to process your
> custom message instead of it throwing the UnsupportedMessageType.
> I haven't tried this myself, but it looks like it should work.
> This method would be called for any unknown message types.
> Please let us know if you try this solution and it works.
>
> Thanks,
>
> Steve
>
> > -----Original Message-----
> > From: qui...@li...
> > [mailto:qui...@li...] On
> > Behalf Of Alex McGlashan
> > Sent: Tuesday, August 29, 2006 5:01 PM
> > To: qui...@li...
> > Subject: Re: [Quickfixj-users] Adding messages to data dictionary
> >
> > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> > QuickFIX/J Support: http://www.quickfixj.org/support/ Hi Steve,
> >
> > Sorry for the confusion - I had temporarily resolved the
> > problem by hard-coding a check for the new message type in my
> > fromApp method but have now reverted to calling the
> > MessageCracker as recommended and am now getting the original
> > problem again.
> >
> > To recap: my QuickFIX is sending a BusinessMessageReject
> > message (type="j", reason=Unsupported Message Type) on
> > receipt of the new message type. I have tried to add the new
> > message type to my FIX42.xml file to no avail.
> >
> > Is there any way of specifying the new message type to
> > QuickFIX such that I can then code an onMessage method for it?
> >
> > Thanks again for your help!
> >
> > Alex
> >
> >
> > -----Original Message-----
> > From: qui...@li...
> > [mailto:qui...@li...] On
> > Behalf Of Steve Bate
> > Sent: 29 August 2006 15:51
> > To: qui...@li...
> > Subject: Re: [Quickfixj-users] Adding messages to data dictionary
> >
> > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> > QuickFIX/J Support: http://www.quickfixj.org/support/ Hi Alex,
> >
> > Are these postings out of order or are you still having
> > problems after setting the MsgType in the message header?
> >
> > Steve
> >
> >
> > --------------------------------------------------------------
> > ----------
> > -
> > Using Tomcat but need to do more? Need to support web
> > services, security?
> > Get stuff done quickly with pre-integrated technology to make
> > your job easier Download IBM WebSphere Application Server
> > v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&
> > dat=121642
> > _______________________________________________
> > Quickfixj-users mailing list
> > Qui...@li...
> > https://lists.sourceforge.net/lists/listinfo/quickfixj-users
> >
> > Eurobase International Limited and its subsidiaries
> > (Eurobase) are unable to exercise control over the content of
> > information in E-Mails. Any views and opinions expressed may
> > be personal to the sender and are not necessarily those of
> > Eurobase. Eurobase will not enter into any contractual
> > obligations in respect of any part of its business in any E-mail.
> >
> > Privileged / confidential information may be contained in
> > this message and /or any attachments. This E-mail is intended
> > for the use of the addressee(s) only and may contain
> > confidential information. If you are not the / an intended
> > recipient, you are hereby notified that any use or
> > dissemination of this communication is strictly prohibited.
> > If you receive this transmission in error, please notify us
> > immediately, and then delete this E-mail.
> >
> > Neither the sender nor Eurobase accepts any liability
> > whatsoever for any defects of any kind either in or arising
> > from this E-mail transmission. E-Mail transmission cannot be
> > guaranteed to be secure or error-free, as messages can be
> > intercepted, lost, corrupted, destroyed, contain viruses, or
> > arrive late or incomplete. Eurobase does not accept any
> > responsibility for viruses and it is your responsibility to
> > scan any attachments.
> >
> > Registered Address: Essex House, 2 County Place, Chelmsford,
> > Essex CM2 0RE, United Kingdom
> >
> >
> > --------------------------------------------------------------
> > -----------
> > Using Tomcat but need to do more? Need to support web
> > services, security?
> > Get stuff done quickly with pre-integrated technology to make
> > your job easier Download IBM WebSphere Application Server
> > v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&
> > dat=121642
> > _______________________________________________
> > Quickfixj-users mailing list
> > Qui...@li...
> > https://lists.sourceforge.net/lists/listinfo/quickfixj-users
> >
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Quickfixj-users mailing list
> Qui...@li...
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>
--
Toli Kuznets
http://www.marketcetera.com: Open-Source Trading Platform
download.run.trade.
|