question

Upvotes
Accepted
34 6 12 17

EMA ReconnectAttemptLimit

I am using Consumer app in example from EMA. Everything is fine and I have an infinite loop and let the callback handle refresh and update messages.


The issue is when the upstream disconnects the EMA tries to reconnect until ReconnectAttemptLimit is reached and stops trying again which is expected. However due to my infinite loop to let the app run forever, I am in situation where I do not know if the EMA is retrying or the ReconnectAttemptLimit is reached and will not retry to connect. Is there any way for me to see if the ReconnectAttemptLimit is reached?


I see that the Ema log shows Severity as Warning when it tries to reconnect and as Error when the retry limit is reached.



loggerMsg

TimeStamp: 10:54:25.573

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_1

Instance Name Consumer_1_1

RsslReactor 0x0x153ebe0

RsslChannel 0x0x153e3c0

Error Id -1

Internal sysError 107

Error Location /local/jenkins/workspace/ESDKCore_RCDEV/OS/RH8-64/rcdev/source/rtsdk/Cpp-C/Eta/Impl/Reactor/rsslReactorWorker.c:1480

Error Text </local/jenkins/workspace/ESDKCore_RCDEV/OS/RH8-64/rcdev/source/rtsdk/Cpp-C/Eta/Impl/Transport/rsslSocketTransportImpl.c:6115> Error: 1002 ipcConnecting() client connect() failed. System errno: (107)

loggerMsgEnd


loggerMsg

TimeStamp: 10:54:33.627

ClientName: ChannelCallbackClient

Severity: Error

Text: Received ChannelDown event on channel Channel_1

Instance Name Consumer_1_1

RsslReactor 0x0x153ebe0

RsslChannel 0x0x1539aa0

Error Id -1

Internal sysError 107

Error Location /local/jenkins/workspace/ESDKCore_RCDEV/OS/RH8-64/rcdev/source/rtsdk/Cpp-C/Eta/Impl/Reactor/rsslReactorWorker.c:1480

Error Text </local/jenkins/workspace/ESDKCore_RCDEV/OS/RH8-64/rcdev/source/rtsdk/Cpp-C/Eta/Impl/Transport/rsslSocketTransportImpl.c:6115> Error: 1002 ipcConnecting() client connect() failed. System errno: (107)

loggerMsgEnd


Through debug I can see when the retry limit is reached the channel is put into delete list but as OmmConsumer, I do not have any way to access that list since it is private. Any help please on figuring out if the EMA has reached reconnect attempt and will not try to reconnect?



trepema-api
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.

Upvote
Accepted
22.4k 59 14 21

Hi @vishal.anand,

The default value for Reconnect attempt is -1, which implies that the API will keep on trying to connect until successful. This would be a logical setup for most consumer applications.

Is there a reason you changed it, considering that your application is in an infinite loop.

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.

The Reconnect attempt is -1 and yes if it disconnects after connection was successfully, it keeps retrying.


I am talking about the 1st time trying to connect and can't. It exits after 5 tries throwing an exception. Is there a parameter to increase this tries at startup?


Exception Type='OmmInvalidUsageException', Text='login failed (timed out after waiting 45000 milliseconds)', ErrorCode='-4052'

Ok, this is not what you asked in your question. Initial connection attempts are different from reconnection attempts and the parameter ReconnectAttemptLimit does not play any role in it. There is a different parameter - LoginRequestTimeOut for that.

Upvote
32.2k 40 11 20

Hello @vishal.anand ,

Is the application registering a status callback and processing the information as received? Do you observe status with State = " ... channel down"? That would be an indication that the connection is down.

Please also refer to this previous discussion thread and this previous discussion thread for additional information about handling disconnects at the API level.

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.

Yes I am processing status messages. I am able to get the proper message and process it.


I just want to increase number of times the client app tries to connect at startup (meaning 1st time trying to connect).

Upvote
25.1k 57 17 14

Hello @vishal.anand

The EMA API does not expose the configuration to change the number of times the API attempt to reconnect for the initial connection (the 1st time trying to connect).

About the "Exception Type='OmmInvalidUsageException', Text='login failed (timed out after waiting 45000 milliseconds)', ErrorCode='-4052' " exception message, the application can increase the login timeout value via the LoginRequestTimeOut configuration parameter.

loginrequesttimeout.png

I did a quick test with the <LoginRequestTimeOut value="180000"/> configuration and connects to the unavailable server (to simulate the first connection), the API tries to connect to that server for 3 minutes before stopping retry.



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.

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.