In this blog post of FIX protocol tutorial series I would like to share my experience with connectivity issues around Fix Engines. to exchange message or say to trade electronically clients connect to broker using FIX protocol and for that they use FIX Engine. In FIX protocol connection between two FIX Engine is refereed as FIX Session and we normally say whether FIX Session is connected or not connected. FIX Session normally have there start time , end time and EOD time (End of day time) also called TradingSession start time , Trading Session End Time and Trading Session EOD time.
Fix Session Start time is the time when FIX Engine tries to connect each other , to connect successfully both client and broker must have agreed on Fix Session start time and there FIX engine must be running on that time to make them connect to each other.
Here I will mainly discuss issues I have faced during FIX Session establishment
These are very classic problems and should I say most common problem working with FIX protocol and almost everybody face this problem in there day to day work and has there own way to figure out what exactly is wrong and how to fix that.
here I am listing some guideline or say an approach for people who just started working on FIX protocol to figure out what is wrong and how to fix that hope this would help specially to newcomers on FIX protocol.
As per FIX protcol FIX Engine connects to each other over TCP connection on agreed host and port that's why first check in your log that if there is any logon message 35=A ,if there is no logon message something is wrong on TCP(socket ) level and TCP connection between client FIX Engine and broker Fix Engine has not been established.
to verify this just check whether your host is connected to broker host or not by issuing following command.
netstat -a | grep port (port is the one which you are using to connect to broker)
if you don't see a connection ESTABLISHED means no TCP connection has been established between your host and broker host and something is wrong either with broker FIX engine host or network.
Now check if broker host is pingable or not , to check broker host is alive and not down. you can use "telnet" command for checking that.
telnet hostname port (here hostname and port is broker host and port)
if you just see "trying ........." means host is not reachable and something is wrong with network may network link issue or any firewall rule
issue, you need to involve network team here for further diagnosis.
Now come to other part , in case you see logon message (MsgType=A or 35=A) in your log and still session is not establish then check for logout
message (MsgType=5 or 35=5) by seeing Text(tag 58) here you can figure out why session is not connecting may be sequence number mismatch.
Now there could be two reason :
1) Either broker is logging you out because you are sending sequence no less than what broker is expecting.In this case you need to reset
your Outgoing sequence Number to what broker is expecting.
2) In case your Fix engine is logging out broker because broker is sending sequence number less than what your Fix Engine is expecting ,In this
case you need to reset your Incoming sequence number.
Sequence number reset can also be done on broker side in opposite way you are doing but before doing that intranet you need to think why sequence number got mismatched and in case of any replay there would not be any side effect.
-->
to read more about FIX protocol , please see my FIX protocol tutorial series
Related post:
Tidak ada komentar:
Posting Komentar