Resend logic implementation

Imported from previous forum

Hi,
I want to implement Resend logic in my application for the guranteed message delievery of the FIX message to the counterparties. Question is lets say my application creates and sends a message to my fix engine but somehow this message could not reach to fix engine and hence could not deleivered to counterparty, so how I could be sure enough that all message generated by my fix application sent to counterparty guranteed.

I am looking for some suggestion/design pattern about how other people/companies implement this scenario.

Thanks in Advance

is communication between the application and fix engine in FIX ? or is it a local method call or RMI or MQ etc ?

Hi, I want to implement Resend logic in my application for the guranteed
message delievery of the FIX message to the counterparties. Question is
lets say my application creates and sends a message to my fix engine but
somehow this message could not reach to fix engine and hence could not
deleivered to counterparty, so how I could be sure enough that all
message generated by my fix application sent to counterparty guranteed.

I am looking for some suggestion/design pattern about how other
people/companies implement this scenario.

Thanks in Advance

Mahesh,
i did not get you exactly, but if your question is if my applcation hosts my fix engine (i.e. in process) then it is not. I communicate my fix engine through socket.

Thanks,

is communication between the application and fix engine in FIX ? or is
it a local method call or RMI or MQ etc ?

Hi, I want to implement Resend logic in my application for the
guranteed message delievery of the FIX message to the counterparties.
Question is lets say my application creates and sends a message to my
fix engine but somehow this message could not reach to fix engine and
hence could not deleivered to counterparty, so how I could be sure
enough that all message generated by my fix application sent to
counterparty guranteed.

I am looking for some suggestion/design pattern about how other
people/companies implement this scenario.

Thanks in Advance

So your Application and FIX Engine communicate thru Sockets. What is the messaging protocol on this socket connection ?

If its FIX between your application and engine, then you would use the Sequence numbering and Resend request logic as provided by FIX.

If its non-FIX, for example you write positional or delimited String which the FIX engine converts to FIX message, then as John has stated in this post below you would need to build Sequence numbering and Resend request logic in these Strings between application and Engine similar to FIX.

Mahesh, i did not get you exactly, but if your question is if my
applcation hosts my fix engine (i.e. in process) then it is not. I
communicate my fix engine through socket.

Thanks,

is communication between the application and fix engine in FIX ? or is
it a local method call or RMI or MQ etc ?

Hi, I want to implement Resend logic in my application for the
guranteed message delievery of the FIX message to the
counterparties. Question is lets say my application creates and
sends a message to my fix engine but somehow this message could not
reach to fix engine and hence could not deleivered to counterparty,
so how I could be sure enough that all message generated by my fix
application sent to counterparty guranteed.

I am looking for some suggestion/design pattern about how other
people/companies implement this scenario.

Thanks in Advance

Yes, I use FIX 4.4 as messaging protocol.

So, as per your suggestion if i want to implement seq numbering and resend request logic, any pointer where i can get this information? any particular section in FIX spec which talks about this logic implentation?

Thanks a lot.

So your Application and FIX Engine communicate thru Sockets. What is the
messaging protocol on this socket connection ?

If its FIX between your application and engine, then you would use the
Sequence numbering and Resend request logic as provided by FIX.

If its non-FIX, for example you write positional or delimited String
which the FIX engine converts to FIX message, then as John has stated
in this post below you would need to build Sequence numbering and
Resend request logic in these Strings between application and Engine
similar to FIX.

Mahesh, i did not get you exactly, but if your question is if my
applcation hosts my fix engine (i.e. in process) then it is not. I
communicate my fix engine through socket.

Thanks,

is communication between the application and fix engine in FIX ? or
is it a local method call or RMI or MQ etc ?

Hi, I want to implement Resend logic in my application for the
guranteed message delievery of the FIX message to the
counterparties. Question is lets say my application creates and
sends a message to my fix engine but somehow this message could
not reach to fix engine and hence could not deleivered to
counterparty, so how I could be sure enough that all message
generated by my fix application sent to counterparty guranteed.

I am looking for some suggestion/design pattern about how other
people/companies implement this scenario.

Thanks in Advance

For FIX.4.4 refer

fix-44_VOL-2_w_Erratta_20030618.pdf

in

http://fixprotocol.org/specifications/fix4.4spec

Read thru sections on

Sequence Numbers (Tag 34)

Ordered message processing

Message Recovery

Resend Request ^35=2^

Yes, I use FIX 4.4 as messaging protocol.

So, as per your suggestion if i want to implement seq numbering and
resend request logic, any pointer where i can get this information? any
particular section in FIX spec which talks about this logic
implentation?

Thanks a lot.

If your Application is sending out FIX.4.4 messages to your FIX engine which sends FIX.X.Y messages to your counterparty, then I believe your application has an in-process FIX Engine because your application is producing FIX messages which is what FIX engines do. What do you gain by the extra FIX engine between your application’s in-process FIX engine and the counterparty ? What prevents your application’s in-process FIX engine from directly communicating with your counterparty ?

Yes, I use FIX 4.4 as messaging protocol.

So, as per your suggestion if i want to implement seq numbering and
resend request logic, any pointer where i can get this information? any
particular section in FIX spec which talks about this logic
implentation?

Thanks a lot.

So your Application and FIX Engine communicate thru Sockets. What is
the messaging protocol on this socket connection ?

If its FIX between your application and engine, then you would use the
Sequence numbering and Resend request logic as provided by FIX.

If its non-FIX, for example you write positional or delimited String
which the FIX engine converts to FIX message, then as John has stated
in this post below you would need to build Sequence numbering and
Resend request logic in these Strings between application and Engine
similar to FIX.

Mahesh, i did not get you exactly, but if your question is if my
applcation hosts my fix engine (i.e. in process) then it is not. I
communicate my fix engine through socket.

Thanks,

is communication between the application and fix engine in FIX ?
or is it a local method call or RMI or MQ etc ?

Hi, I want to implement Resend logic in my application for the
guranteed message delievery of the FIX message to the
counterparties. Question is lets say my application creates and
sends a message to my fix engine but somehow this message could
not reach to fix engine and hence could not deleivered to
counterparty, so how I could be sure enough that all message
generated by my fix application sent to counterparty guranteed.

I am looking for some suggestion/design pattern about how other
people/companies implement this scenario.

Thanks in Advance

An additional FIX Engine is often used to provide routing capability, lets suppose the Server can send orders to many trade venues using FIX - at the server you have a FIX acceptor that handles the client connections, a process that applies some rules to decide which trade venue gets the order, and then a second FIX engine/process to handle the session to the target trade venues.

John

If your Application is sending out FIX.4.4 messages to your FIX engine
which sends FIX.X.Y messages to your counterparty, then I believe your
application has an in-process FIX Engine because your application is
producing FIX messages which is what FIX engines do. What do you gain by
the extra FIX engine between your application’s in-process FIX engine
and the counterparty ? What prevents your application’s in-process FIX
engine from directly communicating with your counterparty ?

Yes, I use FIX 4.4 as messaging protocol.

So, as per your suggestion if i want to implement seq numbering and
resend request logic, any pointer where i can get this information?
any particular section in FIX spec which talks about this logic
implentation?

Thanks a lot.

So your Application and FIX Engine communicate thru Sockets. What is
the messaging protocol on this socket connection ?

If its FIX between your application and engine, then you would use
the Sequence numbering and Resend request logic as provided by FIX.

If its non-FIX, for example you write positional or delimited String
which the FIX engine converts to FIX message, then as John has
stated in this post below you would need to build Sequence numbering
and Resend request logic in these Strings between application and
Engine similar to FIX.

Mahesh, i did not get you exactly, but if your question is if my
applcation hosts my fix engine (i.e. in process) then it is not. I
communicate my fix engine through socket.

Thanks,

is communication between the application and fix engine in FIX ?
or is it a local method call or RMI or MQ etc ?

Hi, I want to implement Resend logic in my application for the
guranteed message delievery of the FIX message to the
counterparties. Question is lets say my application creates
and sends a message to my fix engine but somehow this message
could not reach to fix engine and hence could not deleivered
to counterparty, so how I could be sure enough that all
message generated by my fix application sent to counterparty
guranteed.

I am looking for some suggestion/design pattern about how
other people/companies implement this scenario.

Thanks in Advance

purpose of extra fix engine is to validate the constructed fix message, route it to the counterparty and handling of session specific messages (e.g. Resend etc).

If your Application is sending out FIX.4.4 messages to your FIX engine
which sends FIX.X.Y messages to your counterparty, then I believe your
application has an in-process FIX Engine because your application is
producing FIX messages which is what FIX engines do. What do you gain by
the extra FIX engine between your application’s in-process FIX engine
and the counterparty ? What prevents your application’s in-process FIX
engine from directly communicating with your counterparty ?

Lets call the FIX engine which connects to your counterparties as Facade FIX Engine.

So between the Application’s in-process FIX engine and the Facade FIX engine, only application messages are exchanged and there is no session? If so build either the Session part as specified by FIX or build the get “positive ack” method Greg Orsini mentioned below.

Are the messages from the in-process FIX engine to facade FIX engine complete FIX messages or they are reduced messages like they do not have SendingTime[52], MessageSequenceNumber[34] etc and these values are plugged in by the Facade FIX engine in which case you should consider them to be delimited Strings.

The Facade FIX engine validates the messages received from the application’s in-process FIX engine, what does it do if the message is invalid?

purpose of extra fix engine is to validate the constructed fix message,
route it to the counterparty and handling of session specific messages
(e.g. Resend etc).

If your Application is sending out FIX.4.4 messages to your FIX
engine which sends FIX.X.Y messages to your counterparty, then I
believe your application has an in-process FIX Engine because your
application is producing FIX messages which is what FIX engines do.
What do you gain by the extra FIX engine between your application’s
in-process FIX engine and the counterparty ? What prevents your
application’s in-process FIX engine from directly communicating with
your counterparty ?

Hi Mahesh,
Thanks for carefully reading and replying to my emails. Please see answers below:

Lets call the FIX engine which connects to your counterparties as Facade
FIX Engine.

So between the Application’s in-process FIX engine and the Facade FIX
engine, only application messages are exchanged and there is no session?

yes, only application messages and no session messages. session messages are handled by facade fix engine.

If so build either the Session part as specified by FIX or build the get
“positive ack” method Greg Orsini mentioned below.

somehow my facade fix engine don’t give correctly if connection is down and i tested with timeout idea also as suggested by Greg but this was also not reliable, so i build similar to seq number + resend logic approach in my application.

Are the messages from the in-process FIX engine to facade FIX engine
complete FIX messages or they are reduced messages like they do not have
SendingTime[52], MessageSequenceNumber[34] etc and these values are
plugged in by the Facade FIX engine in which case you should consider
them to be delimited Strings.

These are the reduced message, facade engine adds extra header and trailer informations.

The Facade FIX engine validates the messages received from the
application’s in-process FIX engine, what does it do if the message
is invalid?

it rejects this message and don;t send it to the counterparty.

Thanks,

Hi Amit,

I use Java Objects over Remote Method Invocation between Trading application and FIX engine. I do not need any Session between Trading application and FIX engine. The return value of RMI call and Exceptions would tell the caller the result of the call.

Mine is a test broker, a NewOrderSingle FIX message ^35=D^ received from Buy side would be converted by the FIX engine to a Order object and handed over to trading application. The trading application would create Ack object or PartFill object or Full Fill object or Reject object etc and give it to the FIX engine which would create a ExecutionReport FIX message ^35=8^ and send it to counterparty.

Session between Buy side counterparty and my FIX engine is fully taken care of the FIX engine and Trading application has no knowledge of the external FIX session.

Regards,
K. Mahesh

Hi Mahesh, Thanks for carefully reading and replying to my emails.
Please see answers below:

Lets call the FIX engine which connects to your counterparties as
Facade FIX Engine.

So between the Application’s in-process FIX engine and the Facade FIX
engine, only application messages are exchanged and there is no
session?

yes, only application messages and no session messages. session messages
are handled by facade fix engine.

If so build either the Session part as specified by FIX or build the
get “positive ack” method Greg Orsini mentioned below.

somehow my facade fix engine don’t give correctly if connection is down
and i tested with timeout idea also as suggested by Greg but this was
also not reliable, so i build similar to seq number + resend logic
approach in my application.

Are the messages from the in-process FIX engine to facade FIX engine
complete FIX messages or they are reduced messages like they do not
have SendingTime[52], MessageSequenceNumber[34] etc and these values
are plugged in by the Facade FIX engine in which case you should
consider them to be delimited Strings.

These are the reduced message, facade engine adds extra header and
trailer informations.

The Facade FIX engine validates the messages received from the
application’s in-process FIX engine, what does it do if the message is
invalid?

it rejects this message and don;t send it to the counterparty.

Thanks,

Some FIX Engine vendors implement socket connections for the application comms that use a “send request / get positive ack” model rather than implementing sequence numbers.

If this is the case, then you will need to establish a timeout period after which you will decide there is trouble with your socket communication or FIX engine.

Typical responses to Application/FIX Engine TCP comms timeout include

  1. Disconnecting and reconnecting the socket to the FIX engine, and,
  2. If this succeeds, send the message again (if desirable) with a PossResend flag set (cannot set PossDupe since we can’t establish the MsgSeqNum).

Other approaches make sense too and depend on the nature of the message traffic.

For example, if sending order traffic, you may want to:

  1. Mark the FIX session as down in your application,
  2. Try to re-establish FIX Engine connectivity, and
  3. Send an OrderStatusRequest to determine if the order made it to the market rather than auto-resending it a bit late.
  4. Mark FIX session as up and update order status depending on the response to the OrderStatus request.

Regards, Greg.

Mahesh, i did not get you exactly, but if your question is if my
applcation hosts my fix engine (i.e. in process) then it is not. I
communicate my fix engine through socket.

Thanks,

is communication between the application and fix engine in FIX ? or is
it a local method call or RMI or MQ etc ?

Hi, I want to implement Resend logic in my application for the
guranteed message delievery of the FIX message to the
counterparties. Question is lets say my application creates and
sends a message to my fix engine but somehow this message could not
reach to fix engine and hence could not deleivered to counterparty,
so how I could be sure enough that all message generated by my fix
application sent to counterparty guranteed.

I am looking for some suggestion/design pattern about how other
people/companies implement this scenario.

Thanks in Advance

[ original email was from John Prewett - jprewett@lavatrading.com ]
> Hi, I want to implement Resend logic in my application for the guranteed

message delievery of the FIX message to the counterparties. Question is
lets say my application creates and sends a message to my fix engine but
somehow this message could not reach to fix engine and hence could not
deleivered to counterparty, so how I could be sure enough that all
message generated by my fix application sent to counterparty guranteed.

I am looking for some suggestion/design pattern about how other
people/companies implement this scenario.

Thanks in Advance

Two comments on this subject:

  1. The more hops your data takes, the more latency and complexity. Complexity because each hop needs some type of fault-tolerance/recovery mechanism. Many people use “in-process” FIX engines so there is no external hop from your application to the FIX engine. Under that circumstance, there is no way for messages to be out-of-sync with your FIX engine as they are bound together.

  2. Just as FIX uses a bi-directional MsgSeqNum and ResendRequests, so can you implement something similar. As Mahesh alludes, the transport you use between your application and your FIX engine may offer some type of message synchronization after an outage. It has been my unfortunate experience that most 3rd party transport software is big on promises of message resynchronization and short on implementation of those promises. So you still might need the equivalent of the FIX MsgSeqNum+ResendRequest logic.

I hope this helps.

JohnP

in my case, its number 2.

John, Any suggestion/idea how to implement equivalent of the FIX MsgSeqNum+ResendRequest logic.

Thanks

Hi, I want to implement Resend logic in my application for the
guranteed message delievery of the FIX message to the counterparties.
Question is lets say my application creates and sends a message to my
fix engine but somehow this message could not reach to fix engine and
hence could not deleivered to counterparty, so how I could be sure
enough that all message generated by my fix application sent to
counterparty guranteed.

I am looking for some suggestion/design pattern about how other
people/companies implement this scenario.

Thanks in Advance

Two comments on this subject:

  1. The more hops your data takes, the more latency and complexity.
    Complexity because each hop needs some type of fault-
    tolerance/recovery mechanism. Many people use “in-process” FIX
    engines so there is no external hop from your application to the FIX
    engine. Under that circumstance, there is no way for messages to be
    out-of-sync with your FIX engine as they are bound together.

  2. Just as FIX uses a bi-directional MsgSeqNum and ResendRequests, so
    can you implement something similar. As Mahesh alludes, the
    transport you use between your application and your FIX engine may
    offer some type of message synchronization after an outage. It has
    been my unfortunate experience that most 3rd party transport
    software is big on promises of message resynchronization and short
    on implementation of those promises. So you still might need the
    equivalent of the FIX MsgSeqNum+ResendRequest logic.

I hope this helps.

JohnP

[ original email was from John Prewett - jprewett@lavatrading.com ]
> John, Any suggestion/idea how to implement equivalent of the FIX

MsgSeqNum+ResendRequest logic.

Implementing this implies that you have control over the interface to the out-of-process FIX engine that you use. If this is true, then it is possible. If this is false, there’s nothing you can do except to switch to another FIX engine that offers message resynchronization after an outage.

Implementing similar message synchronization logic to FIX almost brings you back to the suggestion of using an in-process FIX engine as you would be implementing something very similar to the FIX session layer recovery model, which is the large majority of what a FIX engine actually is.

JohnP