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?
Best Answer
-
Hello @Khaldoun
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);0
Answers
-
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!
0 -
Hello @Khaldoun
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");0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 33 Data Model Discovery
- 682 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.8K Refinitiv Data Platform
- 622 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 84 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛