question

Upvotes
Accepted
3 0 0 2

Elektron Message Api(java) Forex Spot Fid(3) Fid(78) blank

Hi

I am using EMA java api to get forex spot market data. I was confirmed by support I can get contributor from Fid (3)and dealing code from Fid(78) . However, in updateMsg, those fields were blank.

Thanks.

Code:

OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig(); consumer = EmaFactory.createOmmConsumer( config.host("host:14002").username("xxxx").operationModel(OperationModel.USER_DISPATCH)); OmmConsumerClient eventHandler = this; ElementList batch = EmaFactory.createElementList(); OmmArray array = EmaFactory.createOmmArray(); array.add(EmaFactory.createOmmArrayEntry().ascii("EUR=")); array.add(EmaFactory.createOmmArrayEntry().ascii("GBP=")); array.add(EmaFactory.createOmmArrayEntry().ascii("JPY=")); batch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, array)); consumer.registerClient(EmaFactory.createReqMsg().serviceName("ELEKTRON_DD").payload(batch), eventHandler);

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-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.

1 Answer

Upvote
Accepted
38.1k 71 35 53

If your code is based on example370_MarketPrice_Batch, please verify the decode function if it contains switch/case for DataTypes.RMTES data type, as shown below.

void decode(FieldList fieldList)
    {

...
           if (Data.DataCode.BLANK == fieldEntry.code())
                System.out.println(" blank");
           else
                switch (fieldEntry.loadType())
                {
                case DataTypes.RMTES :
                    System.out.println(fieldEntry.rmtes().toString());
                    break;
                case DataTypes.REAL :
                    System.out.println(fieldEntry.real().asDouble());
                    break;
...
                }

...

}

After adding this code, you should see the data of FID 3 and 78 printed to the console.

Item Name: GBP=
Service Name: API_ELEKTRON_EPD_RSSL
...
Fid: 3 Name = DSPLY_NAME DataType: Rmtes Value: INTERPROMBAN MOW
Fid: 78 Name = OFFCL_CODE DataType: Rmtes Value: IPBM        
Fid: 105 Name = BCKGRNDPAG DataType: Rmtes Value: IPBM
...
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.

Thanks a lot. You saved my day.

Click below to post an Idea Post Idea