question

Upvotes
Accepted
3 0 0 3

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-sdkema-apirrtelektron-message-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.

1 Answer

· Write an Answer
Upvote
Accepted
78.1k 246 52 72

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 512.0 KiB each and 1.0 MiB total.

Thanks a lot. You saved my day.

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.