how to specify list of fields to receive in the request, Java SDK
I want to specify currency for RIC in which I need a price,
how I can do it ?
Also it would be great to specify exact list of fields.
I would appreciate it if you could give me a code snippet
Best Answer
-
Hello @monakhov
Elektron SDK Java Packages provide example360__MarketPrice__View demonstrating how to use View in EMA Java, the application source code is in <Elektron-SDK_Java_Package> \Java\Ema\Examples\src\main\java\com\thomsonreuters\ema\examples\training\consumer\series300\example360__MarketPrice__View, please modify Consumer.java as the following:
- Modify .host("localhost:14002").username("user") to be your server host and username
- After array.add(EmaFactory.createOmmArrayEntry().intValue(25)); line add the currency field id(15) line:
array.add(EmaFactory.createOmmArrayEntry().intValue(15));//field id of the currency
- Modify .serviceName("DIRECT_FEED").name("IBM.N") to be your service and your RIC(ASML.AS).
Then compile and run the example360__MarketPrice__View application.You should see the currency as the example shown below:
0
Answers
-
Hello @monakhov
You cannot specify the currency for RIC. The currency is set by
the feed and cannot be changed by any APIs. After EMA Java sends a RIC request, it will receive
data of the RIC including the currency generated by the feed and pass to the
application.View feature allows you to specify a list of fields to receive
in the request. For more details and example snipped source code, please refer
to Elektron Messaging API (Java) - Batch and View featuresHope this help.
1 -
ok, in the response I get only those fields:
FieldEntry fid="1" name="PROD_PERM" dataType="UInt" value="5926"
FieldEntry fid="2" name="RDNDISPLAY" dataType="UInt" value="116"
FieldEntry fid="3" name="DSPLY_NAME" dataType="Rmtes" value="ALLIANZ SE"
FieldEntry fid="4" name="RDN_EXCHID" dataType="Enum" value="202"
FieldEntry fid="5" name="TIMACT" dataType="Time" value="07:47:36:000:000:000"
FieldEntry fid="6" name="TRDPRC_1" dataType="Real" value="206.5"nothing more, how I can get currency ?
0 -
I try to repeat a code snippet from the manual but got an exception:
long handle = ommConsumer.registerClient(EmaFactory.createReqMsg().serviceName("IDN_INTERVAL_5S").name("ASML.AS").payload(view), priceEventHandler);
exception:
2019-05-09 09:43:04,325 INFO [pool-2-thread-9] c.s.c.a.r.a.v.ReutersIntradayClient Subscribing: Subscription[ric=ASML.AS,price=0.0,priceUpdated=false,assetClass=EQUITY,listingId=ListingId[instrumentId=id2,exchange=AS,currency=EUR]]
2019-05-09 09:43:04,325 ERROR [pool-2-thread-9] c.s.m.e.c.LoggingEventConsumerDecorator Exception while processing message
java.lang.ClassCastException: class com.thomsonreuters.upa.codec.ArrayImpl cannot be cast to class com.thomsonreuters.upa.codec.ElementListImpl (com.thomsonreuters.upa.codec.ArrayImpl and com.thomsonreuters.upa.codec.ElementListImpl are in unnamed module of loader 'app')
at com.thomsonreuters.upa.codec.Decoders.decodeElementEntry(Decoders.java:1099)
at com.thomsonreuters.upa.codec.ElementEntryImpl.decode(ElementEntryImpl.java:122)
at com.thomsonreuters.ema.access.ReqMsgImpl.checkBatchView(ReqMsgImpl.java:788)
at com.thomsonreuters.ema.access.ReqMsgImpl.payload(ReqMsgImpl.java:609)
at ReutersIntradayClient.subscribe(ReutersIntradayClient.java:78)0 -
I have found the same error. Please use the following code instead.
ElementList view = EmaFactory.createElementList();
view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));1 -
Hi @monakhov, Like others have mentioned, you cannot specify the currency for the returned quote, but it is possible to subscribe to your desired currency pair and recalculate the price in your code (provided user has permission to get FX data).
E.g: To convert Bid price for ASML.AS = 178.28 EUR into USD, another snapshot request can be made to EUR= to get the currency spot rate.
0 -
thank you very much it works!
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 162 App Studio
- 4 Block Chain
- 5 Bot Platform
- 17 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 370 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛