question

Upvotes
Accepted
3 0 0 2

Microsecond RFA7 -> 8 Migration

Hey,

We currently publish RFA8 DateTimes to users who consume the data via RFA7 clients. This causes problems in these clients.

We understand that there are 2 accepted solutions here in that:
Our consumers are upgraded to RFA8
Our consumers are written to cope with errors that arise from this precision in RFA7

However we have clients unwilling to upgrade to RFA8, and further, are reluctant to make changes at all to their consumers. As such we are investigating the avenue of removing/not publishing RFA8 Times with precision more than millisecond.

So our questions are as follows:
In RFA 8 headers (DateTime.h, Time.h) , setMicrosecond looks to be able to receive 2047 as a blank value, but setting this throws an exception "InvalidUsageException". Why is this?

Is there another method of truncating the timestamp to a maximum of millisecond precision in order to protect downstream consumers which are not ready to consume this precision of timestamp?

Simply leaving the microsecond unset provides us with this error in the downstream client:

MarketPriceClient::processEvent() -InvaidUsageException->Data decoding failed in DataBuffer::getAsString()

For some context, our tests were conducted using the rfa client RDMConsumer.

Many Thanks!

treprfarfa-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.

Hello @akyle

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks,


AHS

1 Answer

Upvotes
Accepted
38.1k 71 35 53

@akyle

You need to set microseconds and nanoseconds to zero.

    Time time;
    time.setHour(3);
    time.setMinute(4);
    time.setSecond(10);
    time.setMillisecond(10);
    time.setMicrosecond(0);
    time.setNanosecond(0);
    field.setFieldID(14263);
    dataBuffer.setTime(time);
    field.setData(dataBuffer);
    fieldListWIt.bind(field);

Then the data will have five bytes which RFA C++ 7.x can decode.

            <fieldEntry fieldId="14263" data="0304 0A00 0A"/>

If you set it to blank data (2047), the data will have more than five bytes which cause InvalidUsageException on the RFA C++ 7.x consumer.

            <fieldEntry fieldId="14263" data="0304 0A00 0A3F FFFF"/>
---------------------------
Exception Error
---------------------------
AN EXCEPTION HAS BEEN THROWN!  The following information describes the exception:
Exception Type: InvalidUsageException
Exception Severity: Error
Exception Classification: IncorrectAPIUsage
Exception Status Text: Data decoding failed in DataBuffer::getTime(); Reason: RSSL_RET_INCOMPLETE_DATA

---------------------------
OK   
---------------------------

I have tested this with a direct connection between RFA C++ 8.1.1.L1 Interactive Provider and RFA C++ 7.6.2.E1 Consumer.

For more information, please refer to the Coding For High Precision Time article.

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.

Hey, thanks for your reply. I have tried this and it works, so thanks again.

Click below to post an Idea Post Idea