question

Upvotes
Accepted
0 1 2 4

Omm mock Tests

In 7.6* API we have TibMsg tibMsg = new TibMsg() so we can create a mock message and reply to mock tests. But in 8.1* there is no Tib libraries and response we get is OmmMsg. So can someone please guide on how I can create new OmmMsg since it's interface so can't create new and don't have any implementations for this interface too.

treprfarfa-apiOMM
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
Accepted
9.6k 10 7 7

Hello @Jaydipkumar.pansuriya

Please refer to RFA Java Developers Guide in section 6.14 Creating the Message which explains how to create OMM message in details with the sample source code.

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

Hi @Jaydipkumar.pansuriya

Are you using RFA Java or C++ - I will assume RFA Java based on the TibMsg() snippet above?

You are correct that you cannot create an OMMMsg directly.

You can use acquireMsg() to acquire an OMMMsg from OMMPool and then releaseMsg() to release the OMMMsg back to the pool when finished with it.

This is described in more detail in the RFA Java Documentation - including the RFAJ_DeveloperGuide - which you can also find in the Docs folder of the RFA SDK package.

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.

Thank you @Umer Nalla for reply.

I am using RFA Java. Issue is that I want to write a mock test which will provide me mocked OMMMsg. With Tib I was doing like this

TibMsg tibMsg = new TibMsg();
for (Map.Entry<String, String> entrySet : fakeEntries.entrySet()) {
tibMsg.Append(entrySet.getKey(), entrySet.getValue());
}

But now that OMMMsg is an interface and its architecture is also complex that I can not implement that interface and create a new Mock class.

When I acquire msg from pool it will be kind of blank object and I want to set payload and other information also which I can't figure out how to do.

For mocking/testing there is no information provided in guides.

Upvote
25.3k 87 12 25

Hi @Jaydipkumar.pansuriya

You have not explained exactly why you need to create your Mock class. I can only assume you are using it to publish dummy data in response to a request for such data by a subscriber.

If this is the case, then please refer to the RFA Java StarterProviderInteractive example which you can find in the Examples\com\reuters\rfa\example\omm\prov folder.

In there you will find the ProviderClientSession class which has a couple of methods which show how to publish dummy data responses - processItemRequest() and sendUpdates().

However, before you go too far down this route - is there any reason why you cannot use our newer Elektron Message API (EMA) Java edition to develop your new OMM based application?

I mention EMA because it is generally much simpler to learn, develop and maintain code using EMA than RFA. So, if you compare the above RFA example code with the code demonstrated in the EMA NI Provider tutorial - you will see how much simpler the code for publishing a response is in EMA Java compared to RFA.

EMA is also our strategic API - so any new features etc will only appear in EMA. RFA is feature-complete - and therefore it does not generally make sense to develop any new applications using RFA (unless you have a strong reason for doing so).

To get an appreciation of EMA, I recommend you spend some time working through the tutorials - so you can determine for yourself how much simpler EMA is to use.

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.

You are right I am creating mock tests so writing code to send dummy data in response. Currently we are moving from SSL to RSSL so need to upgrade RFA api. But definitely I will look at your suggestion to move to EMA. Just one thing is there any separate licence required for EMA? I will propose this to team after gathering details on it.

Upvote
9.6k 10 7 7

Hello @Jaydipkumar.pansuriya

EMA is free. You do not need to have any license.

To migrate from RFA MarketData interface to EMA, please refer to Why Migrate from RFA to EMA API? video. This video explains what EMA is, the benefits, the comparison of RFA and EMA, resources which help you to migrate from RFA to EMA.

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.