question

Upvotes
Accepted
129 16 25 31

Is it possible to enable Hex tracing in EMA C++?

elektronrefinitiv-realtimeelektron-sdkema-apirrtapielektron-message-apiconsumer
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

Hi @Akechi Sato

For such requirement, you will need to tweak EMA source code to enable the HEX trace.

I assume the requirement just only to see the HEX dump along with XmlTraceFile is enabled. You can follow the steps below.

  • In EMA project (you can find the source code in EMA package), look for the file
$Elektron-SDK1.0.1.win\Ema\Src\Access\Impl\ChannelCallbackClient.cpp
  • Find the method named
RsslReactorCallbackRet ChannelCallbackClient::processCallback
  • In there, you will find the condition when the XmlToTraceFile is enable as
if ( pChannelConfig->xmlTraceToFile )
	traceOptions.traceFlags |= RSSL_TRACE_TO_FILE_ENABLE;

You have to add another option to enable HEX trace as followed:

if ( pChannelConfig->xmlTraceToFile )
	traceOptions.traceFlags |= RSSL_TRACE_TO_FILE_ENABLE | RSSL_TRACE_HEX;

with this tweak, you will see the HEX dump as long as the XML trace is enabled. For example:

<!-- Incoming Message (Channel IPC descriptor = 184) -->
<!-- Time: 18:48:22:712 -->
<!-- rwfMajorVer="14" rwfMinorVer="0" -->
<updateMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="4" containerType="RSSL_DT_FIELD_LIST" flags="0x90 (RSSL_UPMF_HAS_SEQ_NUM|RSSL_UPMF_DO_NOT_CONFLATE)" updateType="0 (RDM_UPD_EVENT_TYPE_UNSPECIFIED)" seqNum="41006" dataSize="27">
    <dataBody>
        <fieldList flags="0x8 (RSSL_FLF_HAS_STANDARD_DATA)">
            <fieldEntry fieldId="3378" data="0CFE 6E"/>
            <fieldEntry fieldId="3379" data="0CFD 7C"/>
            <fieldEntry fieldId="3380" data="0CFE A6"/>
            <fieldEntry fieldId="3381" data="0CFE D1"/>
        </fieldList>
    </dataBody>
</updateMsg>
000E 0406 0000 0004 8090 0400 0000 A02E 0800 040D 3203 0CFE 6E0D 3303 0CFD 7C0D
3403 0CFE A60D 3503 0CFE D1
<!-- End Message (Channel IPC descriptor = 184) -->
<!-- Incoming Message (Channel IPC descriptor = 184) -->
<!-- Time: 18:48:22:731 -->
<!-- rwfMajorVer="14" rwfMinorVer="0" -->
<updateMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="4" containerType="RSSL_DT_FIELD_LIST" flags="0x90 (RSSL_UPMF_HAS_SEQ_NUM|RSSL_UPMF_DO_NOT_CONFLATE)" updateType="0 (RDM_UPD_EVENT_TYPE_UNSPECIFIED)" seqNum="41022" dataSize="13">
    <dataBody>
        <fieldList flags="0x8 (RSSL_FLF_HAS_STANDARD_DATA)">
            <fieldEntry fieldId="114" data="0C0A"/>
            <fieldEntry fieldId="372" data="0C09"/>
        </fieldList>
    </dataBody>
</updateMsg>
000E 0406 0000 0004 8090 0400 0000 A03E 0800 0200 7202 0C0A 0174 020C 09
<!-- End Message (Channel IPC descriptor = 184) -->
  • However, please make sure that your application is using the newly built EMA lib to see the result.
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.

@ Dhanakrit.Kim.Suanmalai

Thank you so much Dhanakrit. That's what I'm looking for.

Upvotes
25.3k 87 12 25

Hi,

In your EmaConfig.xml you can add the XmlTraceToFile parameter for the Channel that you wish to enable Xml Trace for.

e.g.

<Channel>
<Name value="Channel_1"/>
<ChannelType value="ChannelType::RSSL_SOCKET"/>
<CompressionType value="CompressionType::None"/>
<GuaranteedOutputBuffers value="5000"/>
<Host value="10.13.225.38"/>
<Port value="14002"/> 
<XmlTraceToFile value="1"/> 
</Channel>

Please refer to section 3.2.2 of the EmaConfigGuide.pdf for details on this and other XmlTrace related parameters.

Section 4.4.3 also illustrates an example that sets this value using Programmatic config (rather than EmaConfig.xml).

Regards,

Umer

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
129 16 25 31

@Umer.Nalla

Thank you very much for your help. I've followed your suggestion and got the following log:

<!-- Outgoing Message (Channel IPC descriptor = 224) -->
<!-- Time: 10:01:39:575 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<requestMsg domainType="RSSL_DMT_LOGIN" streamId="1" containerType="RSSL_DT_NO_DATA" flags="0x4 (RSSL_RQMF_STREAMING)" dataSize="0">
    <key  flags="0x22 (RSSL_MKF_HAS_NAME|RSSL_MKF_HAS_ATTRIB)"  name="piyasak" attribContainerType="RSSL_DT_ELEMENT_LIST">
        <attrib>
            <elementList flags="0x8 (RSSL_ELF_HAS_STANDARD_DATA)">
            </elementList>
        </attrib>
    </key>
    <dataBody>
    </dataBody>
</requestMsg>

However, I would also like to have hex data like the following RFA C++ trace file.

<!-- Outgoing Message to 'fxtrd43:14002' on 'localhost' interface -->
<!-- Time: 17:33:44:033 -->
<!-- Hex Dump
0065 0101 0000 0001 0400 805b 2609 4e75    .e.........[&.Nu
4d64 5353 5353 3201 054d 0800 030d 4170    MdSSSS2..M....Ap
706c 6963 6174 696f 6e49 6411 0332 3536    plicationId..256
0850 6f73 6974 696f 6e11 1031 302e 3435    .Position..10.45
2e36 332e 3131 382f 6e65 7418 446f 776e    .63.118/net.Down
6c6f 6164 436f 6e6e 6563 7469 6f6e 436f    loadConnectionCo
6e66 6967 0401 01                          nfig...
-->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<requestMsg domainType="RSSL_DMT_LOGIN" streamId="1" containerType="RSSL_DT_NO_DATA" flags="0x4 (RSSL_RQMF_STREAMING)" dataSize="0">
    <key  flags="0x26 (RSSL_MKF_HAS_NAME|RSSL_MKF_HAS_NAME_TYPE|RSSL_MKF_HAS_ATTRIB)"  name="NuMdSSSS2" nameType="1" attribContainerType="RSSL_DT_ELEMENT_LIST">
        <attrib>
            <elementList flags="0x8 (RSSL_ELF_HAS_STANDARD_DATA)">
                <elementEntry name="ApplicationId" dataType="RSSL_DT_ASCII_STRING" data="256"/>
                <elementEntry name="Position" dataType="RSSL_DT_ASCII_STRING" data="10.45.63.118/net"/>
                <elementEntry name="DownloadConnectionConfig" dataType="RSSL_DT_UINT" data="1"/>
            </elementList>
        </attrib>
    </key>
    <dataBody>
    </dataBody>
</requestMsg>

Not sure if I missed something.

Thanks & regards,

Akechi

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
25.3k 87 12 25

Hi Akechi,

I am not aware of EMA's ability to do a hex dump of the messages etc.

When you mentioned Hex, I mistakenly understood it to mean the standard XML trace where the Field Entry data is logged in Hex format, for example:

<updateMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="6" containerType="RSSL_DT_FIELD_LIST" flags="0x10 (RSSL_UPMF_HAS_SEQ_NUM)" updateType="1 (RDM_UPD_EVENT_TYPE_QUOTE)" seqNum="34192" dataSize="81">
    <dataBody>
        <fieldList flags="0x8 (RSSL_FLF_HAS_STANDARD_DATA)">
            <fieldEntry fieldId="3855" data="023E 2910"/>
            <fieldEntry fieldId="1025" data="0A1B 08"/>
            <fieldEntry fieldId="22" data="0C52 76"/>
            <fieldEntry fieldId="30" data="0E0F E0"/>
            <fieldEntry fieldId="291" data="0E02"/>
            <fieldEntry fieldId="6544" data="02"/>
            <fieldEntry fieldId="6579" data="30"/>
            <fieldEntry fieldId="1071" data="0F"/>
        </fieldList>
    </dataBody>
</updateMsg>

Apologies for the confusion.

Regards, Umer

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.