Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Elektron /
  • EMA /
avatar image
Question by Khaldoun · May 15, 2020 at 01:34 AM · elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apijavabatch

Can i have multiple batches or a batch contain multiple ItemList of arrays and multiple ViewData array

I am requesting batch of RIC array(ItemList) and FID array(ViewData) in java but now i also have some specific RIC for which i need to ask only specific fids which i cannot sent in one batch what approach i need to folllow? Can i have multiple batches or a batch contain multiple ItemList of arrays and multiple ViewData array?

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by pimchaya.wongrukun01 · May 15, 2020 at 03:12 AM

Hello @MayassK

I understand that you would like to request some RICs with difference fields e.g. RIC JPY=, TRI.N, 0005.HK with FID 22 and 25 and RIC EUR=, PTT.BK with FID 5 and 11. Is this right?

To request RICs with difference fields, you need to have multiple batch. Each batch contains the RICs with you would like the same fields . The example source code below shows to request RIC JPY=, TRI.N, 0005.HK with FID 22 and 25 and RIC EUR=, PTT.BK with FID 5 and 11.

OmmArray arrayv1 = EmaFactory.createOmmArray();
arrayv1.fixedWidth(2);
arrayv1.add(EmaFactory.createOmmArrayEntry().intValue(22));
arrayv1.add(EmaFactory.createOmmArrayEntry().intValue(25));
          
OmmArray arrayb1 = EmaFactory.createOmmArray();
arrayb1.add(EmaFactory.createOmmArrayEntry().ascii("JPY="));
arrayb1.add(EmaFactory.createOmmArrayEntry().ascii("TRI.N"));
arrayb1.add(EmaFactory.createOmmArrayEntry().ascii("0005.HK"));

ElementList batchView1 = EmaFactory.createElementList();
batchView1.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, arrayb1));
batchView1.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
batchView1.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, arrayv1));
          
consumer.registerClient(EmaFactory.createReqMsg().serviceName("ELEKTRON").payload(batchView1), appClient);

            

OmmArray arrayv2 = EmaFactory.createOmmArray();
arrayv2.fixedWidth(2);
arrayv2.add(EmaFactory.createOmmArrayEntry().intValue(5));
arrayv2.add(EmaFactory.createOmmArrayEntry().intValue(11)); 

OmmArray arrayb2 = EmaFactory.createOmmArray();
arrayb2.add(EmaFactory.createOmmArrayEntry().ascii("EUR="));
arrayb2.add(EmaFactory.createOmmArrayEntry().ascii("PTT.BK"));
            
ElementList batchView2 = EmaFactory.createElementList();
batchView2.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, arrayb2));
batchView2.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
batchView2.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, arrayv2));

consumer.registerClient(EmaFactory.createReqMsg().serviceName("ELEKTRON").payload(batchView2), appClient);
Comment
Khaldoun

People who like this

1 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Khaldoun · May 15, 2020 at 07:40 AM 0
Share

Thank you Pimchaya.Wongrukun for your help.

In your example code, your created two batch views but at runtime i am not sure about the number. It could be two or more.

Can you give me an example where I can create N number of batch views?

Thankyou!

avatar image
REFINITIV
Answer by pimchaya.wongrukun01 · May 15, 2020 at 09:02 AM

Hello @MayassK

To create N number of batch views, one possible solution is to declare a method which creates a batch views request and send the request to the server. Hence, you can call the method N times at runtime whenever you would like to send a request.

For example, I declare a method named sendBatchViewRequest(..) under Consumer class

void sendBatchViewRequest(Vector<String> RICs, Vector<Integer> fids, OmmConsumer consumer, AppClient appClient, String service) {
        OmmArray arrayv = EmaFactory.createOmmArray();
        arrayv.fixedWidth(2);
        Iterator<Integer> fidIter = fids.iterator(); 
        while (fidIter.hasNext()) 
           arrayv.add(EmaFactory.createOmmArrayEntry().intValue(fidIter.next()));
        
        OmmArray arrayb = EmaFactory.createOmmArray();
        Iterator<String> RICIter = RICs.iterator(); 
        while (RICIter.hasNext()) 
           arrayb.add(EmaFactory.createOmmArrayEntry().ascii(RICIter.next()));
        
        ElementList batchView = EmaFactory.createElementList();
        batchView.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, arrayb));
        batchView.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
        batchView.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, arrayv));
        
        consumer.registerClient(EmaFactory.createReqMsg().serviceName(service).payload(batchView), appClient);
}

Call the method to send a batch view request:

Consumer myConsumer = new Consumer();
Vector<String> RICsVector  = new Vector<String>();
RICsVector.add("EUR=");
RICsVector.add("PTT.BK");
Vector<Integer> fidsVector  = new Vector<Integer>();
fidsVector.add(5);
fidsVector.add(11);
myConsumer.sendBatchViewRequest(RICsVector,fidsVector,consumer,appClient,"ELEKTRTON");


Comment
Khaldoun

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
8 People are following this question.

Related Questions

(JAVA) Does using interestAfterRefresh(false) remove the need for deregistering items with Elektron?

EMA - How do I use batch reissue and close

Auto listener occupies 70-100% of CPU as we are waiting for the update(Consumer.dispatch)

We need price & quantity with Broker ID in SEHK in orderbook per L2 market feed? is there such kind of information?

NIProvider using RSSL_SOCKET over SSL: unable to publish data

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges