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 /
  • ETA /
avatar image
Question by Satish.Pawar · Feb 22 at 10:17 PM · javaupathreadsafe

Is UPA library threadsafe?

Hi,


I am using UPA 3.5.1.0 Java library for interacting with Elektron and wondering whether this library is thread safe - can client application trying to send requests simultaneously?

I am trying to send MarketDataRequest (DomainType=MARKET_PRICE) from two different threads and getting sporadic exception inside library - like Null Pointer & Index out of bound etc. So would like to know whether library is thread-safe or whether application should synchronize code and allow only one message to send at a time?

Thanks,
Satish

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 jirapongse.phuriphanvichai · Feb 23 at 09:20 AM

@Satish.Pawar

ETA (the rebranded name of UPA) is thread-safe and thread-aware. The behavior depends on the locking model that the application is using.

For more information, please refer to 9.2.3 Transport Locking Models in the ETA Java Developers Guide.

From the usage description, it should have at least Channel locking.

Comment

People who like this

0 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.

avatar image
Answer by Satish.Pawar · Mar 04 at 02:13 PM

Hi @jirapongse.phuriphanvichai ,

Thanks for pointing to Developer Guide section for locking related details.

After going over details I got to know that library itself is not threadsafe but provided certain configuration option to lock the library. By threadsafe library/API is refer when multiple thread can access API & application dont have to acquire any lock because API is stateless. I see that there are class level buffers are used which maintain state causing multiple threads not to access API without locking.

I tried enabling glocalLocking(True) and channelReadLocking & channelWriteLocking but was still facing issue of data getting overwritten as multiple threads were trying to send subscription request at same time. For now I synchronized subscribe & unsubscribe (MarketPriceHandler) methods to make sure only single thread is accessing API.


Thanks for your help.

Satish

Comment

People who like this

0 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 >
10 People are following this question.

Related Questions

How should we implement the consumer's rdmLoginMsgCallback()

Elektron - Source dictionary service down

Reactor premature CHANNEL_READY on reconnect

How to detect "stale" items and groups in RSSL.

Can we subscribe to conflated data using Java ETA (UPA API)?

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • 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
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges