Re: [Quickfix-developers] Fw: reverseRoute() method
Brought to you by:
orenmnero
From: Oren M. <ore...@ya...> - 2004-03-01 02:36:31
|
Heri, I checked this in, though I made a couple of modifications. The reverseRoute method now throws a FieldNotFound exception. This is for if any of the required routing fields (BeginString, SenderCompID, TargetCompID) are not present. I did this so someone doesn't reverse the route on a message which is missing a critical field causing the message to go to some potentially unexpected destination. For most cases this doesn't matter since every message coming out of a session is guaranteed to have these fields. I also wrote a unit test for this method which revealed a bug. The value of OnBehalfOfCompID, not OnBehalfOfSubID was being placed into the DeliverToSubID. This was fixed. Thank you for the contribution, this is a great feature. --oren --- "H. Steuer" <st...@st...> wrote: > Hello, > > regarding to my post from 04/02/17 and Orens > suggestions I finally had time to wrap stuff into a > method. Attached you find a diff against Message.cpp > and Message.h that adds a method called > "reverseRoute". > > > This method prepares a FIX::Message object and adds > BeginString, SenderCompID, TargetCompID, > OnBehalfOfCompID, DeliverToCompID, OnBehalfOfSubID > and DeliverToSubID tags to the message header > depending on an underlying message header. > > Using that method you can do something like : > > fromApp(Message foo , SessionID sessionID ) > { > Message back; > back.reverseRoute( foo.getHeader() ); > /* add your payload here */ > Session::sendToTarget( back ); > } > > ... which then will get routed correctly to your > peer. > > Additionally I've added the new patches to > Session.cpp which now use reverseRoute() to add > routing tags to session level reject messages. > > > Oren, please let me know if that stuff and the small > patch to SocketConnection.cpp i posted on 04/02/18 > will go into the tree. > Otherwise I'll keep the patches in a local > repository. > > > > > Kind regards, > Heri > -- > This e-mail may contain confidential and/or > privileged information. > If you are not the intended recipient (or have > received this e-mail in error) > please notify the sender immediately and destroy > this e-mail. Any unauthorized > copying, disclosure or distribution of the material > in this e-mail is strictly > forbidden. > > ATTACHMENT part 2 application/octet-stream name=Session.patch > ATTACHMENT part 3 application/octet-stream name=Message.patch __________________________________ Do you Yahoo!? Get better spam protection with Yahoo! Mail. http://antispam.yahoo.com/tools |