Page tree
Skip to end of metadata
Go to start of metadata

Overview

FIXEdge/J provides functionality that messages are stored and forwarded in the event that a connection with one of the counterparties is dropped and messages are not delivered. These messages will be stored by the queue and forwarded when the receiving counterparty connection is re-established. E.g. if one of the counterparties is logged off and messages are being sent, the FIXEdge/J can place the undelivered messages into the Store & Forward Queue and route them once the counterparty is logged on. 
Store and Forward functionality:

  • can be enabled/disabled for a particular session in the FIXEdge/J
  • can be used for specific message types (business only)
  • can be used for specific messages by specifying a particular filter with tags values, e.g. 59=0
  • can define stale messages and remove them from the queue
  • has persisting options - in the memory and on the disk


Configuration

Enable Store and Forward functionality

Enable Store and Forward queue for the endpoint

To enable Store and Forward queue for particular endpoint use property storeAndForwardEndpoint.enabled=true/false.

For example Client A may want to store all business messages that he sends to Exchange. In this case, Store and Forward queue should be enabled on the destination - Exchange where he sends to. 

s_fix_Exchange.properties
sessionType=acceptor
senderCompID=FIXEdgeJCompID
targetCompID=Exchange
storeAndForwardEndpoint.enabled=true

Note. To enable/disable Store and Forward queue for all endpoints on the FIXEdge/J use property storeAndForwardEndpoint.enabled=true/false in the s_fixDefault.properties.

Enable Store and Forward functionality for the session

To enable Store and Forward queue for particular session use property storeAndForward.enabled=true/false.

For example Client A may want to store all business messages that he sends to Exchange. At the same time, Client B may not want to store the messages that he sends to the same Exchange. In this case, Store and Forward functionality should be disabled for Client B. 

s_fix_Client_B.properties
sessionType=acceptor
senderCompID=FIXEdgeJCompID
targetCompID=ClientB
storeAndForward.enabled=false

Compatibility matrix


storeAndForward.enabled=truestoreAndForward.enabled=false
storeAndForwardEndpoint.enabled=true

Client A: storeAndForward.enabled=true

Client B: storeAndForward.enabled=true

Exchange: storeAndForwardEndpoint.enabled=true

Messages from Client A and Client B will be stored in the Exchange's Store and Forward queue

Client A: storeAndForward.enabled=true

Client B: storeAndForward.enabled=false

Exchange: storeAndForwardEndpoint.enabled=true

Messages from Client A will be stored in the Exchange's Store and Forward queue

Messages from Client B will not be stored in the Exchange's Store and Forward queue

Client A: storeAndForwardEndpoint.enabled=true

Client B: storeAndForwardEndpoint.enabled=true

Exchange: storeAndForward.enabled=true

Messages from the Exchange will be stored in the Clients Store and Forward queues

Client A: storeAndForwardEndpoint.enabled=true

Client B: storeAndForwardEndpoint.enabled=true

Exchange: storeAndForward.enabled=false

Messages from the Exchange will not be stored in the Clients Store and Forward queues

storeAndForwardEndpoint.enabled=false

Client A: storeAndForward.enabled=true

Client B: storeAndForward.enabled=true

Exchange: storeAndForwardEndpoint.enabled=false

Messages from Client A and Client B will not be stored in the Exchange's Store and Forward queue

Client A: storeAndForward.enabled=true

Client B: storeAndForward.enabled=false

Exchange: storeAndForwardEndpoint.enabled=false

Messages from Client A and Client B will not be stored in the Exchange's Store and Forward queue

Client A: storeAndForwardEndpoint.enabled=true

Client B: storeAndForwardEndpoint.enabled=false

Exchange: storeAndForward.enabled=true

Messages from the Exchange will be stored in the Client A Store and Forward queue

Messages from the Exchange will not be stored in the Client B Store and Forward queue

Client A: storeAndForwardEndpoint.enabled=true

Client B: storeAndForwardEndpoint.enabled=false

Exchange: storeAndForward.enabled=false

Messages from the Exchange will not be stored in the Clients Store and Forward queues

Configure Store and Forward for particular message types

To enable Store and Forward queue for particular message types use property storeAndForward.msgTypesRequiredForDelivery=F,G.

For example Client A may want to store only Order Cancel Request (MsgType = F) messages. In this case, for Client's session should be specified message type to be stored in the Store and Forward queue. 

s_fix_Client_A.properties
sessionType=acceptor
senderCompID=FIXEdgeJCompID
targetCompID=ClientA
groups=Group_A
storeAndForward.enabled=true
storeAndForward.msgTypesRequiredForDelivery=F

Store and Forward functionality for particular tag value

Filtering messages by particular tag values can be configured using business rules. There is a special function 'requiredForDelivery' which enables message saving in the Store and Forward queue.

If "requiredForDelivery" parameter is set to true or not defined then the message will be saved and delivered in any case.

...
def requiredForDelivery = false
if(msg.getTagValueAsDouble(44) > 1000 && msg.getTagValueAsString(55) == "AAPL") {
    requiredForDelivery = true
}
send(routingContext, messageContext, destination, requiredForDelivery)
...

Configure handling 'stale' messages

FIXEdge/J provides an ability to remove 'stale' orders from the Store and Forward queue. Period after which order becomes outdated can be defined for each session. In addition, there is an option to exclude some message from the set of 'stale' messages.

For example Client A may want to define all messages that are older than 30 sec at sending time as 'stale'. At the same time, Client A wants Order Cancel Request (MsgType = F) messages to be always procesed to the Exchange.

There are two properties:

  • storeAndForward.stalePeriod property defines period (in seconds) is used to check if the message becomes 'stale' and should not be sent. If the property is set, all queued messages will be checked when a destination becomes available. In addition, if the difference between TransactTime (Tag = 60) and sending time is more that defined the period, messages will not be sent into the destination. 
  • storeAndForward.staleProcessingExcludedTypes property specifies for which types of messages the stale checking and removing is not be applied.


s_fix_Client_A.properties
sessionType=acceptor
senderCompID=FIXEdgeJCompID
targetCompID=ClientA
groups=Group_A
storeAndForward.enabled=true
storeAndForward.stalePeriod=30
storeAndForward.staleProcessingExcludedTypes=F

Configure Store and Forward persistence mode

By default, Store and Forward queue is persisted on the disk in the 'logs' directory.

In addition, there is possibility to configure the messages in the memory using storeAndForwardEndpoint.queueType parameter.

Possible values: 

  • storeAndForwardEndpoint.queueType = IN_MEMORY - In this mode, all messages provided are saved in memory. If the system is down (gracefully or non-gracefully) all the messages will be lost.
  • storeAndForwardEndpoint.queueType = PERSISTENT - In this mode, all messages provided are saved on disk and they will be restored and sent in case of shutdown (gracefully or non-gracefully).

Configure Store and Forward processing mode

By default, FIXEdge/J processed messages in asynchronous mode.

In the case when synchronous processing is needed, there is a parameter that allows processing message in this mode - storeAndForwardEndpoint.maxTimeForSyncSendingInUsec.

Please note, that this parameter will be applied only if storeAndForwardEndpoint.enabled=true.


s_fix_Client_B.properties
sessionType=acceptor
senderCompID=FIXEdgeJCompID
targetCompID=ClientB
groups=Group_A
storeAndForwardEndpoint.enabled=true
storeAndForwardEndpoint.maxTimeForSyncSendingInUsec = 60000000

This parameter is also possible to use with slow consumer sessions. Reducing the value of the parameter allows starting sending in the synchronous mode. If the message wasn't processed in the defined period (in microseconds), FIXEdge/J will switch to asynchronous mode.


s_fix_Client_B.properties
sessionType=acceptor
senderCompID=FIXEdgeJCompID
targetCompID=ClientB
groups=Group_A
storeAndForwardEndpoint.enabled=true
storeAndForwardEndpoint.maxTimeForSyncSendingInUsec = 100
  • No labels