[QFJ-225] Enhance JMX support to include notifications of login/logout Created: 17/Aug/07  Updated: 23/Jul/12  Resolved: 31/Aug/07

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.2.1
Fix Version/s: 1.3.0

Type: Improvement Priority: Default
Reporter: Toli Kuznets Assignee: Steve Bate
Resolution: Fixed Votes: 0
Labels: None


 Description   

Placeholder for an RFE to add additional functionality to current QFJ JMX support.
Would be great to have a notification model, where listeners could register to receive JMX notifications of logins/logouts, and of potentially MINA events.
Would be great to have capacity to add new sessions/destinations via JMX, both for acceptor and initiator sessions.



 Comments   
Comment by Steve Bate [ 17/Aug/07 ]

Hi Toli,

I've been investigating this. The only callbacks from the Session are currently to the Application implementation. This is clearly restrictive but is based on the QF design. I've been brainstorming on some options to add the notifications.

I could add a new callback capability directly on the Session – something like a SessionStateListener could be attached directly to the session. This listener would provide callbacks for logon, logoff, connect, disconnect and maybe other events like missed heartbeat and so on.

The JMX exporter would attach a listener to each session and generate the appropriate JMX notification. (BTW, I just realized the JMX exporter currently cannot export dynamically created acceptor sessions.)

This callback could be used for other purposes as well and could be registered by a user from the Application.onCreate call.

I'm thinking the callbacks should probably come directly from the SessionState object rather than the Session itself.

Thoughts?

Comment by Toli Kuznets [ 17/Aug/07 ]

We can test it out on static sessions, and then extend it to dynamically created sessions at a later time once the feature set/requirements are more stable if it's easier that away.

Having the callbacks come form SessionState seems to make sense too. I'm assuming you'll just add them into SessionState.setLogoutReceived()/setLoginReceived(), right?

This sounds like a solid approach to me.

Comment by Saneesh Kumar [ 23/Jul/12 ]

Dear Mr. Steve,

I am trying to achieve something similar, I need to implement the SessionStateListener in the Initiator.

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]

Generated at Thu May 16 05:24:07 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.