RTSDK EMA C++ -not able to set serviceName and see it right away

For my unit tests I need to set name and serviceName to my message. I need to create a message and then pass it to my OmmConsumerClient class. But it did not work.


After multiple attempts to make my code work, I finally realised that the issue is in particular logic of setting serviceName. When setting serviceName message, using the function with corresponding name, hasServiceName function always returns false.


I have checked the official unit tests and it appears that they specifically check that serviceName is not set even after it was set few lines above.


For example, official unit-tests of RefreshMsg - Real-Time-SDK/Cpp-C/Ema/Examples/Test/UnitTest/RefreshMsgTests.cpp at master · Refinitiv/Real-Time-SDK · GitHub :


//serviceName is only kept on the encoded RsslMsg
refresh.serviceName( serviceName );
// Other code...
EXPECT_FALSE( refresh.hasServiceName() ) << "RefreshMsg::hasServiceName() == false" ;

I have digged deeper into the code of internal encoders and decoders. There is a serviceId field which actually can be set.


Could somebody help me with writing a unit-test ? Comment above in the code states that serviceName is only kept on the encoded RsslMsg. How can I achieve a proper RefreshMsg object with name and serviceName set ?


Also, I am curious why such behavior was chosen ?

Best Answer

  • Jirapongse
    Answer ✓

    @Ruslan Arkhyryeyev

    Thank you for reaching out to us.

    It could be the limitation in the EMA.

    If you are an Refinitiv Developer Connect (RDC) named user, please contact the API support team directly via Contact Premium Support to verify this behavior.

    Otherwise, you can sumit this issue on GitHub.


Answers

  • In Refinitiv Real-Time SDK (RTSDK) C++, setting a serviceName in the RefreshMsg (or any message) doesn't behave the way one might expect, particularly Papa's Pizzeria because the serviceName is not retained on the RefreshMsg object directly. Instead, the serviceName is only encoded when the message is serialized (encoded) into an RsslMsg for transport.