[QFJ-693] SessionStateListener onMissedHeartBeat(), onHeartBeatTimeout() is called once network connection reestablishes after a disconnect Created: 23/Jul/12  Updated: 25/Jul/12  Resolved: 25/Jul/12

Status: Closed
Project: QuickFIX/J
Component/s: None
Affects Version/s: 1.5.2
Fix Version/s: None

Type: Bug Priority: Default
Reporter: Saneesh Kumar Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: QuickfixJ, SessionStateListener, onHeartBeatTimeOut, onMissedHeartbeat, onTimeOut
Environment:

Open Suse 12.1 Asparagus


Issue Links:
Duplicate
is duplicated by QFJ-692 QuickfixJ Session not disconnecting w... Closed

 Description   

I need to implement the SessionStateListener in the Initiator to understand when there is a network disconnect event.

Firstly, I defined my Initiator to Implement SessionStateListener, Then I added the listener by:

Session.lookupSession(quickfixSessionID).addStateListener(fixInitiator);

and now trying to receive following callbacks to check if the network is down:
@Override
public void onMissedHeartBeat()

{ System.out.println("######onMissedHeartBeat"); }

@Override
public void onHeartBeatTimeout()

{ System.out.println("######Heartbeat time out"); }

But the onMissedHeartBeat() and OnHeartbeatTimeout() methods are called only once the network connection is reestablished. I need to understand when the network went down and when it came back.

Please send me if you have any solution for the above to [email protected]



 Comments   
Comment by Grant Birchmeier [ 23/Jul/12 ]

This looks like a help request, not a bug.

Send your question to the mailing list, and you will probably get an answer.
http://quickfixj.org/support/

Comment by Christoph John [ 25/Jul/12 ]

Works for me:

code:
@Override
public void onHeartBeatTimeout()

{ System.out.println( "XXXXXX onHeartBeatTimeout"); }

@Override
public void onMissedHeartBeat()

{ System.out.println( "XXXXXX onMissedHeartBeat"); }

log:

[2012-07-25 09:02:24,884] [DEBUG] FIX.4.2:FixGateway->FixClient: outgoing: 8=FIX.4.2|9=62|35=0|34=5|49=FixGateway|52=20120725-07:02:24.884|56=FixClient|10=091|
[2012-07-25 09:02:27,883] [DEBUG] FIX.4.2:FixGateway->FixClient: outgoing: 8=FIX.4.2|9=71|35=1|34=6|49=FixGateway|52=20120725-07:02:27.883|56=FixClient|112=TEST|10=113|
[2012-07-25 09:02:27,883] [INFO ] FIX.4.2:FixGateway->FixClient: event : Sent test request TEST
XXXXXX onMissedHeartBeat
...
[2012-07-25 09:02:36,882] [ERROR] FIX.4.2:FixGateway->FixClient: error : Disconnecting: Timed out waiting for heartbeat
XXXXXX onHeartBeatTimeout

Generated at Sat Nov 23 10:45:31 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.