question

Upvotes
Accepted
2 1 1 2

How to use account to view data using the EMA java library?

I have received a new account with machine id:

GE-A-01641484-3-2729

I think this account is for viewing Refinitiv data using the EMA java library.

Could you confirm if this account is indeed for viewing Refinitiv data using the EMA java library?


Assuming the account is for the above purpose, I have tried using the account and connecting to:

chp02-emea1.thomsonreuters.com

and specifying serviceName: DDS_TRCE.


I appear to login successfully to Refinitiv. However, the stream is always closed with:

2020-02-11T17:18:28,846 TunnelStreamListener [pool-3-thread-1] INFO : TunnelStreamListener.onAllMsg StatusMsg    streamId="5"    domain="System Domain"    privateStream    state="Closed / Suspect / Not entitled / 'TRCE not configured'"    name="TUNNEL1"    serviceId="10"    serviceName="DDS_TRCE"StatusMsgEnd

Looking at the documentation for EMA Java, all Refinitiv examples use serviceName: DIRECT_FEED.


However, when trying to use the DIRECT_FEED service instead of DDS_TRCE I receive an OmmInvalidUsageException:

2020-02-11T17:26:56,302 RefinitivConnector [refinitiv-connector-thread-1] ERROR: Failure connecting to Refinitiv: Exception Type='OmmInvalidUsageException', Text='Attempt to get servieId while it is not set.'


Could someone confirm that we should connect to the chp02-emea1.thomsonreuters.com endpoint with this GE-A-01641484-3-2729 account?

Also - any pointers as to how to use this account to view data would be appreciated.


Note that I am using a TunnelStream as I am specifying RSSL_ENCRYPTED.

The TunnelStreamListener is called back with a StatusMsg after registering as a client - code snippets:

private OmmConsumer createOmmConsumer()
{
    return EmaFactory.createOmmConsumer(
            EmaFactory.createOmmConsumerConfig(config.emaConfigFilePath())
            .username(config.account())
            .password(config.password())
                    .tunnelingKeyStoreFile(config.keyStoreFilePath())
                    .tunnelingKeyStorePasswd("password")
    );
}

private static ClassOfService createClassOfService()
{
    return EmaFactory.createClassOfService()
            .authentication(EmaFactory.createCosAuthentication().type(CosAuthentication.CosAuthenticationType.OMM_LOGIN))
            .dataIntegrity(EmaFactory.createCosDataIntegrity().type(CosDataIntegrity.CosDataIntegrityType.RELIABLE))
            .flowControl(EmaFactory.createCosFlowControl().type(CosFlowControl.CosFlowControlType.BIDIRECTIONAL).recvWindowSize(1200))
            .guarantee(EmaFactory.createCosGuarantee().type(CosGuarantee.CosGuaranteeType.NONE));
}

private void connectTunnelStream(final OmmConsumer ommConsumer, final ClassOfService classOfService)
{
    final TunnelStreamListener client = new TunnelStreamListener(ommConsumer, callbacks, this::reconnect, config);

    final TunnelStreamRequest tsr = EmaFactory.createTunnelStreamRequest()
            .classOfService(classOfService)
            .domainType(EmaRdm.MMT_SYSTEM)
            .name("TUNNEL1")
            .serviceName("DDS_TRCE");

    ommConsumer.registerClient(tsr, client); // <-- call is successful with DDS_TRCE, throws OmmInvalidUsageException with DIRECT_FEED
}

but the tunnel stream is not open:

@Override
public void onStatusMsg(final StatusMsg statusMsg, final OmmConsumerEvent consumerEvent)
{
    final long tunnelStreamHandle = consumerEvent.handle();

    if (statusMsg.state().streamState() != OmmState.StreamState.OPEN)
    {
        LOGGER.warn("Tunnel stream went down, will attempt to reconnect if not shutting down");
        this.callbacks.refinitivConnectionDownCallback().onConnectionDown();
        this.connectionDownListener.onConnectionDown();
    }
    else
    {
        // Never gets here - tunnel stream is not open
        ommConsumer.registerClient(
                EmaFactory.createReqMsg().serviceId(1).name("A_RIC"),
                new SubStreamListener(ommConsumer, callbacks),
                1,
                tunnelStreamHandle
        );
    }




The following shows logs and tracing:

2020-02-12T13:54:29,271 RefinitivConnector [refinitiv-connector-thread-1] INFO : Connecting to Refinitiv...

<!-- Outgoing Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/192.168.1.11:50726 remote=chp02-emea1.thomsonreuters.com/155.46.24.14:443] -->
<!-- Wed Feb 12 13:54:31 GMT 2020 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<REQUEST domainType="LOGIN" streamId="1" containerType="NO_DATA" flags="0x04 (STREAMING)" dataSize="0">
    <key flags="0x26 (HAS_NAME|HAS_NAME_TYPE|HAS_ATTRIB)" name="GE-A-01641484-3-2729" nameType="1" attribContainerType="ELEMENT_LIST">
        <attrib>
            <elementList flags="0x08 (HAS_STANDARD_DATA)">
                <elementEntry name="ApplicationId" dataType="ASCII_STRING" data="256"/>
                <elementEntry name="ApplicationName" dataType="ASCII_STRING" data="ema"/>
                <elementEntry name="Position" dataType="ASCII_STRING" data="ppp"/>
                <elementEntry name="Password" dataType="ASCII_STRING" data="xxx"/>
                <elementEntry name="Role" dataType="UINT" data="0"/>
            </elementList>
        </attrib>
    </key>
    <dataBody>
    </dataBody>
</REQUEST>


<!-- Incoming Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/192.168.1.11:50726 remote=chp02-emea1.thomsonreuters.com/155.46.24.14:443] -->
<!-- Wed Feb 12 13:54:31 GMT 2020 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<REFRESH domainType="LOGIN" streamId="1" containerType="NO_DATA" flags="0x168 (HAS_MSG_KEY|SOLICITED|REFRESH_COMPLETE|CLEAR_CACHE)" groupId="0" State: Open/Ok/None - text: "" dataSize="0">
    <key flags="0x26 (HAS_NAME|HAS_NAME_TYPE|HAS_ATTRIB)" name="GE-A-01641484-3-2729" nameType="1" attribContainerType="ELEMENT_LIST">
        <attrib>
            <elementList flags="0x08 (HAS_STANDARD_DATA)">
                <elementEntry name="ApplicationId" dataType="ASCII_STRING" data="256"/>
                <elementEntry name="ApplicationName" dataType="ASCII_STRING" data="ema"/>
                <elementEntry name="Position" dataType="ASCII_STRING" data="ppp"/>
                <elementEntry name="SingleOpen" dataType="UINT" data="0"/>
                <elementEntry name="SupportOMMPost" dataType="UINT" data="1"/>
                <elementEntry name="SupportBatchRequests" dataType="UINT" data="5"/>
            </elementList>
        </attrib>
    </key>
    <dataBody>
    </dataBody>
</REFRESH>


<!-- Outgoing Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/192.168.1.11:50726 remote=chp02-emea1.thomsonreuters.com/155.46.24.14:443] -->
<!-- Wed Feb 12 13:54:31 GMT 2020 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<REQUEST domainType="SOURCE" streamId="2" containerType="NO_DATA" flags="0x04 (STREAMING)" dataSize="0">
    <key flags="0x08 (HAS_FILTER)" filter="63"/>
    <dataBody>
    </dataBody>
</REQUEST>


<!-- Incoming Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/192.168.1.11:50726 remote=chp02-emea1.thomsonreuters.com/155.46.24.14:443] -->
<!-- Wed Feb 12 13:54:31 GMT 2020 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<REFRESH domainType="SOURCE" streamId="2" containerType="MAP" flags="0x168 (HAS_MSG_KEY|SOLICITED|REFRESH_COMPLETE|CLEAR_CACHE)" groupId="0" State: Open/Ok/None - text: "" dataSize="249">
    <key flags="0x08 (HAS_FILTER)" filter="63"/>
    <dataBody>
        <map flags="0x00" countHint="0" keyPrimitiveType="UINT" containerType="FILTER_LIST" >
            <mapEntry flags="0x00" action="ADD" key="10" >
                <filterList containerType="ELEMENT_LIST" countHint="0" flags="0x00">
                    <filterEntry id="1" action="SET" flags="0x00" containerType="ELEMENT_LIST">
                        <elementList flags="0x08 (HAS_STANDARD_DATA)">
                            <elementEntry name="Name" dataType="ASCII_STRING" data="DDS_TRCE"/>
                            <elementEntry name="Vendor" dataType="ASCII_STRING" data="Thomson Reuters RTTG Core Development"/>
                            <elementEntry name="Capabilities" dataType="ARRAY">
                                <array itemLength="0" primitiveType="UINT">
                                    <arrayEntry data="6"/>
                                    <arrayEntry data="127"/>
                                </array>
                            </elementEntry>
                            <elementEntry name="QoS" dataType="ARRAY">
                                <array itemLength="0" primitiveType="QOS">
                                    <arrayEntry Qos: Realtime/TickByTick/Static - timeInfo: 0 - rateInfo: 0/>
                                </array>
                            </elementEntry>
                        </elementList>
                    </filterEntry>
                    <filterEntry id="2" action="SET" flags="0x00" containerType="ELEMENT_LIST">
                        <elementList flags="0x08 (HAS_STANDARD_DATA)">
                            <elementEntry name="ServiceState" dataType="UINT" data="1"/>
                            <elementEntry name="AcceptingRequests" dataType="UINT" data="1"/>
                            <elementEntry name="Status" dataType="STATE" State: Open/Ok/None - text: ""/>
                        </elementList>
                    </filterEntry>
                    <filterEntry id="4" action="SET" flags="0x00" containerType="ELEMENT_LIST">
                        <elementList flags="0x08 (HAS_STANDARD_DATA)">
                            <elementEntry name="OpenWindow" dataType="UINT" data="6"/>
                        </elementList>
                    </filterEntry>
                    <filterEntry id="6" action="SET" flags="0x02 (HAS_CONTAINER_TYPE)" containerType="MAP">
                        <map flags="0x00" countHint="0" keyPrimitiveType="ASCII_STRING" containerType="ELEMENT_LIST" >
                            <mapEntry flags="0x00" action="ADD" key="DDS_TRCE" >
                                <elementList flags="0x08 (HAS_STANDARD_DATA)">
                                    <elementEntry name="Type" dataType="UINT" data="1"/>
                                    <elementEntry name="LinkState" dataType="UINT" data="1"/>
                                </elementList>
                            </mapEntry>
                        </map>
                    </filterEntry>
                </filterList>
            </mapEntry>
        </map>
    </dataBody>
</REFRESH>

2020-02-12T13:54:31,426 RefinitivConnector [refinitiv-connector-thread-1] INFO : Setting OmmConsumer
2020-02-12T13:54:31,434 RefinitivConnector [refinitiv-connector-thread-1] INFO : ... connected to Refinitiv

<!-- Outgoing Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/192.168.1.11:50726 remote=chp02-emea1.thomsonreuters.com/155.46.24.14:443] -->
<!-- Wed Feb 12 13:54:31 GMT 2020 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<REQUEST domainType="SYSTEM" streamId="3" containerType="FILTER_LIST" flags="0x1144 (STREAMING|HAS_QOS|PRIVATE_STREAM|QUALIFIED_STREAM)" Qos: Realtime/TickByTick/Static - timeInfo: 0 - rateInfo: 0 dataSize="171">
    <key flags="0x0B (HAS_SERVICE_ID|HAS_NAME|HAS_FILTER)" serviceId="10" name="TUNNEL1" filter="15"/>
    <dataBody>
        <filterList containerType="ELEMENT_LIST" countHint="0" flags="0x00">
            <filterEntry id="1" action="SET" flags="0x02 (HAS_CONTAINER_TYPE)" containerType="ELEMENT_LIST">
                <elementList flags="0x08 (HAS_STANDARD_DATA)">
                    <elementEntry name=":ProtocolType" dataType="UINT" data="0"/>
                    <elementEntry name=":ProtocolMajorVersion" dataType="UINT" data="14"/>
                    <elementEntry name=":ProtocolMinorVersion" dataType="UINT" data="1"/>
                    <elementEntry name=":StreamVersion" dataType="UINT" data="2"/>
                </elementList>
            </filterEntry>
            <filterEntry id="2" action="SET" flags="0x02 (HAS_CONTAINER_TYPE)" containerType="ELEMENT_LIST">
                <elementList flags="0x08 (HAS_STANDARD_DATA)">
                    <elementEntry name=":Type" dataType="UINT" data="1"/>
                </elementList>
            </filterEntry>
            <filterEntry id="3" action="SET" flags="0x02 (HAS_CONTAINER_TYPE)" containerType="ELEMENT_LIST">
                <elementList flags="0x08 (HAS_STANDARD_DATA)">
                    <elementEntry name=":Type" dataType="UINT" data="1"/>
                    <elementEntry name=":RecvWindowSize" dataType="INT" data="1200"/>
                </elementList>
            </filterEntry>
            <filterEntry id="4" action="SET" flags="0x02 (HAS_CONTAINER_TYPE)" containerType="ELEMENT_LIST">
                <elementList flags="0x08 (HAS_STANDARD_DATA)">
                    <elementEntry name=":Type" dataType="UINT" data="1"/>
                </elementList>
            </filterEntry>
        </filterList>
    </dataBody>
</REQUEST>


<!-- Incoming Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/192.168.1.11:50726 remote=chp02-emea1.thomsonreuters.com/155.46.24.14:443] -->
<!-- Wed Feb 12 13:54:31 GMT 2020 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<REFRESH domainType="SYSTEM" streamId="3" containerType="FILTER_LIST" flags="0x4568 (HAS_MSG_KEY|SOLICITED|REFRESH_COMPLETE|CLEAR_CACHE|PRIVATE_STREAM|QUALIFIED_STREAM)" groupId="0" State: Open/Ok/None - text: "" dataSize="232">
    <key flags="0x0B (HAS_SERVICE_ID|HAS_NAME|HAS_FILTER)" serviceId="10" name="TUNNEL1" filter="15"/>
    <dataBody>
        <filterList containerType="ELEMENT_LIST" countHint="0" flags="0x00">
            <filterEntry id="1" action="SET" flags="0x00" containerType="ELEMENT_LIST">
                <elementList flags="0x08 (HAS_STANDARD_DATA)">
                    <elementEntry name=":MaxMsgSize" dataType="UINT" data="614400"/>
                    <elementEntry name=":MaxFragmentSize" dataType="UINT" data="6144"/>
                    <elementEntry name=":SupportsFragmentation" dataType="UINT" data="1"/>
                    <elementEntry name=":ProtocolType" dataType="UINT" data="0"/>
                    <elementEntry name=":ProtocolMajorVersion" dataType="UINT" data="14"/>
                    <elementEntry name=":ProtocolMinorVersion" dataType="UINT" data="1"/>
                    <elementEntry name=":StreamVersion" dataType="UINT" data="2"/>
                </elementList>
            </filterEntry>
            <filterEntry id="2" action="SET" flags="0x00" containerType="ELEMENT_LIST">
                <elementList flags="0x08 (HAS_STANDARD_DATA)">
                    <elementEntry name=":Type" dataType="UINT" data="1"/>
                </elementList>
            </filterEntry>
            <filterEntry id="3" action="SET" flags="0x00" containerType="ELEMENT_LIST">
                <elementList flags="0x08 (HAS_STANDARD_DATA)">
                    <elementEntry name=":Type" dataType="UINT" data="1"/>
                    <elementEntry name=":RecvWindowSize" dataType="INT" data="750000"/>
                </elementList>
            </filterEntry>
            <filterEntry id="4" action="SET" flags="0x00" containerType="ELEMENT_LIST">
                <elementList flags="0x08 (HAS_STANDARD_DATA)">
                    <elementEntry name=":Type" dataType="UINT" data="1"/>
                </elementList>
            </filterEntry>
        </filterList>
    </dataBody>
</REFRESH>


<!-- Outgoing Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/192.168.1.11:50726 remote=chp02-emea1.thomsonreuters.com/155.46.24.14:443] -->
<!-- Wed Feb 12 13:54:31 GMT 2020 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<GENERIC domainType="SYSTEM" streamId="3" containerType="MSG" flags="0x19 (HAS_EXTENDED_HEADER|HAS_SEQ_NUM|MESSAGE_COMPLETE)" seqNum="1" dataSize="175">
    <extendedHeader data="0100"/>
    <dataBody>
        <REQUEST domainType="LOGIN" streamId="1" containerType="NO_DATA" flags="0x04 (STREAMING)" dataSize="0">
            <key flags="0x26 (HAS_NAME|HAS_NAME_TYPE|HAS_ATTRIB)" name="GE-A-01641484-3-2729" nameType="1" attribContainerType="ELEMENT_LIST">
                <attrib>
                    <elementList flags="0x08 (HAS_STANDARD_DATA)">
                        <elementEntry name="ApplicationId" dataType="ASCII_STRING" data="256"/>
                        <elementEntry name="ApplicationName" dataType="ASCII_STRING" data="ema"/>
                        <elementEntry name="Position" dataType="ASCII_STRING" data="ppp"/>
                        <elementEntry name="Password" dataType="ASCII_STRING" data="xxx"/>
                        <elementEntry name="Role" dataType="UINT" data="0"/>
                    </elementList>
                </attrib>
            </key>
            <dataBody>
            </dataBody>
        </REQUEST>
    </dataBody>
</GENERIC>


<!-- Incoming Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/192.168.1.11:50726 remote=chp02-emea1.thomsonreuters.com/155.46.24.14:443] -->
<!-- Wed Feb 12 13:54:31 GMT 2020 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<GENERIC domainType="SYSTEM" streamId="3" containerType="NO_DATA" flags="0x11 (HAS_EXTENDED_HEADER|MESSAGE_COMPLETE)" dataSize="0">
    <extendedHeader data="0200 0000 0001 0000 000B 71B0"/>
    <dataBody>
    </dataBody>
</GENERIC>


<!-- Incoming Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/192.168.1.11:50726 remote=chp02-emea1.thomsonreuters.com/155.46.24.14:443] -->
<!-- Wed Feb 12 13:54:34 GMT 2020 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<GENERIC domainType="SYSTEM" streamId="3" containerType="MSG" flags="0x19 (HAS_EXTENDED_HEADER|HAS_SEQ_NUM|MESSAGE_COMPLETE)" seqNum="1" dataSize="198">
    <extendedHeader data="0100"/>
    <dataBody>
        <STATUS domainType="LOGIN" streamId="1" containerType="NO_DATA" flags="0xA8 (HAS_MSG_KEY|HAS_STATE|PRIVATE_STREAM)" State: Closed/Suspect/Not entitled - text: "TRCE not configured" dataSize="0">
            <key flags="0x26 (HAS_NAME|HAS_NAME_TYPE|HAS_ATTRIB)" name="GE-A-01641484-3-2729" nameType="1" attribContainerType="ELEMENT_LIST">
                <attrib>
                    <elementList flags="0x08 (HAS_STANDARD_DATA)">
                        <elementEntry name="ApplicationId" dataType="ASCII_STRING" data="256"/>
                        <elementEntry name="ApplicationName" dataType="ASCII_STRING" data="ema"/>
                        <elementEntry name="Position" dataType="ASCII_STRING" data="ppp"/>
                        <elementEntry name="Password" dataType="ASCII_STRING" data="xxx"/>
                        <elementEntry name="Role" dataType="UINT" data="0"/>
                    </elementList>
                </attrib>
            </key>
            <dataBody>
            </dataBody>
        </STATUS>
    </dataBody>
</GENERIC>

2020-02-12T13:54:34,286 TunnelStreamListener [pool-3-thread-1] INFO : TunnelStreamListener.onAllMsg StatusMsg
    streamId="5"
    domain="System Domain"
    privateStream
    state="Closed / Suspect / Not entitled / 'TRCE not configured'"
    name="TUNNEL1"
    serviceId="10"
    serviceName="DDS_TRCE"
StatusMsgEnd

2020-02-12T13:54:34,286 TunnelStreamListener [pool-3-thread-1] WARN : Tunnel stream went down, will attempt to reconnect if not shutting down
2020-02-12T13:54:34,287 RefinitivDataViewer [pool-3-thread-1] INFO : Connection is DOWN
2020-02-12T13:54:34,287 RefinitivConnector [pool-3-thread-1] INFO : Reconnecting to Refinitiv in 5 seconds
elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apijavalog-in
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.

Upvotes
Accepted
25.1k 87 11 24

Hi @richard.bradford

Are you trying to connect to our Contributions Channel to contribute / post data OR do you wish to consume(view) realtime Market data?

If you are trying to consume (view) realtime Market data, then I recommend you work through
EMA Quick Start - Connecting to Elektron Real Time in Cloud and then the EMA Consumer Tutorials using the servicename 'ELEKTRON_DD' instead.
Note that the tutorial code does not cover ERT in Cloud connectivity - but the rest of the tutorial steps on Requesting, Parsing etc are still applicable/relevant.

If however, you do wish to use TRCC then refer to the TRCC tutorial EMA Consumer - Posting data to TR Contribution Channel

However, based on the trace you have provided above it would appear the TRCE is not enabled for your machine ID - please check with your Refinitiv Account team.

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.

Upvotes
25.1k 87 11 24

Hi @richard.bradford

Your Refinitiv account team have confirmed that you have been provided this new MachineID in order to consume data from ERT in Cloud - as opposed to contributing to the TRCC system.

Therefore, please follow the EMA Quick Start I mentioned above to confirm connectivity and login. Once done, you can work through the EMA Consumer tutorials to get a better understanding of how to consume data using EMA.

I would recommend you refer to and amend the example450__MarketPrice__QueryServiceDiscovery (in the ema\examples\training\consumer\series400 folder of the full ElektronSDK) whilst working through the tutorials.
The tutorial examples are designed to login and connect to a deployed server - rather than the cloud. Once logged in and connected, the code for requesting data, handling the events and parsing the data is the same.


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.