-
|
Hello, I want to get a quote's price using stockMarketDataStreaming, how do i do that as "message" is a MarketDataMessage and has no getters. @Petersoj |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The Note that the So with that said, the following snippet shows how to properly listen to AAPL quotes: |
Beta Was this translation helpful? Give feedback.
The
messageTypepassed in theMarketDataListeneronMessagemethod tells you which sub-type to cast themessageparameter to.message(which is aMarketDataMessageobject) has several sub-types that you must cast to in order to get the desired getters/setters of the market data object. You can see all ofMarketDataMessagesub-types here. As shown in the Direct Known Subclasses section in that Javadoc, there are several sub-types includingSymbolMessage, which is the super type to theBarMessage,QuoteMessage, andTradeMessageclasses. These are the classes should be cast to in order to acquire the relevant getters/setters for themessageType. Additionally, here is a list of all the possible…