question

Upvotes
Accepted
9 0 0 1

EMA channel failover and tunnel stream

I am using EMA C++ application and create a tunnel stream for posting messages.

I have two channels in the Ema Config. When channel 1 has status of down, it works as expected to auto failover to channel 2.

Question:

if a tunnel stream is already created after channel 1 is up, when channel 1 is down and failover to channel 2, is the original tunnel stream still valid? Or do I have to create a new tunnel stream for posting data.


elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-api
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.

Upvotes
Accepted
11.3k 25 8 13

To close the tunnel stream, the unregister method can be called on the tunnel stream handle. The call has been implemented and there have been no issue since June 10th.

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.

Upvotes
11.3k 25 8 13

Hi @ye.li,

Once connection is down, the Tunnel Stream will be closed and there is no recovery on tunnel stream. Application has to create a new Tunnel Stream once the connection is recovered or failover. You can find the instructions for EMA application to handle the tunnel stream recovery in this question. The instructions are similar for both EMA C++ and Java.

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.

Upvotes
9 0 0 1

okay, I can create a new tunnel stream in the onUpdateMsg for directory domain. However sometimes i got the following errors in the log after i log on to the private tunnel stream. What do these errors mean? I haven't posted anything yet when I received them.

loggerMsg
TimeStamp: 2020/06/04 17:17:25.729
ClientName: TunnelItem
Severity: Error
Text: Internal error. Current stream Id in TunnelItem::getSubItem( UInt32 ) is less than the starting stream id.
loggerMsgEnd

loggerMsg
TimeStamp: 2020/06/04 17:17:25.729
ClientName: ItemCallbackClient
Severity: Error
Text: Received a tunnel stream message event containing sub stream message with unknown streamId 1. Message is dropped.
Instance Name TRConsumer_1
RsslChannel 0x0x1759550
Tunnel Stream Handle 140323426698640
Tunnel Stream name XXX_TUNNEL
Tunnel Stream serviceId 10
Tunnel Stream streamId 6
loggerMsgEnd




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.

Upvotes
11.3k 25 8 13

Hi @ye.li,

From the code, the error message indicates that EMA received a tunnel stream message containing sub stream message with invalid stream ID (1).

To investigate the issue:

- please enable and provide me the message tracing. The tracing should log the raw message received from network.

To enable the tracing, please add the XmlTraceToFile parameter for the Channel that you wish to enable Xml Trace for. The file will be in "emaLog_<pid>.log" format.

e.g.

<Channel>
<Name value="Channel_1"/>
<ChannelType value="ChannelType::RSSL_SOCKET"/>
...
<XmlTraceToFile value="1"/> 
</Channel>

- provide snippet code of your modification which recreates the tunnel stream.

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.

Upvotes
9 0 0 1

The issue doesn't happen all the time, and didn't reproduce it until yesterday. I got the same error, it happened after a normal tunnel stream open and login.

attached logger file logger_error.txt

ema trace file EmaTrace_error.txt



logger-error.txt (2.5 KiB)
ematrace-error.txt (30.3 KiB)
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.

Upvotes
11.3k 25 8 13

Hi @ye.li,

Thanks for the files. I have seen the following message received from server. The Status message was sent on tunnel stream with stream id=1 which is not valid stream id for EMA so the error message was logged.

To investigate this issue further, please contact Contribution Channel support to verify the cause of the "Duplicate Session Name Detected - Please contact support - Your connection will now be closed. Issued by CFE" status. On the MyRefinitiv Product support, please select the "Thomson Reuters Contributions Channel" as Product.

<!-- End Message (Channel IPC descriptor = 16) -->
<!-- Incoming Message (Channel IPC descriptor = 16) -->
<!-- Time: 10:41:25:310 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<genericMsg domainType="RSSL_DMT_SYSTEM" streamId="4" containerType="RSSL_DT_MSG" flags="0x19 (RSSL_GNMF_HAS_EXTENDED_HEADER|RSSL_GNMF_HAS_SEQ_NUM|RSSL_GNMF_MESSAGE_COMPLETE)" seqNum="6" dataSize="121">
    <extendedHeader data="0100"/>
    <dataBody>
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
        <statusMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="1" containerType="RSSL_DT_NO_DATA" flags="0x60 (RSSL_STMF_HAS_STATE|RSSL_STMF_CLEAR_CACHE)" dataState="RSSL_DATA_SUSPECT" streamState="RSSL_STREAM_CLOSED" code="RSSL_SC_NOT_ENTITLED" text="Duplicate Session Name Detected - Please contact support - Your connection will now be closed. Issued by CFE"  dataSize="0">
            <dataBody>
            </dataBody>
        </statusMsg>
    </dataBody>
</genericMsg>
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.

Upvotes
9 0 0 1

I reached out to the product support on the duplicate session error. They said it could be related to previous session is not properly closed.

When I exit the application, do I need to close the post stream or the tunnel stream or unregister anything?


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.

Hi @ye.li,

I have been looking into the cleanup method. I will keep you posted.

Click below to post an Idea Post Idea