-
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
messageType
passed in theMarketDataListener
onMessage
method tells you which sub-type to cast themessage
parameter to.message
(which is aMarketDataMessage
object) 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 ofMarketDataMessage
sub-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
, andTradeMessage
classes. 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…