question

Upvotes
Accepted
20 1 1 6

Information/Documentation about interestSpecOpenReqMsg from RFA Java library

Hi

I am trying to register the connections in my app and receive notifications for their status. According to the manual I should be using an implementation of the ConnectionEvent interface. The RFA Java-library (7.0.1 or later) provide you with an implementation of the interface. This implmentation is called: ConnectionEventMsg which extends com.reuters.rfa.internal.common.ResponseMessage on top of implementing the ConnectionEvent interface.

When trying to look at the class my IDE does not give me the full implementation since it is a compiled code and created from the related class file. My real problem is that I need to have a documentation in order to figure out exacty what each parameter for the class constructor means. Some of them are obvious as they are of some class types in the library. But for instance when it comes to the Second argument for the below constructor, I have no idea what this argument is or should be.

public ConnectionEventMsg(

com.reuters.rfa.internal.session.msg.InterestSpecOpenReqMsg interestSpecOpenReqMsg, java.lang.String s,

com.reuters.rfa.session.event.ConnectionEvent.ConnectionType connectionType, com.reuters.rfa.session.event.ConnectionStatus connectionStatus

) { /* compiled code */ }

Is there anyway that I could find the related documentation for the class InterestSpecOpenReqMsg?

treprfarfa-apiconnection
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

It's a bit unclear to me what you are after. Think of it this way: You only need the classes that are actually documented in Javadoc. The rest are for internal use. Hint: It is not your job to instantiate ConnectionEventMsg, that is for the library to do. (which is why it doesn't need to be documented)

Thanks Lars. I have just started with RFA development so somehow I am a novice. So if I implement the Client interface and override the processEvent(Event event) method can I do something like the line below to check for Connection Events?

String currentConnectionStatus = null;

switch (event.getType()) {

case Event.OMM_CONNECTION_EVENT : {

OMMConnectionEvent connEvent = ((OMMConnectionEvent)event);

currentConnectionStatus =connEvent.getConnectionStatus().toString());

break;

}

.

.

.

}

Correction, I meant documentation for the class ConnectionEventMsg and not InterestSpecOpenReqMsg.

1 Answer

Upvote
Accepted
1.9k 6 9 16

Hi @AMofidy-Rouhi,

I’m unsure why you want to understand the structure of ConnectionEventMsg. Referring to a possible scenario that I could think, it relates to OMMConnectionEvent which is used to delivers OMM connection information (i.e., connection status, active host name, port, version information, and any multicast connection information for the connected component) when the application establishes a connection to a connecting node.

However, this event is generated by RFA Java underlying layer automatically, and you don’t have to create your own class because RFA has already provided an internal class named OMMConnectionEventMsg for you already. Here this is the example usage for receiving OMMConnectionEvents scenario.

According to the RFA Java example named com.reuters.rfa.example.omm.cons.StarterConsumer, there is a statement that the application registers OMMConnectionIntSpec using LoginClient as the callback handler. See the snippet code below.

// Declaration
// protected LoginClient _loginClient;
// private Handle _connIntSpecHandle;

// OMMConnectionIntSpec is used to register interest for any OMMConnectionEvents
OMMConnectionIntSpec connIntSpec = new OMMConnectionIntSpec();
_connIntSpecHandle = _ommConsumer.registerClient(_eventQueue, connIntSpec, _loginClient, null);

The application will receive OMMConnectionEvents object in the processEvent() callback method of LoginClient (Client derived class) that was registered earlier. Here this is the snippet code to handle Event.OMM_CONNECTION_EVENT:

public void processEvent(Event event)
{
    ...
    if(event.getType() == Event.OMM_CONNECTION_EVENT)
    {
        OMMConnectionEvent connectionEvent = ((OMMConnectionEvent)event);
        System.out.println(_className + ": Receive an OMM_CONNECTION_EVENT");
        System.out.println("connectionEvent: " + connectionEvent.getClass().getName());
        System.out.println("Name: " + connectionEvent.getConnectionName());
        System.out.println("Status: " + connectionEvent.getConnectionStatus().toString());
        System.out.println("Host: " + connectionEvent.getConnectedHostName());
        System.out.println("Port: " + connectionEvent.getConnectedPort());
        System.out.println("ComponentVersion: " + connectionEvent.getConnectedComponentVersion());
        return;
    }
    ...
}

Here this is the output result of OMMConnectionEvent objects handled by the LoginClient.processEvent() method.

<<My consumer connection connected to the feed server (172.20.33.43)>>
LoginClient: Receive an OMM_CONNECTION_EVENT
connectionEvent: com.reuters.rfa.internal.session.omm.OMMConnectionEventMsg
Name: myNamespace::myConnection
Status: { state: UP, code: NONE, text: ""}
Host: 172.20.33.43
Port: 14002
ComponentVersion: [ads3.0.2.L1.linux.tis.rrg 64-bit]


<<The 172.20.33.43 server was down>>
LoginClient: Receive an OMM_CONNECTION_EVENT
connectionEvent: com.reuters.rfa.internal.session.omm.OMMConnectionEventMsg
Name: myNamespace::myConnection
Status: { state: DOWN, code: NONE, text: "An existing connection was forcibly closed by the remote host"}
Host: 172.20.33.43
Port: 14002
ComponentVersion: [ads3.0.2.L1.linux.tis.rrg 64-bit]


<<RFA attempted to connect to the standby server (192.168.27.46)>>
LoginClient: Receive an OMM_CONNECTION_EVENT
connectionEvent: com.reuters.rfa.internal.session.omm.OMMConnectionEventMsg
Name: myNamespace::myConnection
Status: { state: UP, code: NONE, text: ""}
Host: 192.168.27.46
Port: 14002
ComponentVersion: []

Remark: The "ComponentVersion" information section is not available in some old version of servers.


Anyway, as you can see above, the implementation of the OMMConnectionEvent interface is the internal OMMConnectionEventMsg class (see its relationship below).

More importantly, these classes are available in RFA Java 7.5.0 and later versions. You should try this functionality with the recent version of RFA Java which is 8.0.1.E3 (as of 30 December 2016).

Hope this helps.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@Nipat Kunvutipongsak

Thanks Nipat. I think with your answer I have got what I needed. Many thanks for your help.

Click below to post an Idea Post Idea