question

Upvotes
Accepted
1 0 1 1

RFA decoding payload

Hi All,

I'm having troubles in decoding the MapEntry. After logging in and successfully subscribing for multiple pairs I start receiving MMT_MARKET_BY_PRICE, so I get the payload and I iterate over the Map.

Here comes the problem! When I try to get the MapEntry Key the DataBuffer seems to be always blank.

Could you please which might be the issue? I attach here the code so that you can also take a look at the method calls that I'm using.

Thanks


// extracted just a piece of function needed for the troubleshotting
if(respMsg.getHintMask() & rfa::message::RespMsg::PayloadFlag) {
const rfa::common::Data& data = respMsg.getPayload();
if (data.isBlank()) {
return;
}

if(data.getDataType() == rfa::data::MapEnum) {
decodeMap(DateTime::now(),iInstrument.value(),static_cast<const rfa::data::Map&>(data));
} else{
LOG(ERROR) << "Cannot decode market data. Expexting a MapEntry to start decoding process";
}
}

decodeMap(const UtcNanos now, const std::size_t iInstrument, const rfa::data::Map& input) {
rfa::data::MapReadIterator it;
while(!it.off()){
modelUpdated |= decodeMapEntry(now,quoteModel,instrumentData,it.value());
it.forth();
  }
}

decodeMapEntry(const UtcNanos now,
ew::lp::QuoteModel& quoteModel,
const InstrumentData& instrumentData,
const rfa::data::MapEntry& input) {
const rfa::data::DataBuffer& buffer = static_cast<const rfa::data::DataBuffer&>(input.getKeyData());
if(buffer.isBlank()){
return false;
}
const std::string quoteID = buffer.getAsString().c_str();

switch(input.getAction()){
case rfa::data::MapEntry::Action::Update:
return updateQuote(now,"",quoteModel,instrumentData,static_cast<const rfa::data::FieldList&>(input.getData()));
case rfa::data::MapEntry::Action::Add:
return addQuote(now,"",quoteModel,instrumentData,static_cast<const rfa::data::FieldList&>(input.getData()));
case rfa::data::MapEntry::Action::Delete:
return deleteQuote("",quoteModel);
default:
LOG(ERROR) << "Unhandled MapEntry Action";
}
treprfarfa-api
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.

Hello @pcarrieri,

In order to better understand the issue you observe, please let us know:

Which version of RFA?

Does the same issue manifest on one of the simple examples that came with SDK, or only in the custom code?

Which RIC can we subscribe to reproduce?

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.
Thanks,
AHS

Upvotes
Accepted
32.2k 40 11 20

Hello @pcarrieri,

I am sorry if my explanation was not very clear.

I believe the issue is not that you are not decoding correctly. I believe you are requesting a combination of RIC and domain model from Elektron service that is not provided by the service.

To answer your question as asked, you can find the complete information in RFA C++ Developers Guides:

  • RDM Usage Guide - structure of MBP request and response fully explained
  • Developer Guide - details on requesting and decoding payloads.

In addition, to absorb the requesting and parsing of MbP quickly, I would either go over Consumer example with SDK, or go through step-by-step tutorial RFA C++ - Level 2 Refinitiv Data Model (RDM) data that also discusses requesting and decoding L2 data with RFA C++ and includes downloadable code example.

I hope this helps

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.

Hello @pcarrieri,

How did this question progress for you?

Were you able to progress by requesting a valid RIC + domain model combination?

Thanks for a quick update,

-AHS

Upvotes
32.2k 40 11 20

Hello @pcarrieri,

Just a guess here.

I am looking at RFA8 SDK for C++.

Consumer example included with SDK is my preferred way to test MarketByPrice model subscription. When testing for MbP model, the method it uses to parse is DecomeMapMap and not DecodeMap. When decoding map of maps, it never arrives at DecodeMapEntry code as you appear to be executing.

You may wish to approach your custom requirement this way:

1. Run Consumer example included with RFA SDK with MarketByPrice model:

#\ConsumerClient_10\msgModelRequestType            = "marketPrice"
\ConsumerClient_10\msgModelRequestType            = "marketByPrice"

2. Confirm that are able to parse required RIC properly.

3. Incorporate the same handling into your custom consumer app.

---

If this is a new consumer application you are working on, I would suggest avoiding RFA C++ and looking at Refinitiv Realtime SDK - C/C++ for new development. RFA is currently a supported feature-complete API, while Refinitiv Realtime SDK (formerly Elektron) is open source, supporting cloud-based infra as well as many other new features, actively improved API, and it's ease of use tier, EMA, should greatly decrease your time-to-code requirement, as compared to RFA.


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
1 0 1 1

Hello @zoya.farberov,

I'm using Robust Foundation API - C++ Edition 8.2.0 and subscribed to RIC code EUR=.

The adapter is mostly done. I just need to figure out this issue so I'd prefer to avoid switching to another library.

I tried running Robust Foundation API for Java Sample, since there's no C++ Sample available for this library, and I'm able to retrieve the data. So the problem is in my code.

If you could please indicate me how the data needs to be decoded that would be great and really helpful.


Thanks


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
32.2k 40 11 20

Hello @pcarrieri,

If you wish to consume RIC EUR=, I am assuming Refinitiv Realtime (fromerly Elektron) service, this RIC does not support MarketByPrice domain model. If you would like to consumer EUR=, please request a supported model, MarketPrice.

If you would like to consume MarketByPrice, the instrument would have to support this model, and your user to be permissioned for it.

If this is the case, nn your RFA C++ 8.2 SDK, please find Examples->Consumer.

This example supports common domain models, including Market By Price, examine and reuse MbP handling code.

Hope this helps?


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
1 0 1 1

Hi @zoya.farberov,

I've just got confirmed that I can subscribe for MarketByPrice to RIC EUR=. RFA SDK has a completely different way of sending and decoding the data respect to RFA Robust Foundation. If you could please provide an example for RFA Robust Foundation or at least indicate me the procedure to decode properly the data that would be great.


Thanks

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
32.2k 40 11 20

Hi @pcarrieri,

I am glad to tell you how to verify this, however, I am afraid this will still not work as you expect:

  1. Verify domain MP, RIC EUR= with Consumer example.
    1. Open Consumer example project, found with your RFA SDK Examples -> Consumer and build it,
    2. In ExampleRFA.cfg, modify Connection_RSSL to point to your local infrastructure
\Connections\Connection_RSSL\connectionType                    = "RSSL"
\Connections\Connection_RSSL\rsslPort                         = "14002"
\Connections\Connection_RSSL\hostName                        = "YOUR_ADS_ADDRESS"

3. in Consumer.cfg, modify service, if your service name differs from the defined there by default, and itemList to EUR=

# Service name to be used to request
\ConsumerClient_10\service                        = "ELEKTRON_DD"

# Comma separated RIC List to be used to request
#\ConsumerClient_10\itemList                        = "TRI.N"
\ConsumerClient_10\itemList                        = "EUR="

4. Run the example to observe streaming data.

2. Verify domain MbP, RIC EUR= with Consumer example.

  1. in Consumer.cfg, modify domain to MbP
# RDM message type, see more detail in RDM.h for enumerations
\ConsumerClient_10\msgModelRequestType            = "marketPrice"
#\ConsumerClient_10\msgModelRequestType            = "marketByPrice"

2. Run the example, if you are subscribing Refiinitiv Real-Time feed, should observe "Not found" error, as MbP is not supported for EUR=

3. Optional step, only if you are permissioned for this content, verify MbP RIC = K.TO

1. Leave modelRequest type as is.

2. Modify itemList = "K.TO"

3. Run Consumer example again, to observe streaming MbP for K.TO instrument.

I have just tested as described above, with RFA 8.1 SDK C++, shared.

Let us know how this works for you.

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
1 0 1 1

Hello @zoya.farberov,

I understand that I can run this example in RFA SDK and make it work but that's not what I need. Even if I do that the problem for me is still there.

Really there's no way to get help about decoding payload with RFA Foundation? There's not an updated reference/example that helps clients code correctly/properly the adapter?


Thanks

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.