question

Upvotes
0 0 0 0

OmmInvalidUsageException due to timeout in application

Hello,


We are tring to connect to RTO with our application created using the EMA libtrary part of Real-Time-SDK-2.1.3.E1.linux.zip package.

EmaConfig.xml file:

<Name value="Channel_1"/>
                     <!-- ChannelType possible values are: -->
<!-- ChannelType::RSSL_SOCKET    - TCP IP connection type  -->
<!-- ChannelType::RSSL_HTTP      - Http tunnel connection type -->
<!-- ChannelType::RSSL_ENCRYPTED - Https tunnel connection type  -->
<!-- ChannelType::RSSL_RELIABLE_MCAST - Reliable multicast connection type  -->
<ChannelType value="ChannelType::RSSL_ENCRYPTED"/>

<!-- CompressionType is optional: defaulted to None    -->
<!-- possible values: None, ZLib, LZ4  -->
<CompressionType value="CompressionType::None"/>
<GuaranteedOutputBuffers value="5000"/>

<!-- ConnectionPingTimeout is optional: defaulted to 30000 -->
<ConnectionPingTimeout value="30000"/>
 <!-- TcpNodelay is optional: defaulted to 1 -->
<!-- possible values: 1 (tcp_nodelay option set), 0 (tcp_nodelay not set)                                       -->
<TcpNodelay value="1"/>


From EmaInfo_xxx.log file:

loggerMsg
    TimeStamp: 07:35:18.629
    ClientName: Consumer_1_10
    Severity: Verbose
    Text:    Print out active configuration detail.
         configuredName: Consumer_1
         instanceName: Consumer_1_10
         itemCountHint: 100000
         serviceCountHint: 513
         dispatchTimeoutApiThread: 100
         maxDispatchCountApiThread: 10
         maxDispatchCountUserThread : 100
         maxEventsInPool : -1
         requestTimeout : 15000
         xmlTraceMaxFileSize : 100000000
         xmlTraceToFile : 1
         xmlTraceToStdout : 0
         xmlTraceToMultipleFiles : 1
         xmlTraceWrite : 1
         xmlTraceRead : 1
         xmlTracePing : 1
         xmlTraceHex : 0
         xmlTraceDump : 0
         xmlTraceFileName : IConsXMLTrace
         enableRtt : 0
         libSslName :
         libCryptoName :
         tokenReissueRatio : 0.8
         defaultServiceIDForConverter : 1
         jsonExpandedEnumFields : 0
         catchUnknownJsonKeys : 0
         catchUnknownJsonFids : 1
         closeChannelFromFailure : 1
         outputBufferSize : 65535
         jsonTokenIncrementSize : 500
         restEnableLog : 0
         restLogFileName :
         sendJsonConvError : 0
         shouldInitializeCPUIDlib : 1
         pipePort: 9001
         obeyOpenWindow: 1
         postAckTimeout: 15000
         maxOutstandingPosts: 100000
         reconnectAttemptLimit: 10
         reconnectMinDelay : 1000
         reconnectMaxDelay : 5000
         msgKeyInUpdates : 1
         directoryRequestTimeOut : 45000
         dictionaryRequestTimeOut : 45000
         loginRequestTimeOut : 4500
         reissueTokenAttemptLimit : -1
         reissueTokenAttemptInterval : 5000
         restRequestTimeOut : 90
         restProxyHostName :
         restProxyPort :
         restProxyDomain :
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.629
    ClientName: Consumer_1_10
    Severity: Verbose
    Text:    Successfully initialized communication Pipe.
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.635
    ClientName: Consumer_1_10
    Severity: Verbose
    Text:    Successfully initialized Rssl.
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.735
    ClientName: Consumer_1_10
    Severity: Verbose
    Text:    Successfully created Reactor.
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.735
    ClientName: LoginCallbackClient
    Severity: Verbose
    Text:    Created LoginCallbackClient
loggerMsgEnd
 
 
loggerMsg
    TimeStamp: 07:35:18.735
    ClientName: LoginCallbackClient
    Severity: Verbose
    Text:    RDMLogin request message was populated with this info:
        username GE-A-00428487-3-9112
        usernameType 1
        position 10.101.232.52/net
        appId 256
        applicationName ema
        instanceId <not set>
        singleOpen 1
        allowSuspect 1
        optimizedPauseResume 0
        permissionExpressions 1
        permissionProfile 1
        supportBatchRequest 0
        supportEnhancedSymbolList 0
        supportPost 0
        supportRtt 0
        supportViewRequest 0
        role 0
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.735
    ClientName: DictionaryCallbackClient
    Severity: Verbose
    Text:    Created DictionaryCallbackClient
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.735
    ClientName: DirectoryCallbackClient
    Severity: Verbose
    Text:    Created DirectoryCallbackClient
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.735
    ClientName: DirectoryCallbackClient
    Severity: Verbose
    Text:    RDMDirectoryRequest message was populated with Filter(s)
        RDM_DIRECTORY_SERVICE_INFO_FILTER
        RDM_DIRECTORY_SERVICE_STATE_FILTER
        RDM_DIRECTORY_SERVICE_GROUP_FILTER
        RDM_DIRECTORY_SERVICE_LOAD_FILTER
        RDM_DIRECTORY_SERVICE_DATA_FILTER
        RDM_DIRECTORY_SERVICE_LINK_FILTER
        requesting all services
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.736
    ClientName: ItemCallbackClient
    Severity: Verbose
    Text:    Created ItemCallbackClient. Instance name='Consumer_1_10'.
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.740
    ClientName: ChannelCallbackClient
    Severity: Verbose
    Text:    Created ChannelCallbackClient
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.740
    ClientName: ChannelCallbackClient
    Severity: Verbose
    Text:    Attempt to connect using
        1] RSSL_CONN_TYPE_ENCRYPTED
        Channel name Channel_1
        Instance Name Consumer_1_10
        RsslReactor 0x0x7fd504a92c50
        InterfaceName
        hostName
        port
        CompressionType None
        tcpNodelay false
        ObjectName
        ProxyHost
        ProxyPort
        ProxyConnectionTimeout 40
        SecurityProtocol 12
        EnableSessionManagement 1
        Location eu-west-1
        ServiceDiscoveryRetryCount 3
        reconnectAttemptLimit 10
        reconnectMinDelay 1000 msec
        reconnectMaxDelay 5000 msec
        connectionPingTimeout 60000 msec
        initializationTimeout 10 sec
 
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:18.787
    ClientName: ChannelCallbackClient
    Severity: Verbose
    Text:    Successfully created a Reactor and Channel(s)
        Channel name(s) Channel_1
        Instance Name Consumer_1_10
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:19.595
    ClientName: ChannelCallbackClient
    Severity: Verbose
    Text:    Received ChannelOpened on channel Channel_1
        Instance Name Consumer_1_10
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:23.330
    ClientName: ItemCallbackClient
    Severity: Verbose
    Text:    Destroyed ItemCallbackClient [Consumer_1_10]
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:23.331
    ClientName: DictionaryCallbackClient
    Severity: Verbose
    Text:    Destroyed DictionaryCallbackClient
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:23.331
    ClientName: DirectoryCallbackClient
    Severity: Verbose
    Text:    Destroyed DirectoryCallbackClient
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:23.331
    ClientName: LoginCallbackClient
    Severity: Verbose
    Text:    Destroyed LoginCallbackClient
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:23.331
    ClientName: ChannelCallbackClient
    Severity: Verbose
    Text:    Destroyed ChannelCallbackClient
loggerMsgEnd
 
loggerMsg
    TimeStamp: 07:35:23.332
    ClientName: OmmLoggerClient
    Severity: Verbose
    Text:    closed  at 2024/04/09 07:35:23.332
loggerMsgEnd


I cannot see any error in this log file, however in the application we get the error message:
Consumer creation failed. Exception Type='OmmInvalidUsageException', Text='login failed (timed out after waiting 4500 milliseconds)', ErrorCode='-4052'


The connection to the access token is there:
curl -X POST 'https://api.refinitiv.com:443/auth/oauth2/v1/token'   --header 'Accept: */*'   --header 'Content-Type: application/x-www-form-urlencoded'   --data-urlencode 'username=GE-A-00207068-3-7597'   --data-urlencode 'password=***'   --data-urlencode 'client_id=d4ad17d17412412ab416545dc8916931dfe5a7e7'   --data-urlencode 'grant_type=password'   --data-urlencode 'takeExclusiveSignOnControl=true'   --data-urlencode 'scope=trapi'
 { "access_token":"***", "refresh_token":"***", "expires_in":"600" , "scope":"trapi.auth.cloud-credentials trapi.cfs.claimcheck.read trapi.data.pricing.read trapi.data.symbology.advanced.read trapi.data.symbology.read trapi.metadata.read trapi.rt.bulksearch.read trapi.search.explore.read trapi.search.metadata.read trapi.streaming.pricing.read", "token_type":"Bearer"


Does anyone has any idea what can we check / update in the configs?

Thank you

#technologyema-apic++ommconsumer
icon clock
10 |1500

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

@andrei.damian

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply, and then close the question. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Upvote
24.8k 54 17 14

Hello @andrei.damian

The error indicates that the API could not establish and received a login response message from the RTO's ADS server.

I am assuming that you are trying to connect to RTO with EMA and define a connection detail in the EmaConfig.xml file.

I strongly suggest you check the Cons113 (113_MP_SessionMgmt) example. It uses Channel_4 in the EmaConfig.xml file to connect to RTO with the following configurations:

<Channel>
    <Name value="Channel_4"/>
    <ChannelType value="ChannelType::RSSL_ENCRYPTED"/>
    <CompressionType value="CompressionType::None"/>
    <GuaranteedOutputBuffers value="5000"/>
    <!-- EMA discovers a host and a port from RDP service discovery for the specified location 
        when both of them are not set and the session management is enable. -->
    <Location value="us-east-1"/>
    <EnableSessionManagement value="1"/>
    <EncryptedProtocolType value="EncryptedProtocolType::RSSL_SOCKET"/>
    <!-- ObjectName is optional: defaulted to ""                                                -->
    <ObjectName value=""/>
</Channel>

You need to:

  1. specify the prefer RTO AWS region in the location configuration
  2. set the EnableSessionManagement to 1 to let the API manages manages the authentication token on behalf of the user
  3. set the EncryptedProtocolType to be EncryptedProtocolType::RSSL_SOCKET value.

location.png

enablesession.png



location.png (108.6 KiB)
enablesession.png (122.4 KiB)
icon clock
10 |1500

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

Hello @wasin.w and thank you for the reply.
We are using the configs you said, location used, EnableSessionManagement is set to 1 and EncryptedProtocolType is RSSL_SOCKET.
I must mention that the same executable and config works on another machine (connects, gets info from Elektron_DD service for some RICs).
So my question is: is there a way to enable even more logs in the EMA library?

As mentioned in the original post, from some reason, i cannot see in the EmaInfo_xyz.log file no mention of the erro, only in the application log.

Upvotes
24.8k 54 17 14

Hello @andrei.damian

Thank you for the information. According to your "same executable and config works on another machine" message, what is the difference between the work and not-work machine? Does the not-work machine has some kind of firewall, network policy, SELinux that might block a connection on port 14002?

About the logging, you can configure the EmaConfig.xml file to enable the XML trace log like described on the Enterprise Message API (EMA) - Configuration Overview article. Please check the following sections:

  • EMA C++ Logging
  • XML Trace

Additionally, you can enable the REST API logs from the following configurations:

rest.png



rest.png (63.6 KiB)
icon clock
10 |1500

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

Thank you @wasin.w .

The RestEnableLog enabling is providing much help. It seems that the connection is there, we get the authentication token and get the list of available services. After this, the application is still getting a retunr value of timeout when creating the consummer. This happened even after we increassed the load time...
Will come back after some more investigation, though the network connection seems to be there, as the python test examples are working.

Upvotes
24.8k 54 17 14

Hello @andrei.damian

Does the Python examples that work fine are from the GitHub WebSocket Examples folder /RDP/python repository? If so, those Python RTO Examples are using the Real-Time WebSocket API to connect to the RTO streaming server via the WebSocket connection on port number 443.

The EMA C++ API connects to the RTO streaming server via the LSEG proprietary TCP-based connection named "RSSL" on port number 14002 by default. Does the machine has some kind of firewall, network policy, or SELinux that might block a connection on port 14002?


icon clock
10 |1500

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

Indeed, there were the python exmaples in the github repos.

After some config changes - setting the host and port config in the app and whitelisting all the RTO IPs on port 14002, and setting in /etc/hosts the IP of the refinitiv address to point to the private connection point IP, the app is connecting. So there is something with the connection settings we must fix on our side.

Thank you for the support.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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